Exemplo n.º 1
0
static inline int _Active_DoReset(Packet *p)
{
#ifdef ACTIVE_RESPONSE
    if ( !Active_IsEnabled() )
        return 0;

    if ( Active_PacketWouldBeDropped() )
        return 0;

    if ( !IPH_IS_VALID(p) )
        return 0;

    switch ( GET_IPH_PROTO(p) )
    {
        case IPPROTO_TCP:
            if ( Active_IsRSTCandidate(p) )
                Active_QueueReject();
            break;

        // FIXTHIS send unr to udp/icmp4/icmp6 only or for all non-tcp?
        case IPPROTO_UDP:
        case IPPROTO_ICMP:
        case IPPROTO_ICMPV6:
            if ( Active_IsUNRCandidate(p) )
                Active_QueueReject();
            break;
    }
#endif

    return 0;
}
Exemplo n.º 2
0
int Active_DropAction (Packet* p)
{
    Active_IgnoreSession(p);

#ifdef ACTIVE_RESPONSE
    if ( !Active_IsEnabled() )
        return 0;

    switch ( GET_IPH_PROTO(p) )
    {
        case IPPROTO_TCP:
            if ( Active_IsRSTCandidate(p) )
                Active_QueueReject();
            break;

        case IPPROTO_UDP:
            if ( Active_IsUNRCandidate(p) )
                Active_QueueReject();
            break;
    }
#endif

    return 0;
}