dd_send.c,v

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

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


1.1
date	94.02.06.18.20.09;	author dls;	state Ok;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@/* dd_send.c - dd_send */

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

/*------------------------------------------------------------------------
 *  dd_send - generate Data Description packets
 *------------------------------------------------------------------------
 */
int dd_send(pif, pnb)
struct ospf_if	*pif;
struct ospf_nb	*pnb;
{
	struct	ep	*pep;
	struct	ip	*pip;
	struct	ospf	*po;
	struct	ospf_dd	*pdd;

kprintf("dd_send\n");

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

	ospfddtmpl(pif, pep);
	if (pnb->nb_state == NBS_EXSTART) {
		pdd->dd_control = DDC_INIT | DDC_MORE | DDC_MSTR;
		pdd->dd_seq = pnb->nb_seq;
		if (enq(pnb->nb_dsl, pep, -pdd->dd_seq) < 0)
			freebuf(pep);
	} else
		lsa_build(pif, pnb, pep);
	if (pnb->nb_trexmt == 0) {	/* none pending... send one */
		dd_xmit(pif, pnb);
		pnb->nb_trexmt = pif->if_rintv;
	}
}
@

⌨️ 快捷键说明

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