snort_stream_ip.c (snort-2.9.16.1) | : | snort_stream_ip.c (snort-2.9.17) | ||
---|---|---|---|---|
skipping to change at line 156 | skipping to change at line 156 | |||
} | } | |||
StreamResetFlowBits(scb); | StreamResetFlowBits(scb); | |||
session_api->free_application_data(scb); | session_api->free_application_data(scb); | |||
scb->ha_state.session_flags = SSNFLAG_NONE; | scb->ha_state.session_flags = SSNFLAG_NONE; | |||
scb->session_state = STREAM_STATE_NONE; | scb->session_state = STREAM_STATE_NONE; | |||
scb->expire_time = 0; | scb->expire_time = 0; | |||
scb->ha_state.ignore_direction = 0; | scb->ha_state.ignore_direction = 0; | |||
s5stats.active_ip_sessions--; | ||||
} | } | |||
#ifdef ENABLE_HA | #ifdef ENABLE_HA | |||
//------------------------------------------------------------------------- | //------------------------------------------------------------------------- | |||
// ip ha stuff | // ip ha stuff | |||
//------------------------------------------------------------------------- | //------------------------------------------------------------------------- | |||
SessionControlBlock *GetLWIpSession (const SessionKey *key) | SessionControlBlock *GetLWIpSession (const SessionKey *key) | |||
{ | { | |||
return session_api->get_session_by_key(ip_lws_cache, key); | return session_api->get_session_by_key(ip_lws_cache, key); | |||
} | } | |||
static SessionControlBlock *StreamIPCreateSession (const SessionKey *key) | static SessionControlBlock *StreamIPCreateSession (const SessionKey *key) | |||
{ | { | |||
setNapRuntimePolicy(getDefaultPolicy()); | setNapRuntimePolicy(getDefaultPolicy()); | |||
return session_api->create_session(ip_lws_cache, NULL, key); | SessionControlBlock *scb = session_api->create_session(ip_lws_cache, NULL, k | |||
ey); | ||||
if (scb) | ||||
s5stats.active_ip_sessions++; | ||||
return scb; | ||||
} | } | |||
static int StreamIPDeleteSession (const SessionKey *key) | static int StreamIPDeleteSession (const SessionKey *key) | |||
{ | { | |||
SessionControlBlock *scb = session_api->get_session_by_key(ip_lws_cache, key ); | SessionControlBlock *scb = session_api->get_session_by_key(ip_lws_cache, key ); | |||
if( scb != NULL ) | if( scb != NULL ) | |||
{ | { | |||
if( StreamSetRuntimeConfiguration(scb, scb->protocol) == 0 ) | if( StreamSetRuntimeConfiguration(scb, scb->protocol) == 0 ) | |||
{ | ||||
session_api->delete_session(ip_lws_cache, scb, "ha sync", false); | session_api->delete_session(ip_lws_cache, scb, "ha sync", false); | |||
s5stats.active_ip_sessions--; | ||||
} | ||||
else | else | |||
WarningMessage(" WARNING: Attempt to delete an IP Session when no va lid runtime configuration\n" ); | WarningMessage(" WARNING: Attempt to delete an IP Session when no va lid runtime configuration\n" ); | |||
} | } | |||
return 0; | return 0; | |||
} | } | |||
static HA_Api ha_ip_api = { | static HA_Api ha_ip_api = { | |||
/*.get_lws = */ GetLWIpSession, | /*.get_lws = */ GetLWIpSession, | |||
skipping to change at line 293 | skipping to change at line 301 | |||
//------------------------------------------------------------------------- | //------------------------------------------------------------------------- | |||
// private packet processing methods | // private packet processing methods | |||
//------------------------------------------------------------------------- | //------------------------------------------------------------------------- | |||
static inline void InitSession (Packet* p, SessionControlBlock *scb) | static inline void InitSession (Packet* p, SessionControlBlock *scb) | |||
{ | { | |||
DEBUG_WRAP(DebugMessage(DEBUG_STREAM, | DEBUG_WRAP(DebugMessage(DEBUG_STREAM, | |||
"Stream IP session initialized!\n");); | "Stream IP session initialized!\n");); | |||
s5stats.total_ip_sessions++; | s5stats.total_ip_sessions++; | |||
s5stats.active_ip_sessions++; | ||||
IP_COPY_VALUE(scb->client_ip, GET_SRC_IP(p)); | IP_COPY_VALUE(scb->client_ip, GET_SRC_IP(p)); | |||
IP_COPY_VALUE(scb->server_ip, GET_DST_IP(p)); | IP_COPY_VALUE(scb->server_ip, GET_DST_IP(p)); | |||
} | } | |||
static inline int BlockedSession (Packet* p, SessionControlBlock *scb) | static inline int BlockedSession (Packet* p, SessionControlBlock *scb) | |||
{ | { | |||
if ( !(scb->ha_state.session_flags & (SSNFLAG_DROP_CLIENT|SSNFLAG_DROP_SERVE R)) ) | if ( !(scb->ha_state.session_flags & (SSNFLAG_DROP_CLIENT|SSNFLAG_DROP_SERVE R)) ) | |||
return 0; | return 0; | |||
if ( | if ( | |||
skipping to change at line 515 | skipping to change at line 524 | |||
unsigned SessionIPReloadAdjust(unsigned maxWork) | unsigned SessionIPReloadAdjust(unsigned maxWork) | |||
{ | { | |||
return SessionProtocolReloadAdjust(ip_lws_cache, session_configuration->max_ ip_sessions, | return SessionProtocolReloadAdjust(ip_lws_cache, session_configuration->max_ ip_sessions, | |||
maxWork, 0 | maxWork, 0 | |||
#ifdef REG_TEST | #ifdef REG_TEST | |||
, "IP" | , "IP" | |||
#endif | #endif | |||
); | ); | |||
} | } | |||
#endif | #endif | |||
size_t get_ip_used_mempool() | ||||
{ | ||||
if (ip_lws_cache && ip_lws_cache->protocol_session_pool) | ||||
return ip_lws_cache->protocol_session_pool->used_memory; | ||||
return 0; | ||||
} | ||||
End of changes. 6 change blocks. | ||||
1 lines changed or deleted | 11 lines changed or added |