nb_clearl.c

来自「TCP-IP红宝书源代码」· C语言 代码 · 共 32 行

C
32
字号
/* nb_clearl.c - nb_clearl */

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

/*------------------------------------------------------------------------
 *  nb_clearl - clear lists of pending messages for a given neighbor
 *------------------------------------------------------------------------
 */
int
nb_clearl(struct ospf_nb *pnb)
{
	struct ep	*pep;

	while (pep = (struct ep *)deq(pnb->nb_lsal))
		freebuf(pep);
	freeq(pnb->nb_lsal);
	pnb->nb_lsal = EMPTY;

	while (pep = (struct ep *)deq(pnb->nb_dsl))
		freebuf(pep);
	freeq(pnb->nb_dsl);
	pnb->nb_dsl = EMPTY;

	while (pep = (struct ep *)deq(pnb->nb_lsrl))
		freebuf(pep);
	freeq(pnb->nb_lsrl);
	pnb->nb_lsrl = EMPTY;
}

⌨️ 快捷键说明

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