void IpSessionCleanup (void* ssn) { SessionControlBlock *scb = ( SessionControlBlock * ) ssn; if (scb->ha_state.session_flags & SSNFLAG_PRUNED) { CloseStreamSession(&sfBase, SESSION_CLOSED_PRUNED); } else if (scb->ha_state.session_flags & SSNFLAG_TIMEDOUT) { CloseStreamSession(&sfBase, SESSION_CLOSED_TIMEDOUT); } else { CloseStreamSession(&sfBase, SESSION_CLOSED_NORMALLY); } StreamResetFlowBits(scb); session_api->free_application_data(scb); scb->ha_state.session_flags = SSNFLAG_NONE; scb->session_state = STREAM_STATE_NONE; scb->expire_time = 0; scb->ha_state.ignore_direction = 0; }
void IcmpSessionCleanup(SessionControlBlock *ssn) { IcmpSession *icmpssn = NULL; if (ssn->ha_state.session_flags & SSNFLAG_PRUNED) { CloseStreamSession(&sfBase, SESSION_CLOSED_PRUNED); } else if (ssn->ha_state.session_flags & SSNFLAG_TIMEDOUT) { CloseStreamSession(&sfBase, SESSION_CLOSED_TIMEDOUT); } else { CloseStreamSession(&sfBase, SESSION_CLOSED_NORMALLY); } if (ssn->proto_specific_data) icmpssn = ssn->proto_specific_data->data; if (!icmpssn) { /* Huh? */ return; } /* Cleanup the proto specific data */ session_api->free_protocol_session_pool( SESSION_PROTO_ICMP, ssn ); ssn->proto_specific_data = NULL; StreamResetFlowBits(ssn); session_api->free_application_data(ssn); s5stats.icmp_sessions_released++; }
void UdpSessionCleanup(void *ssn) { SessionControlBlock *scb = ( SessionControlBlock * ) ssn; UdpSession *udpssn = NULL; if (scb->ha_state.session_flags & SSNFLAG_PRUNED) { CloseStreamSession(&sfBase, SESSION_CLOSED_PRUNED); } else if (scb->ha_state.session_flags & SSNFLAG_TIMEDOUT) { CloseStreamSession(&sfBase, SESSION_CLOSED_TIMEDOUT); } else { CloseStreamSession(&sfBase, SESSION_CLOSED_NORMALLY); } if (scb->proto_specific_data) udpssn = (UdpSession *)scb->proto_specific_data->data; if (!udpssn) { /* Huh? */ return; } /* Cleanup the proto specific data */ session_api->free_protocol_session_pool( SESSION_PROTO_UDP, scb ); scb->proto_specific_data = NULL; scb->session_state = STREAM_STATE_NONE; scb->ha_state.session_flags = SSNFLAG_NONE; scb->expire_time = 0; scb->ha_state.ignore_direction = 0; StreamResetFlowBits(scb); session_api->free_application_data(scb); s5stats.udp_sessions_released++; RemoveUDPSession(&sfBase); }