Watt-32 tcp/ip  2.2 dev-rel.10
Data Structures | Typedefs | Enumerations | Functions | Variables
ip4_frag.c File Reference

Go to the source code of this file.

Data Structures

struct  huge_ip
 
struct  frag_key
 
struct  frag_bucket
 
struct  hole
 
struct  frag_ctrl
 

Typedefs

typedef fd_set used_map [NUM_FD_SETS]
 

Enumerations

enum  frag_bits {
  IS_FRAG = 0x01,
  IS_LAST = 0x02,
  IS_FIRST = 0x04
}
 

Functions

static void dump_frag_holes (const char *where, const struct frag_ctrl *fc, const struct hole *hole)
 
static const char * decode_fbits (int fb)
 
static BOOL match_frag (const in_Header *ip, int *slot, int *bucket, int *free_bucket)
 
static __inline BOOL check_frag_ofs (const in_Header *ip, DWORD ofs, DWORD end)
 
static __inline void set_fbits (DWORD offset, WORD flags)
 
static BOOL setup_first_frag (const in_Header *ip, int idx)
 
int ip4_defragment (const in_Header **ip_ptr, DWORD offset, WORD flags)
 
int ip4_free_fragment (const in_Header *ip)
 
static void chk_timeout_frags (void)
 
static void free_frag_buckets (void)
 
void ip4_frag_init (void)
 
void test_colors (void)
 
void usage (char *argv0)
 
BYTE * init_frag (int argc, char **argv)
 
int rand_packet (fd_set *fd, int max)
 
int main (int argc, char **argv)
 

Variables

int _ip4_frag_reasm = MAX_IP_HOLDTIME
 
static struct frag_ctrl frag_control [MAX_IP_FRAGS][MAX_FRAGMENTS]
 
static struct frag_bucket frag_buckets [MAX_IP_FRAGS]
 
static long data_start
 
static long data_end
 
static long data_length
 
static enum frag_bits fbits
 
static DWORD to_host = 0
 
static WORD frag_ofs = 0
 
static int max_frags = 5
 
static int frag_size = 1000
 
static int rand_frag = 0
 
static int rev_order = 0
 
static int time_frag = 0
 
struct {
   const char *   col_name
 
   int   col_value
 
colors []
 

Detailed Description

IP4 de-fragmenter.

Definition in file ip4_frag.c.

Function Documentation

BYTE* init_frag ( int  argc,
char **  argv 
)
Todo:
Simulate fragment timeout

Definition at line 831 of file ip4_frag.c.

Variable Documentation

struct { ... } colors[]
Initial value:
= {
"black", 0,
"blue", FOREGROUND_BLUE,
"green", FOREGROUND_GREEN,
"cyan", FOREGROUND_BLUE | FOREGROUND_GREEN,
"red", FOREGROUND_RED,
"magenta", FOREGROUND_BLUE | FOREGROUND_RED,
"brown", FOREGROUND_RED | FOREGROUND_GREEN,
"lightgray", FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED,
"darkgray", FOREGROUND_INTENSITY | 0,
"lightblue", FOREGROUND_INTENSITY | FOREGROUND_BLUE,
"lightgreen", FOREGROUND_INTENSITY | FOREGROUND_GREEN,
"lightcyan", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_GREEN,
"lightred", FOREGROUND_INTENSITY | FOREGROUND_RED,
"lightmagenta", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_RED,
"yellow", FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN,
"white", FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED,
}