⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sockraw5.h

📁 See Appendix B for a description of the programs included on this companion disk. RESOURCE.WRI iden
💻 H
字号:
//	SOCKRAW.h
//	IP and ICMP data structures for raw sockets.

#define ICMP_ECHO 8						// An ICMP echo message
#define ICMP_ECHOREPLY 0			// An ICMP echo reply message
#define	ICMP_HEADERSIZE 8			// ICMP header size ("echo messages" only)

struct icmp										// Structure for an ICMP header
	{
		BYTE icmp_type;						// Type of message
		BYTE icmp_code;						// Type "sub code" (zero for echos)
		WORD icmp_cksum;					// 1's complement checksum
		WORD icmp_id;							// Unique ID (our handle)
		WORD icmp_seq;						// Datagram sequence number
		BYTE icmp_data[1];				// Start of the optional data
	};

struct ip 										// Structure for IP datagram header
	{
		BYTE ip_verlen;						// Version and header length
		BYTE ip_tos;							// Type of service
		WORD ip_len;							// Total packet length 
		UINT ip_id;								// Datagram identification 
		WORD ip_fragoff;					// Fragment offset 
		BYTE ip_ttl;							// Time to live 
		BYTE ip_proto;						// Protocol
		UINT ip_chksum;						// Checksum 
		IN_ADDR ip_src_addr;			// Source address 
		IN_ADDR ip_dst_addr;			// Destination address 
		BYTE ip_data[1];					// Variable length data area
	};
			

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -