00001 #ifndef _HLBR_DECODE_IP_H_ 00002 #define _HLBR_DECODE_IP_H_ 00003 00004 #include "../config.h" 00005 #include "../engine/hlbr.h" 00006 #include "decode.h" 00007 00008 #define IP_PROTO_ICMP 1 00009 #define IP_PROTO_TCP 6 00010 #define IP_PROTO_UDP 17 00011 00012 typedef struct ip_header{ 00013 #ifdef HLBR_LITTLE_ENDIAN 00014 unsigned char ihl:4, 00015 version:4; 00016 #else 00017 unsigned char version:4, 00018 ihl:4; 00019 #endif 00020 unsigned char tos; 00021 unsigned short tot_len; 00022 unsigned short id; 00023 unsigned short frag_off; 00024 unsigned char ttl; 00025 unsigned char protocol; 00026 unsigned short check; 00027 unsigned int saddr; 00028 unsigned int daddr; 00029 /*The options start here. */ 00030 } IPHdr; 00031 00032 typedef struct ip_data{ 00033 IPHdr* Header; 00034 } IPData; 00035 00036 00037 int InitDecoderIP(); 00038 00039 #endif