本文整理汇总了C++中DynamicPreprocessorData::inlineMode方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicPreprocessorData::inlineMode方法的具体用法?C++ DynamicPreprocessorData::inlineMode怎么用?C++ DynamicPreprocessorData::inlineMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicPreprocessorData
的用法示例。
在下文中一共展示了DynamicPreprocessorData::inlineMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
/**
**
** xlink2state { <enable/disable> <drop> }
**
** @param ErrorString error string buffer
** @param ErrStrLen the length of the error string buffer
**
** @return an error code integer
** (0 = success, >0 = non-fatal error, <0 = fatal error)
**
** @retval 0 successs
** @retval -1 generic fatal error
*/
static int ProcessXlink2State(char *ErrorString, int ErrStrLen)
{
char *pcToken;
int iEnd = 0;
pcToken = strtok(NULL, CONF_SEPARATORS);
if(!pcToken)
{
snprintf(ErrorString, ErrStrLen,
"Invalid xlink2state argument format.");
return -1;
}
if(strcmp(CONF_START_LIST, pcToken))
{
snprintf(ErrorString, ErrStrLen,
"Must start xlink2state arguments with the '%s' token.",
CONF_START_LIST);
return -1;
}
while ((pcToken = strtok(NULL, CONF_SEPARATORS)) != NULL)
{
if(!strcmp(CONF_END_LIST, pcToken))
{
iEnd = 1;
break;
}
if ( !strcasecmp(CONF_DISABLE, pcToken) )
{
_smtp_config.alert_xlink2state = 0;
_smtp_config.ports[XLINK2STATE_DEFAULT_PORT / 8] &= ~(1 << (XLINK2STATE_DEFAULT_PORT % 8));
}
else if ( !strcasecmp(CONF_ENABLE, pcToken) )
{
_smtp_config.alert_xlink2state = 1;
_smtp_config.ports[XLINK2STATE_DEFAULT_PORT / 8] |= 1 << (XLINK2STATE_DEFAULT_PORT % 8);
}
else if ( !strcasecmp(CONF_INLINE_DROP, pcToken) )
{
if (!_smtp_config.alert_xlink2state)
{
snprintf(ErrorString, ErrStrLen,
"Alerting on X-LINK2STATE must be enabled to drop.");
return -1;
}
if (_dpd.inlineMode())
{
_smtp_config.drop_xlink2state = 1;
}
else
{
snprintf(ErrorString, ErrStrLen,
"Cannot use 'drop' keyword in X-LINK2STATE config "
"if Snort is not in inline mode.");
return -1;
}
}
}
if(!iEnd)
{
snprintf(ErrorString, ErrStrLen,
"Must end '%s' configuration with '%s'.",
CONF_XLINK2STATE, CONF_END_LIST);
return -1;
}
return 0;
}