Exemple #1
0
RuleTreeNode* GenerateSnortEventRtn (OptTreeNode* otn, tSfPolicyId policyId)
{
    RuleTreeNode *rtn = getRtnFromOtn(otn, policyId);
    if (!rtn)
    {
        rtn = calloc(1, sizeof(RuleTreeNode));
        if (rtn)
        {
            rtn->type = RULE_TYPE__ALERT;
            if (addRtnToOtn(otn, policyId, rtn) != 0)
                rtn = NULL;
        }
    }

    return rtn;
}
Exemple #2
0
RuleTreeNode* GenerateSnortEventRtn (
    OptTreeNode* otn,
    tSfPolicyId policyId
) {
    RuleTreeNode* rtn = getRtnFromOtn(otn, policyId);

    rtn = calloc(1, sizeof(RuleTreeNode));

    if ( !rtn )
        return NULL;

    rtn->type = RULE_TYPE__ALERT;

    if ( addRtnToOtn(otn, policyId, rtn) != 0 )
    {
        //unsuccessful adding rtn
        free(rtn);
        return NULL;
    }
    return rtn;
}