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

📄 ipredirect.c,v

📁 关于IP协议方面的
💻 C,V
字号:
head	1.1;access;symbols;locks	dls:1.1; strict;comment	@ * @;1.1date	97.09.21.19.27.09;	author dls;	state Dist;branches;next	;desc@@1.1log@pre-3e code@text@/* ipredirect.c - ipredirect */#include <conf.h>#include <kernel.h>#include <network.h>struct	route	*rtget();/*------------------------------------------------------------------------ *  ipredirect  -  send redirects, if needed *------------------------------------------------------------------------ */void ipredirect(pep, ifnum, prt)struct	ep	*pep;		/* the current IP packet		*/int		ifnum;		/* the input interface			*/struct	route	*prt;		/* where we want to route it		*/{	struct	ip	*pip = (struct ip *)pep->ep_data;	struct	route	*tprt;	int		rdtype, isonehop;	IPaddr		nmask;	/* network part's mask			*/	if (ifnum == NI_LOCAL || ifnum != prt->rt_ifnum)		return;	tprt = rtget(pip->ip_src, RTF_LOCAL);	if (!tprt)		return;	isonehop = tprt->rt_metric == 0;	rtfree(tprt);	if (!isonehop)		return;	/* got one... */	nmask = netmask(prt->rt_net);	/* get the default net mask	*/	if (prt->rt_mask == nmask)		rdtype = ICC_NETRD;	else		rdtype = ICC_HOSTRD;	icmp(ICT_REDIRECT, rdtype, pip->ip_src, pep, prt->rt_gw);}@

⌨️ 快捷键说明

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