typedef struct ether_header
{
	unsigned char   eh_dst[6]; //Ŀĵַ
	unsigned char   eh_src[6]; //Դַ
	unsigned short  eh_type; //eh_typeֵҪһЭ飬ΪipΪ0x0800
}ether_header;

typedef struct ip_hdr
{
	unsigned char       h_verlen; //IPΪIPv4+ipͷȣ4ֽڶ)
//	unsigned char       version:4; //һIPΪIPv4,4ʾ4λ
	unsigned char       tos; //
	unsigned short      total_len; //ܳȣIPͷTCPͷԼݣ
	unsigned short      ident; //ʶ,ID嵥IP,
	unsigned short      frag_and_flags;//־λƫ
	unsigned char       ttl; //ʱ
	unsigned char       protocol; //Э
	unsigned short      checksum; //
	unsigned long        sourceIP; //ԴIPַ
	unsigned long        destIP; //ĿIPַ
}ip_header;


typedef struct tcp_header
{
	unsigned short    th_sport;  //Դ˿
	unsigned short    th_dport; //ĿĶ˿
	unsigned int     th_seq; //к
	unsigned int     th_ack; //ȷϺ
	//0000,0000 00,000010
	unsigned char    th_lenres; //4 λTCPײ+6λǰ 4 λ
	unsigned char    th_flag; //6λǰ2 λ+־λ
	unsigned short    th_win; //ڴС
	unsigned short    th_sum; //
	unsigned short    th_urp; //ָ
}tcp_header;

typedef struct udp_header
{
	uint16_t source;			 /* source port,ȼunsigned int */
	uint16_t dest;				 /* destination port */
	uint16_t len;					 /* udp length */
	uint16_t checkl;			 /* udp checksum */
}udp_header;

typedef struct psd_header
{
	unsigned long    saddr;  //Դַ
	unsigned long    daddr; //Ŀĵַ
	char            mbz; //ÿ
	char            ptcl; //Э
	unsigned short    tcpl; //ݰ
}psd_header;

#define IPTCPSIZE 58

typedef struct x802_header
{
	u_char version;//802.1x汾
	u_char type;//eap0--eap,1--eapol
	u_short len;//eapݰ,ײ
}x802_header;

typedef struct eap_header
{
	u_char code;//request--1,respond--2
	u_char id;//id
	u_short len;//eapݰ,ײ
	u_char type;//1--identity,--md5-challenge,3--legacy_Nak
}eap_header;//СΪ6