ip.h

来自「s3c2410的烧片程序,用ads编译,可以通过串口或者jtag口烧写」· C头文件 代码 · 共 35 行

H
35
字号
#ifndef __IP_H#define __IP_H#define UDP		0x11#define	ICMP	0x01/* *	This structure defines an ip header. */__packed struct iphdr {	unsigned ihl:4,			 version:4;	unsigned char	tos;	//服务类型	unsigned short	tot_len;	//16位总长度(字节数)	unsigned short	id;				//16位标识	unsigned short	frag_off;	// 3位标志+13位片偏移	unsigned char	ttl;				//8位生存时间	unsigned char	protocol;		//8位协议	unsigned short	check;		//16位首部检验和	unsigned long	saddr;			//32位源IP地址	unsigned long	daddr;			//32位目的IP地址	/*The options start here. */};//__attribute__ ((packed));int ip_init(unsigned long ip);int ip_rcv_packet(struct sk_buff *skb);int ip_send(struct sk_buff *skb, unsigned long ip, unsigned char proto);void ip_skb_reserve(struct sk_buff *skb);unsigned long ip_get_source_ip(struct sk_buff *skb);#endif /* __IP_H */

⌨️ 快捷键说明

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