当前位置: 首页>>代码示例>>C++>>正文


C++ DynamicPreprocessorData::addPreprocProfileFunc方法代码示例

本文整理汇总了C++中DynamicPreprocessorData::addPreprocProfileFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicPreprocessorData::addPreprocProfileFunc方法的具体用法?C++ DynamicPreprocessorData::addPreprocProfileFunc怎么用?C++ DynamicPreprocessorData::addPreprocProfileFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DynamicPreprocessorData的用法示例。


在下文中一共展示了DynamicPreprocessorData::addPreprocProfileFunc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DNSInit

/* Initializes the DNS preprocessor module and registers
 * it in the preprocessor list.
 * 
 * PARAMETERS:  
 *
 * argp:        Pointer to argument string to process for config
 *                      data.
 *
 * RETURNS:     Nothing. 
 */
static void DNSInit( u_char* argp )
{
    _dpd.addPreproc( ProcessDNS, PRIORITY_APPLICATION, PP_DNS );
    _dpd.addPreprocConfCheck( DNSConfigCheck );
    
    ParseDNSArgs( argp );
    
#ifdef PERF_PROFILING
    _dpd.addPreprocProfileFunc("dns", (void *)&dnsPerfStats, 0, _dpd.totalPerfStats);
#endif
}
开发者ID:OPSF,项目名称:uClinux,代码行数:21,代码来源:spp_dns.c

示例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
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例3: SSHInit

/* 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(char *argp)
{
    tSfPolicyId policy_id = _dpd.getParserPolicy();
    SSHConfig *pPolicyConfig = NULL;

    if (ssh_config == NULL)
    {
        //create a context
        ssh_config = sfPolicyConfigCreate();
        if (ssh_config == NULL)
        {
            DynamicPreprocessorFatalMessage("Failed to allocate memory "
                                            "for SSH config.\n");
        }

        if (_dpd.streamAPI == NULL)
        {
            DynamicPreprocessorFatalMessage("SetupSSH(): The Stream preprocessor must be enabled.\n");
        }

        _dpd.addPreprocConfCheck(SSHCheckConfig);
        _dpd.addPreprocExit(SSHCleanExit, NULL, PRIORITY_LAST, PP_SSH);

#ifdef PERF_PROFILING
        _dpd.addPreprocProfileFunc("ssh", (void *)&sshPerfStats, 0, _dpd.totalPerfStats);
#endif

#ifdef TARGET_BASED
        ssh_app_id = _dpd.findProtocolReference("ssh");
        if (ssh_app_id == SFTARGET_UNKNOWN_PROTOCOL)
            ssh_app_id = _dpd.addProtocolReference("ssh");

#endif
    }

    sfPolicyUserPolicySet (ssh_config, policy_id);
    pPolicyConfig = (SSHConfig *)sfPolicyUserDataGetCurrent(ssh_config);
    if (pPolicyConfig != NULL)
    {
        DynamicPreprocessorFatalMessage("SSH preprocessor can only be "
                                        "configured once.\n");
    }

    pPolicyConfig = (SSHConfig *)calloc(1, sizeof(SSHConfig));
    if (!pPolicyConfig)
    {
        DynamicPreprocessorFatalMessage("Could not allocate memory for "
                                        "SSH preprocessor configuration.\n");
    }
 
    sfPolicyUserDataSetCurrent(ssh_config, pPolicyConfig);

	ParseSSHArgs(pPolicyConfig, (u_char *)argp);

    _dpd.addPreproc( ProcessSSH, PRIORITY_APPLICATION, PP_SSH, PROTO_BIT__TCP );

    _addPortsToStream5Filter(pPolicyConfig, policy_id);

#ifdef TARGET_BASED
    _addServicesToStream5Filter(policy_id);
#endif
}
开发者ID:WiseMan787,项目名称:ralink_sdk,代码行数:72,代码来源:spp_ssh.c


注:本文中的DynamicPreprocessorData::addPreprocProfileFunc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。