ospflstmpl.c,v

来自「TCP-IP红宝书源代码」· C,V 代码 · 共 61 行

C,V
61
字号
head	1.1;
access;
symbols;
locks
	dls:1.1; strict;
comment	@ * @;


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


desc
@@


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

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

/*------------------------------------------------------------------------
 * ospflstmpl - fill in OSPF Link State Update packet template
 *------------------------------------------------------------------------
 */
struct ep *ospflstmpl(pif)
struct ospf_if	*pif;
{
	struct ep	*pep;
	struct ip	*pip;
	struct ospf	*po;
	struct ospf_lsu	*plsu;

	pep = (struct ep *)getbuf(Net.netpool);
	if ((int)pep == SYSERR)
		return 0;
	pip = (struct ip *)pep->ep_data;
	po = (struct ospf *)pip->ip_data;
	plsu = (struct ospf_lsu *)po->ospf_data;

	po->ospf_version = OSPF_VERSION;
	po->ospf_type = T_LSUPDATE;
	po->ospf_len = MINLSULEN;
	po->ospf_rid = pif->if_rid;
	po->ospf_aid = pif->if_area->ar_id;
	po->ospf_authtype = pif->if_area->ar_authtype;
	blkcopy(po->ospf_auth, pif->if_auth, AUTHLEN);
	plsu->lsu_nads = 0;
	return pep;
}
@

⌨️ 快捷键说明

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