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

📄 rttimer.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@/* rttimer.c - rttimer */#include <conf.h>#include <kernel.h>#include <network.h>extern	Bool	dorip;		/* TRUE if we're running RIP output	*/extern	int	rippid;		/* RIP output pid, if running		*//*------------------------------------------------------------------------ * rttimer - update ttls and delete expired routes *------------------------------------------------------------------------ */intrttimer(delta)unsigned int	delta;{	struct	route	*prt, *prev;	Bool		ripnotify;	int		i;	if (!Route.ri_valid)		return;	wait(Route.ri_mutex);		ripnotify = FALSE;	for (i=0; i<RT_TSIZE; ++i) {		if (rttable[i] == 0)			continue;		for (prev = NULL, prt = rttable[i]; prt != NULL;) {			if (prt->rt_ttl != RT_INF)				prt->rt_ttl -= delta;			if (prt->rt_ttl <= 0) {#ifdef	RIP				if (dorip && prt->rt_metric < RTM_INF) {					prt->rt_metric = RTM_INF;					prt->rt_ttl = RIPZTIME;					ripnotify = TRUE;					continue;				}#endif	/* RIP */				if (prev) {					prev->rt_next = prt->rt_next;					RTFREE(prt);					prt = prev->rt_next;				} else {					rttable[i] = prt->rt_next;					RTFREE(prt);					prt = rttable[i];				}				continue;			}			prev = prt;			prt = prt->rt_next;		}	}	prt = Route.ri_default;	if (prt && (prt->rt_ttl<RT_INF) && (prt->rt_ttl -= delta) <= 0) {#ifdef	RIP		if (dorip && prt->rt_metric < RTM_INF) {			prt->rt_metric = RTM_INF;			prt->rt_ttl = RIPZTIME;		} else#endif	/* RIP */		{			RTFREE(Route.ri_default);			Route.ri_default = 0;		}	}	signal(Route.ri_mutex);#ifdef	RIP	if (dorip && ripnotify)		send(rippid, 0);	/* send anything but TIMEOUT	*/#endif	/* RIP */	return;}@

⌨️ 快捷键说明

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