本文整理汇总了C++中DynamicPreprocessorData::fatalMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicPreprocessorData::fatalMsg方法的具体用法?C++ DynamicPreprocessorData::fatalMsg怎么用?C++ DynamicPreprocessorData::fatalMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicPreprocessorData
的用法示例。
在下文中一共展示了DynamicPreprocessorData::fatalMsg方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DynamicPreprocessorFatalMessage
NORETURN void DynamicPreprocessorFatalMessage(const char *format, ...)
{
char buf[STD_BUF];
va_list ap;
va_start(ap, format);
vsnprintf(buf, STD_BUF, format, ap);
va_end(ap);
buf[STD_BUF - 1] = '\0';
_dpd.fatalMsg("%s", buf);
exit(1);
}
示例2:
/* Initializes the SSH preprocessor module and registers
* it in the preprocessor list.
*
* PARAMETERS:
*
* argp: Pointer to argument string to process for config
* data.
*
* RETURNS: Nothing.
*/
static void
SSHInit( u_char* argp )
{
if(!_dpd.streamAPI)
{
_dpd.fatalMsg("SetupSSH(): The Stream preprocessor must be enabled.\n");
}
_dpd.addPreproc( ProcessSSH, PRIORITY_APPLICATION, PP_SSH );
ParseSSHArgs( argp );
#ifdef PERF_PROFILING
_dpd.addPreprocProfileFunc("ssh", (void *)&sshPerfStats, 0, _dpd.totalPerfStats);
#endif
}
示例3: LoadConfig
int LoadConfig( const u_char* conf, SSLConfig* cfg )
{
ParseContext ctx;
u_char* conf_copy = NULL;
ConfigToken TopLevelTokens[] = { Token_Server, Token_EOF };
ConfigToken token = Token_Unknown;
error_buffer[0] = 0;
conf_copy = (u_char*) malloc( strlen( conf ) + 1 );
strcpy( conf_copy, conf );
memset( &ctx, 0, sizeof(ctx) );
ctx.input = conf_copy;
ctx.config = cfg;
do
{
token = ParseOneOf( &ctx, TopLevelTokens, ARRAY_SIZE( TopLevelTokens ) );
if( token == Token_Server )
{
if( ParseServer( &ctx ) == CONFIG_PARSE_ERROR ) token = CONFIG_PARSE_ERROR;
}
} while ( token == Token_Server );
free( conf_copy ); conf_copy = ctx.input = NULL;
/* make sure we have at least one server set up */
if( token != CONFIG_PARSE_ERROR && ctx.config->server_cnt == 0 )
{
sprintf( error_buffer, "%s: at least one SSL server's configuration is expected", ERROR_PREFIX );
token = CONFIG_PARSE_ERROR;
}
if( token == CONFIG_PARSE_ERROR )
{
if( strlen( error_buffer ) )
{
_dpd.fatalMsg( "%s(%d) => %s", *(_dpd.config_file), *(_dpd.config_line), error_buffer );
}
return CONFIG_PARSE_ERROR;
}
PrintSSLConfig( ctx.config );
return 0;
}
示例4: if
/* Parses and processes the configuration arguments
* supplied in the SSH preprocessor rule.
*
* PARAMETERS:
*
* argp: Pointer to string containing the config arguments.
*
* RETURNS: Nothing.
*/
static void
ParseSSHArgs( u_char* argp )
{
char* cur_tokenp = NULL;
char* argcpyp = NULL;
int port;
/* Set up default port to listen on */
ssh_config.ports[ PORT_INDEX( 22 ) ] |= CONV_PORT(22);
/* Sanity check(s) */
if ( !argp )
{
DisplaySSHConfig();
return;
}
argcpyp = strdup( (char*) argp );
if ( !argcpyp )
{
_dpd.fatalMsg("Could not allocate memory to parse SSH options.\n");
return;
}
cur_tokenp = strtok( argcpyp, " ");
while ( cur_tokenp )
{
if ( !strcmp( cur_tokenp, SSH_SERVERPORTS_KEYWORD ))
{
/* If the user specified ports, remove '22' for now since
* it now needs to be set explicitely. */
ssh_config.ports[ PORT_INDEX( 22 ) ] = 0;
/* Eat the open brace. */
cur_tokenp = strtok( NULL, " ");
if (( !cur_tokenp ) || ( cur_tokenp[0] != '{' ))
{
_dpd.fatalMsg("Bad value specified for %s.\n",
SSH_SERVERPORTS_KEYWORD);
free(argcpyp);
return;
}
cur_tokenp = strtok( NULL, " ");
while (( cur_tokenp ) && ( cur_tokenp[0] != '}' ))
{
if ( !isdigit( cur_tokenp[0] ))
{
_dpd.fatalMsg("Bad port %s.\n", cur_tokenp );
free(argcpyp);
return;
}
else
{
port = atoi( cur_tokenp );
if( port < 0 || port > MAX_PORTS )
{
_dpd.fatalMsg("Port value illegitimate: %s\n", cur_tokenp);
free(argcpyp);
return;
}
ssh_config.ports[ PORT_INDEX( port ) ] |= CONV_PORT(port);
}
cur_tokenp = strtok( NULL, " ");
}
}
else if ( !strcmp( cur_tokenp, SSH_AUTODETECT_KEYWORD ))
{
ssh_config.AutodetectEnabled++;
}
else if ( !strcmp( cur_tokenp, SSH_MAX_ENC_PKTS_KEYWORD ))
{
cur_tokenp = strtok( NULL, " ");
if (( !cur_tokenp ) || !isdigit(cur_tokenp[0]) )
{
_dpd.logMsg("Bad value specified for %s."
"Reverting to default value %d. ",
SSH_MAX_ENC_PKTS_KEYWORD,
SSH_DEFAULT_MAX_ENC_PKTS );
}
else
{
ssh_config.MaxEncryptedPackets = (u_int16_t)
atoi( cur_tokenp );
}
}
//.........这里部分代码省略.........