db_new.c

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

C
24 行
字号
/* db_new.c - db_new */

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

/*------------------------------------------------------------------------
 *  db_new - create a new topological database entry
 *------------------------------------------------------------------------
 */
struct ospf_db *
db_new(struct ospf_ar *par, struct ospf_lsa *plsa)
{
	struct ospf_db	*pdb;

	pdb = (struct ospf_db *)getbuf(ospf_lspool);
	if ((int)pdb == SYSERR)
		return 0;
	memset(pdb, 0, sizeof(struct ospf_db));
	pdb->db_lsa = *plsa;	/* structure copy */
	return pdb;
}

⌨️ 快捷键说明

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