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

📄 ip.h

📁 DM642网络开发原代码,可以将DM642与以太网进行连接
💻 H
字号:
#ifndef __IP_H
#define __IP_H

#include"csl.h"

#define UDP		0x11
#define	ICMP	0x01


/*
 *	This structure defines an ip header.
 */

struct iphdr {

	unsigned ihl:4,
	         version:4;
	Uint8  	 tos;
	Uint8	tot_len[2];
	Uint8 	id[2];
	Uint8	frag_off[2];
	Uint8 	ttl;
	Uint8	protocol;
	Uint8 	check[2];
	Uint8	saddr[4];
	Uint8	daddr[4];
	/*The options start here. */
};//__attribute__ ((packed));

int ip_init(Uint32 ip);
int ip_rcv_packet(struct sk_buff *skb);
int ip_send(struct sk_buff *skb, Uint32 ip, Uint8 proto);
void ip_skb_reserve(struct sk_buff *skb);
Uint32 ip_get_source_ip(struct sk_buff *skb);

#endif /* __IP_H */

⌨️ 快捷键说明

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