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

📄 netif.h.svn-base

📁 数字广播系统的开发源码
💻 SVN-BASE
字号:
/*
 */

/* 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 xdata *pNext;	/* point to the next netif */
	unsigned long IPAddr;			/* Ip address for this device */
	unsigned long NetMask;			/* Net mask for this device */
	unsigned long 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 (code * input)(struct SNetIf xdata * NetIf) reentrant;

	/* 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 (code * output)(struct SMemHead xdata *MemHead,struct SNetIf xdata* NetIf,unsigned short DestIP) reentrant;

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

⌨️ 快捷键说明

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