Functions | Variables

stream.c File Reference

#include "spp_ai.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <pthread.h>

Functions

PRIVATE void _AI_stream_free (struct pkt_info *stream)
 Remove a stream from the hash table (private function).
void * AI_hashcleanup_thread (void *arg)
 Thread called for cleaning up the hash table from the traffic streams older than a certain threshold.
void AI_pkt_enqueue (SFSnortPacket *pkt)
 Function called for appending a new packet to the hash table, creating a new stream or appending it to an existing stream.
struct pkt_infoAI_get_stream_by_key (struct pkt_key key)
 Get a TCP stream by key.
void AI_set_stream_observed (struct pkt_key key)
 Set the flag "observed" on a stream associated to a security alert, so that it won't be removed from the hash table.

Variables

PRIVATE struct pkt_infohash = NULL
PRIVATE time_t start_time = 0
PRIVATE pthread_mutex_t hash_mutex = PTHREAD_MUTEX_INITIALIZER

Variable Documentation

PRIVATE struct pkt_info* hash = NULL
PRIVATE pthread_mutex_t hash_mutex = PTHREAD_MUTEX_INITIALIZER

pthread mutex for managing the access of multiple readers/writers to the hash table

PRIVATE time_t start_time = 0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines