RING3代码/WinPcapSniffer/tcpip.h
#pragma once
typedef struct ip_address
{
	u_char byte1;
	u_char byte2;
	u_char byte3;
	u_char byte4;
}ip_address;


typedef struct ip_header
{
	u_char 		ver_ihl;  			//4λײ,4λIP汾 
	u_char 		tos;	  				//8λTOS 
	u_short 	     tlen;	  			//16λܳȣֽڣ 
	u_short 	     identification; 		//16λʶ 
	u_short 	     flags_fo;			//3λ־λ,13λƫ
	u_char 		ttl;	 				//8λʱ TTL 
	u_char        proto;				//8λЭ (TCP, UDP ) 
	u_short 	     crc;	   				//16λIPײУ 
	ip_address 	saddr;				//32λԴIPַ 
	ip_address 	daddr; 				//32λĿIPַ
	u_int 		op_pad;	 			//32λѡ
}ip_header;


typedef struct tcp_header 
{
	u_short			sport;		//16λԴ˿ 
	u_short			dport;		//16λĿĶ˿ 
	u_int			seq;			//32λк 
	u_int			ack;			//32λȷϺ 
	u_char			lenres;		//4λײ/6λ 
	u_char			flag;		//6λ־λ 
	u_short			win;			//16λڴС 
	u_short		     sum;			//16λУ 
	u_short			urp;			//16λƫ
	u_int 			op_pad;	 	//32λѡ
}tcp_header;


typedef struct udp_header
{
	u_short sport;   	//16λԴ˿
	u_short dport;   	//16λĿĶ˿
	u_short len;		//16λ 
	u_short crc;		//16λУ
}udp_header;
