1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
/* Sniffit Packet Discription File */
#ifndef _SN_PACKETSTRUCTS_H_
#define _SN_PACKETSTRUCTS_H_
#include <sys/time.h>
struct packetheader
{
struct timeval ts; /* time stamp */
unsigned long caplen; /* length of portion present */
unsigned long len; /* length this packet (off wire) */
};
struct IP_header /* The IPheader (without options) */
{
unsigned char verlen, type;
unsigned short length, ID, flag_offset;
unsigned char TTL, protocol;
unsigned short checksum;
_32_bit source, destination;
};
struct pseudo_IP_header
{
_32_bit source, destination;
char zero_byte, protocol;
unsigned short TCP_UDP_len;
};
struct TCP_header /* The TCP header (without options) */
{
unsigned short source, destination;
_32_bit seq_nr, ACK_nr;
unsigned short offset_flag, window, checksum, urgent;
};
struct ICMP_header /* The ICMP header */
{
unsigned char type, code;
unsigned short checksum;
};
struct UDP_header /* The UDP header */
{
unsigned short source, destination;
unsigned short length, checksum;
};
struct unwrap /* some extra info */
{
int IP_len, TCP_len, ICMP_len, UDP_len; /* header lengths */
int DATA_len; /* keep signed! */
char FRAG_f; /* first fragment */
char FRAG_nf; /* not the first fragment */
};
#endif
|