int Stream5Expire(Packet *p, Stream5LWSession *lwssn)
{
    uint64_t pkttime = CalcJiffies(p);

    if (lwssn->expire_time == 0)
    {
        /* Not yet set, not expired */
        return 0;
    }

    if((int)(pkttime - lwssn->expire_time) > 0)
    {
        /* Expiration time has passed. */
        return Stream5ExpireSession(lwssn);
    }

    return 0;
}
Exemple #2
0
int Stream5Expire(Packet *p, Stream5LWSession *lwssn)
{
    uint64_t pkttime = CalcJiffies(p);

    if (lwssn->expire_time == 0)
    {
        /* Not yet set, not expired */
        return 0;
    }

    if((int)(pkttime - lwssn->expire_time) > 0)
    {
        sfBase.iStreamTimeouts++;
        lwssn->session_flags |= SSNFLAG_TIMEDOUT;
        lwssn->session_state |= STREAM5_STATE_TIMEDOUT;

        switch (lwssn->protocol)
        {
        case IPPROTO_TCP:
            s5stats.tcp_timeouts++;
            //DeleteLWSession(tcp_lws_cache, lwssn);
            break;
        case IPPROTO_UDP:
            s5stats.udp_timeouts++;
            //DeleteLWSession(udp_lws_cache, lwssn);
            break;
        case IPPROTO_ICMP:
            s5stats.icmp_timeouts++;
            //DeleteLWSession(icmp_lws_cache, lwssn);
            break;
        }
        return 1;
    }

    return 0;
}
Exemple #3
0
int Stream5GetExpire(Packet *p, Stream5LWSession *lwssn)
{
    return ( CalcJiffies(p) > lwssn->expire_time );
}
Exemple #4
0
void Stream5SetExpire(Packet *p,
                      Stream5LWSession *lwssn, uint32_t timeout)
{
    lwssn->expire_time = CalcJiffies(p) + (timeout * TCP_HZ);
    return;
}