#include "decode_ip_defrag.h"
#include "../packets/packet.h"
#include "../engine/cache.h"
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | defrag_item |
Functions | |
unsigned short | checksum (unsigned short *b1, unsigned int len1, unsigned short *b2, unsigned int len2) |
int | RebuildPacket (struct defrag_item *Frags, int NumFrags) |
int | SortFragArray (struct defrag_item *Frags, int NumFrags) |
void * | DecodeIPDefrag (int PacketSlot) |
int | InitDecoderIPDefrag () |
Variables | |
GlobalVars | Globals |
int | IPDecoderID |
Cache * | FragCache |
pthread_mutex_t | FragMutex |
int | FragLockID |
unsigned short checksum | ( | unsigned short * | b1, | |
unsigned int | len1, | |||
unsigned short * | b2, | |||
unsigned int | len2 | |||
) |
void* DecodeIPDefrag | ( | int | PacketSlot | ) |
Definition at line 239 of file decode_ip_defrag.c.
References defrag_item::begin, CacheAdd(), CacheDelKey(), CacheGet(), cache_item::Data, DEBUGPATH, defrag_item::done, defrag_item::end, FALSE, FRAG_FLAG_MORE, FRAG_LOCK_1, FragCache, FragLockID, FragMutex, GetDataByID(), Globals, ip_data::Header, hlbr_mutex_lock(), hlbr_mutex_unlock(), defrag_item::idata, ip_header::ihl, IPDecoderID, cache_items::Items, defrag_item::more, NULL, cache_items::NumItems, global_vars::Packets, defrag_item::PacketSlot, packet_rec::PassRawPacket, RebuildPacket(), ReturnEmptyPacket(), packet_rec::SaveCount, SortFragArray(), TRUE, and packet_rec::tv.
Referenced by InitDecoderIPDefrag().
int InitDecoderIPDefrag | ( | ) |
Definition at line 388 of file decode_ip_defrag.c.
References CreateDecoder(), DEBUGPATH, decoder_rec::DecodeFunc, DecodeIPDefrag(), DECODER_NONE, DecoderAddDecoder(), global_vars::Decoders, FALSE, FRAG_TIMEOUT, FragCache, GetDecoderByName(), Globals, InitCache(), IPDecoderID, and TRUE.
Referenced by InitDecoders().
int RebuildPacket | ( | struct defrag_item * | Frags, | |
int | NumFrags | |||
) |
Definition at line 95 of file decode_ip_defrag.c.
References AddPacketToPending(), ip_header::check, checksum(), FALSE, ip_header::frag_off, GetDataByID(), GetEmptyPacket(), Globals, packet_rec::InterfaceNum, IPDecoderID, packet_rec::LargePacket, MAX_PACKET_SIZE, NULL, packet_rec::PacketLen, global_vars::Packets, defrag_item::PacketSlot, packet_rec::RawPacket, packet_rec::Status, ip_header::tot_len, TRUE, and packet_rec::tv.
Referenced by DecodeIPDefrag().
int SortFragArray | ( | struct defrag_item * | Frags, | |
int | NumFrags | |||
) |
Definition at line 190 of file decode_ip_defrag.c.
References DEBUGPATH, defrag_item::end, FALSE, and TRUE.
Referenced by DecodeIPDefrag().
Definition at line 21 of file decode_ip_defrag.c.
Referenced by DecodeIPDefrag(), and InitDecoderIPDefrag().
int FragLockID |
pthread_mutex_t FragMutex |
int IPDecoderID |
Definition at line 20 of file decode_ip_defrag.c.