本文整理汇总了C++中DynamicPreprocessorData::printfappend方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicPreprocessorData::printfappend方法的具体用法?C++ DynamicPreprocessorData::printfappend怎么用?C++ DynamicPreprocessorData::printfappend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicPreprocessorData
的用法示例。
在下文中一共展示了DynamicPreprocessorData::printfappend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintConfig
static void PrintConfig(void)
{
int i;
const SMTPToken *cmd;
char buf[8192];
memset(&buf[0], 0, sizeof(buf));
_dpd.logMsg("\nSMTP Config:\n");
snprintf(buf, sizeof(buf) - 1, " Ports: ");
for (i = 0; i < 65536; i++)
{
if (_smtp_config.ports[i / 8] & (1 << (i % 8)))
{
_dpd.printfappend(buf, sizeof(buf) - 1, "%d ", i);
}
}
_dpd.logMsg("%s\n", buf);
_dpd.logMsg(" Inspection Type: %s\n",
_smtp_config.inspection_type ? "Stateful" : "Stateless");
snprintf(buf, sizeof(buf) - 1, " Normalize: ");
switch (_smtp_config.normalize)
{
case NORMALIZE_ALL:
_dpd.printfappend(buf, sizeof(buf) - 1, "all");
break;
case NORMALIZE_NONE:
_dpd.printfappend(buf, sizeof(buf) - 1, "none");
break;
case NORMALIZE_CMDS:
if (_smtp_config.print_cmds)
{
for (cmd = _smtp_cmds; cmd->name != NULL; cmd++)
{
if (_smtp_cmd_config[cmd->search_id].normalize)
{
_dpd.printfappend(buf, sizeof(buf) - 1, "%s ", cmd->name);
}
}
}
else
{
_dpd.printfappend(buf, sizeof(buf) - 1, "cmds");
}
break;
}
_dpd.logMsg("%s\n", buf);
_dpd.logMsg(" Ignore Data: %s\n",
_smtp_config.ignore_data ? "Yes" : "No");
_dpd.logMsg(" Ignore TLS Data: %s\n",
_smtp_config.ignore_tls_data ? "Yes" : "No");
_dpd.logMsg(" Ignore SMTP Alerts: %s\n",
_smtp_config.no_alerts ? "Yes" : "No");
if (!_smtp_config.no_alerts)
{
snprintf(buf, sizeof(buf) - 1, " Max Command Line Length: ");
if (_smtp_config.max_command_line_len == 0)
_dpd.printfappend(buf, sizeof(buf) - 1, "Unlimited");
else
_dpd.printfappend(buf, sizeof(buf) - 1, "%d", _smtp_config.max_command_line_len);
_dpd.logMsg("%s\n", buf);
if (_smtp_config.print_cmds)
{
int max_line_len_count = 0;
int max_line_len = 0;
snprintf(buf, sizeof(buf) - 1, " Max Specific Command Line Length: ");
for (cmd = _smtp_cmds; cmd->name != NULL; cmd++)
{
max_line_len = _smtp_cmd_config[cmd->search_id].max_line_len;
if (max_line_len != 0)
{
if (max_line_len_count % 5 == 0)
{
_dpd.logMsg("%s\n", buf);
snprintf(buf, sizeof(buf) - 1, " %s:%d ", cmd->name, max_line_len);
}
else
{
_dpd.printfappend(buf, sizeof(buf) - 1, "%s:%d ", cmd->name, max_line_len);
}
max_line_len_count++;
}
//.........这里部分代码省略.........