ospfhtmpl.c,v
来自「TCP-IP红宝书源代码」· C,V 代码 · 共 127 行
C,V
127 行
head 1.3;
access;
symbols;
locks
dls:1.3; strict;
comment @ * @;
1.3
date 97.09.21.19.28.38; author dls; state Dist;
branches;
next 1.2;
1.2
date 94.02.06.18.21.04; author dls; state Works;
branches;
next 1.1;
1.1
date 94.01.18.20.50.51; author dls; state Old;
branches;
next ;
desc
@@
1.3
log
@pre-3e code
@
text
@/* ospfhtmpl.c - ospfhtmpl */
#include <conf.h>
#include <kernel.h>
#include <network.h>
#include <ospf.h>
/*------------------------------------------------------------------------
* ospfhtmpl - fill in OSPF HELLO packet template
*------------------------------------------------------------------------
*/
struct ep *ospfhtmpl(pif)
struct ospf_if *pif;
{
struct ep *pep;
struct ip *pip;
struct ospf *po;
struct ospf_hello *poh;
pep = (struct ep *)getbuf(Net.netpool);
if ((int)pep == SYSERR)
return 0;
pep->ep_order = ~0;
pip = (struct ip *)pep->ep_data;
po = (struct ospf *)pip->ip_data;
poh = (struct ospf_hello *)po->ospf_data;
po->ospf_version = OSPF_VERSION;
po->ospf_type = T_HELLO;
po->ospf_len = MINHELLOLEN;
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);
poh->oh_hintv = net2hs(pif->if_hintv);
poh->oh_opts = pif->if_opts;
poh->oh_rdintv = net2hl(pif->if_rdintv);
poh->oh_prio = pif->if_prio;
poh->oh_drid = pif->if_drid;
poh->oh_brid = pif->if_brid;
return pep;
}
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 2
int
ospfhtmpl(pif, pep)
a13 1
struct ep *pep;
d15 4
a18 3
struct ip *pip = (struct ip *)pep->ep_data;
struct ospf *po = (struct ospf *)pip->ip_data;
struct ospf_hello *poh = (struct ospf_hello *)po->ospf_data;
d20 7
d34 1
a34 1
poh->oh_hintv = pif->if_hintv;
d36 1
a36 1
poh->oh_rdintv = pif->if_rdintv;
d40 1
@
1.1
log
@Initial revision
@
text
@d13 2
a14 1
ospfhtmpl(pep)
d23 11
a33 11
po->ospf_rid = ospf_rid;
po->ospf_aid = ospf_aid;
/* change to area-dependent */
po->ospf_authtype = AU_NONE;
po->ospf_auth[0] = po->ospf_auth[1] = 0;
/* end change to area-dependent */
poh->oh_interval = HELLOINTV;
poh->oh_opts = 0;
poh->oh_dead = DEADINTV;
poh->oh_rprio = ospf_rprio;
@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?