Definition.h
资源名称:MSSniffer.zip [点击查看]
上传用户:benyan892
上传日期:2010-01-28
资源大小:158k
文件大小:1k
源码类别:
网络截获/分析
开发平台:
Visual C++
- #ifndef _DEFINITION__H__
- #define _DEFINITION__H__
- typedef unsigned int tcp_seq;
- /*
- * TCP header
- */
- struct tcphdr {
- unsigned short th_sport; /* source port */
- unsigned short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
- unsigned char th_off:4, /* data offset */
- th_x2:4; /* (unused) */
- unsigned char th_flags;
- unsigned short th_win; /* window */
- unsigned short th_sum; /* checksum */
- unsigned short th_urp; /* urgent pointer */
- };
- #define TH_FIN 0x01
- #define TH_SYN 0x02
- #define TH_RST 0x04
- #define TH_PUSH 0x08
- #define TH_ACK 0x10
- #define TH_URG 0x20
- #define TH_NETDEV 0x00000001
- #define TH_TAPI 0x00000002
- //
- // Size defines
- //
- #define MAX_IP_SIZE 65535
- #define MIN_IP_HDR_SIZE 20
- //
- // Macros to extract the high and low order 4-bits from a byte
- //
- #define HI_BYTE(byte) (((byte) >> 4) & 0x0F)
- #define LO_BYTE(byte) ((byte) & 0x0F)
- //
- // Used to indicate to parser what fields to filter on
- //
- #define FILTER_MASK_SOURCE_ADDRESS 0x01
- #define FILTER_MASK_SOURCE_PORT 0x02
- #define FILTER_MASK_DESTINATION_ADDRESS 0x04
- #define FILTER_MASK_DESTINATION_PORT 0x08
- #endif