示例#1
0
int Sagan_Bluedot_IP_Lookup_All ( char *syslog_message, int rule_position )
{

    int i;
    char results[64];

    unsigned char bluedot_results;
    sbool bluedot_flag;

    for ( i = 1; i < MAX_PARSE_IP; i++ )
        {


            strlcpy(results, Sagan_Parse_IP(syslog_message, i), sizeof(results));

            /* Failed to find next IP,  short circuit the process */

            if ( results[0] == '0' )
                {
                    return(false);
                }

            bluedot_results = Sagan_Bluedot_Lookup(results, BLUEDOT_LOOKUP_IP);
            bluedot_flag = Sagan_Bluedot_Cat_Compare( bluedot_results, rule_position, BLUEDOT_LOOKUP_IP );

            if ( bluedot_flag == 1 )
                {
                    return(true);
                }

        }

    return(false);
}
示例#2
0
sbool Sagan_BroIntel_IPADDR_All ( char *syslog_message )
{

    int i;
    int b;

    uint32_t ip;

    char *results = NULL;


    for (i = 1; i < MAX_PARSE_IP; i++)
        {

            results = Sagan_Parse_IP(syslog_message, i);

            /* Failed to find next IP,  short circuit the process */

            if (!strcmp(results, "0"))
                {
                    return(false);
                }

            ip = IP2Bit(results);

            for ( b = 0; b < counters->brointel_addr_count; b++ )
                {

                    if ( Sagan_BroIntel_Intel_Addr[b].u32_ip == ip )
                        {
                            return(true);
                        }
                }

        }

    return(false);
}