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

📄 netif.h

📁 实现在ARM上的ICP/IP功能的源代码。
💻 H
字号:

/* Network interface Head file */

/* the max number of netif */
#define NET_IF_MAX_NUM	1	
#define NETIF_HEAD_MAX_LEN	14	/* the max  phsical layer head len. eg ethernet head len */


/* netif is associated with each netwok device */
struct SNetIf
{
	struct SNetIf   *pNext;	/* point to the next netif */
	IP_ADDR IPAddr;			/* Ip address for this device */
	IP_ADDR NetMask;			/* Net mask for this device */
	IP_ADDR GateWay;			/* Gate way IP address fort this device */

	/* call input to get a packet from device to IP layer. This 
	function maybe 'EtherInput()', and called periodically */
	void (  * input)(struct SNetIf   * NetIf)  ;

	/* call output to put a packet from IP layer to device. After
	Ip layer selected a device, it use output to send this packet.
	MemHead contain a packet and Netif tell dirver which netif it 
	is. NOTE:MemHead->pStart point to pIPHead*/
	BOOL (  * output)(struct SMemHead   *MemHead,struct SNetIf  * NetIf,DWORD DestIP)  ;	

	void   *Info;	/* information of this device. eg. MAC address. */
};
void NetIfInit()  ;
struct SNetIf   * NetIfAdd(DWORD IPAddr, DWORD NetMask,DWORD GateWay,
						 void (  * input)(struct SNetIf   * NetIf)  ,
						 BOOL (  * output)(struct SMemHead   *MemHead,struct SNetIf  * NetIf,DWORD DestIP)  ,
						 void   * Info)  ;
struct SNetIf   * NetIfFindRout(IP_ADDR IPAddr)  ;
struct SNetIf   * NetIfFindIP(IP_ADDR IPAddr)  ;
void NetIfTimer()  ;

⌨️ 快捷键说明

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