Ejemplo n.º 1
0
static inline void _Active_DoIgnoreSession(Packet *p)
{
    if ( ScIpsInlineMode() || ScTreatDropAsIgnore() )
    {
        _Active_ForceIgnoreSession(p);
    }
}
Ejemplo n.º 2
0
void PayloadReplaceInit(struct _SnortConfig *sc, char *data, OptTreeNode * otn, int protocol)
{
    static int warned = 0;
    PatternMatchData *idx;

    if( !ScIpsInlineMode() )
        return;

    if ( !DAQ_CanReplace() )
    {
        if ( !warned )
        {
            LogMessage("WARNING: payload replacements disabled because DAQ "
                " can't replace packets.\n");
            warned = 1;
        }
        return;
    }
    if ( lastType ==  PLUGIN_PATTERN_MATCH_URI )
    {
        FatalError("%s(%d) => \"replace\" option is not supported "
                "with uricontent, nor in conjunction with http_uri, "
                "http_header, http_method http_cookie,"
                "http_raw_uri, http_raw_header, or "
                "http_raw_cookie modifiers.\n",
                file_name, file_line);
    }
    idx = (PatternMatchData *) otn->ds_list[PLUGIN_PATTERN_MATCH];

    if(idx == NULL)
    {
        FatalError("%s(%d) => Please place \"content\" rules "
                   "before depth, nocase, replace or offset modifiers.\n",
                   file_name, file_line);
    }

    Replace_Parse(data, otn);

}