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

📄 ni_in.c,v

📁 TCP-IP红宝书源代码
💻 C,V
字号:
head	1.1;
access;
symbols;
locks
	dls:1.1; strict;
comment	@ * @;


1.1
date	97.09.21.19.27.59;	author dls;	state Dist;
branches;
next	;


desc
@@


1.1
log
@pre-3e code
@
text
@/* ni_in.c - ni_in */

#include <conf.h>
#include <kernel.h>
#include <network.h>

#include <ospf.h>
/*#define	DEBUG */

/*------------------------------------------------------------------------
 *  ni_in - network interface input function
 *------------------------------------------------------------------------
 */
int ni_in(pni, pep, len)
struct	netif	*pni;		/* the interface	*/
struct	ep	*pep;		/* the packet		*/
int		len;		/* length, in octets	*/
{
	int	rv;

	pep->ep_ifn = pni - &nif[0];	/* record originating intf # */

	pni->ni_ioctets += len;
	if (blkequ(pni->ni_hwa.ha_addr, pep->ep_dst, EP_ALEN))
		pni->ni_iucast++;
	else
		pni->ni_inucast++;
	switch (pep->ep_type) {
	case EPT_ARP:	rv = arp_in(pni, pep);	break;
	case EPT_RARP:	rv = rarp_in(pni, pep);	break;
	case EPT_IP:	rv = ip_in(pni, pep);	break;
	default:
		pni->ni_iunkproto++;
		freebuf(pep);
		rv = OK;
	}
	return rv;
}
@

⌨️ 快捷键说明

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