Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

snort_stream4_session.c File Reference

#include "sfxhash.h"
#include "ubi_SplayTree.h"
#include "decode.h"
#include "debug.h"
#include "stream.h"
#include "log.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

Go to the source code of this file.

Functions

void DeleteSession (Session *, u_int32_t)
int GetSessionCount ()
int GetSessionKey (Packet *p, SessionHashKey *key)
SessionGetSessionFromHashTable (Packet *p)
int RemoveSessionFromHashTable (Session *ssn)
int CleanHashTable (u_int32_t thetime, Session *save_me, int memCheck)
SessionGetNewSession (Packet *p)
SessionGetSessionFromSplayTree (Packet *p)
SessionRemoveSession (Session *ssn)
SessionGetSession (Packet *p)
void InitSessionCache ()
void PurgeSessionCache ()
void PrintSessionCache ()
int PruneSessionCache (u_int32_t thetime, int mustdie, Session *save_me)

Variables

static ubi_trRoot s_cache
static ubi_trRootPtr RootPtr = &s_cache
Stream4Data s4data
u_int32_t stream4_memory_usage
static SFXHASHsessionHashTable = NULL


Function Documentation

int CleanHashTable u_int32_t  thetime,
Session save_me,
int  memCheck
 

Definition at line 153 of file snort_stream4_session.c.

References _Stream4Data::cache_clean_percent, _Stream4Data::cache_clean_sessions, _sfxhash::count, _sfxhash_node::data, DEBUG_STREAM, DEBUG_WRAP, DeleteSession(), _Session::last_session_time, _Stream4Data::max_sessions, _Stream4Data::memcap, NULL, sfxhash_count(), sfxhash_gmovetofront(), sfxhash_lru(), sfxhash_lru_node(), stream4_memory_usage, and _Stream4Data::timeout.

Referenced by GetNewSession(), and PruneSessionCache().

void DeleteSession Session ,
u_int32_t 
 

Definition at line 4367 of file spp_stream4.c.

References _Stream::bytes_sent, _BinStats::cbytes, _BinStats::cip, _Session::client, _BinStats::cpackets, _BinStats::cport, DropSession(), _BinStats::end_time, _Stream::ip, _Session::last_session_time, NULL, _Stream::pkts_sent, _Stream::port, RemoveSession(), RemoveStreamSession(), RootPtr, _BinStats::sbytes, _Session::server, session_log, _SFPERF::sfBase, sfPerf, _BinStats::sip, _BinStats::spackets, _BinStats::sport, _BinStats::start_time, _Session::start_time, STATS_BINARY, STATS_HUMAN_READABLE, STATS_MACHINE_READABLE, thiszone, _Stream4Data::track_stats_flag, ubi_sptRemove(), ubi_trCount, and WriteSsnStats().

Referenced by AlertFlushStream(), CleanHashTable(), PruneSessionCache(), PurgeSessionCache(), TcpAction(), and TcpActionAsync().

Session* GetNewSession Packet p  ) 
 

Definition at line 285 of file snort_stream4_session.c.

References _Session::alert_count, CleanHashTable(), _sfxhash_node::data, DEBUG_STREAM, DEBUG_WRAP, GetSessionKey(), _Session::hashKey, _Session::http_alert_flags, memcpy, memset, NULL, _Packet::pkth, _Session::preproc_data, _Session::preproc_free, _Session::preproc_proto, sfxhash_get_node(), pcap_pkthdr::ts, and _Session::ttl.

Referenced by CreateNewSession(), and parse_one_v1().

Session* GetSession Packet p  ) 
 

Definition at line 402 of file snort_stream4_session.c.

References GetSessionFromHashTable(), and GetSessionFromSplayTree().

Referenced by ReassembleStream4().

int GetSessionCount  ) 
 

Definition at line 68 of file snort_stream4_session.c.

References _sfxhash::count.

Referenced by PruneCheck().

Session* GetSessionFromHashTable Packet p  ) 
 

Definition at line 121 of file snort_stream4_session.c.

References _sfxhash_node::data, GetSessionKey(), NULL, and sfxhash_find_node().

Referenced by GetSession().

Session* GetSessionFromSplayTree Packet p  ) 
 

Definition at line 336 of file snort_stream4_session.c.

References _Session::client, CreateTCPFlagString(), DEBUG_STREAM, DEBUG_WRAP, _Packet::dp, _Stream::ip, _IPHdr::ip_dst, _IPHdr::ip_src, _Packet::iph, NULL, _Stream::port, RootPtr, _Session::server, _Packet::sp, and ubi_sptFind().

Referenced by GetSession().

int GetSessionKey Packet p,
SessionHashKey key
 

Definition at line 76 of file snort_stream4_session.c.

References _SessionHashKey::highIP, _SessionHashKey::lowIP, _SessionHashKey::port, and _SessionHashKey::port2.

Referenced by GetNewSession(), and GetSessionFromHashTable().

void InitSessionCache  ) 
 

Definition at line 437 of file snort_stream4_session.c.

References int(), _Stream4Data::max_sessions, NULL, RootPtr, sfxhash_new(), and ubi_trInitTree.

Referenced by Stream4Init().

void PrintSessionCache  ) 
 

Definition at line 496 of file snort_stream4_session.c.

References DEBUG_STREAM, DEBUG_WRAP, RootPtr, sfxhash_count(), stream4_memory_usage, and ubi_trCount.

Referenced by ReassembleStream4().

int PruneSessionCache u_int32_t  thetime,
int  mustdie,
Session save_me
 

Definition at line 508 of file snort_stream4_session.c.

References _Stream4Data::cache_clean_percent, _Stream4Data::cache_clean_sessions, CleanHashTable(), DEBUG_STREAM, DEBUG_WRAP, DeleteSession(), _Session::last_session_time, _Stream4Data::memcap, NULL, RootPtr, Rotate(), stream4_memory_usage, _Stream4Data::timeout, ubi_btLast(), ubi_btLeafNode(), ubi_btPrev(), and ubi_trCount.

Referenced by PruneCheck(), and SafeAlloc().

void PurgeSessionCache  ) 
 

Definition at line 477 of file snort_stream4_session.c.

References DeleteSession(), NULL, RootPtr, sfxhash_mru(), and ubi_trFirst.

Referenced by Stream4ShutdownFunction().

Session* RemoveSession Session ssn  ) 
 

Definition at line 385 of file snort_stream4_session.c.

References NULL, RemoveSessionFromHashTable(), RootPtr, ubi_sptRemove(), and ubi_trCount.

Referenced by DeleteSession().

int RemoveSessionFromHashTable Session ssn  ) 
 

Definition at line 148 of file snort_stream4_session.c.

References _Session::hashKey, and sfxhash_remove().

Referenced by RemoveSession().


Variable Documentation

ubi_trRootPtr RootPtr = &s_cache [static]
 

Definition at line 46 of file snort_stream4_session.c.

Referenced by CreateNewSession(), DeleteSession(), FlushDeletedStream(), GetSessionFromSplayTree(), InitSessionCache(), PrintSessionCache(), PruneSessionCache(), PurgeSessionCache(), RemoveSession(), and Stream4Init().

Stream4Data s4data
 

Definition at line 377 of file spp_stream4.c.

ubi_trRoot s_cache [static]
 

Definition at line 45 of file snort_stream4_session.c.

SFXHASH* sessionHashTable = NULL [static]
 

Definition at line 58 of file snort_stream4_session.c.

u_int32_t stream4_memory_usage
 

Definition at line 378 of file spp_stream4.c.

Referenced by CleanHashTable(), CreateNewSession(), DropSession(), KillSpd(), PrintSessionCache(), PruneCheck(), PruneSessionCache(), SafeAlloc(), SegmentCleanTraverse(), StoreStreamPkt(), StreamSegmentAdd(), and StreamSegmentSub().


Generated on Sun May 14 14:51:25 2006 by  doxygen 1.4.2