Since now I can also use 'dead interval', not just 'dead counter'.

This commit is contained in:
Ondrej Filip 2005-02-20 04:27:56 +00:00
parent 7de7470a2a
commit d8c7d9e884
8 changed files with 20 additions and 7 deletions

View file

@ -122,6 +122,7 @@ protocol static {
# interface "arc0" { # interface "arc0" {
# type nonbroadcast; # type nonbroadcast;
# poll 14; # poll 14;
# dead 75;
# neighbors { # neighbors {
# 10.1.1.2 eligible; # 10.1.1.2 eligible;
# 10.1.1.4; # 10.1.1.4;

View file

@ -1024,6 +1024,7 @@ protocol ospf <name> {
priority <num>; priority <num>;
wait <num>; wait <num>;
dead count <num>; dead count <num>;
dead <num>;
type [broadcast|nonbroadcast|pointopoint]; type [broadcast|nonbroadcast|pointopoint];
strict nonbroadcast <switch>; strict nonbroadcast <switch>;
authentication [none|simple]; authentication [none|simple];
@ -1048,6 +1049,7 @@ protocol ospf <name> {
retransmit <num>; retransmit <num>;
wait <num>; wait <num>;
dead count <num>; dead count <num>;
dead <num>;
authentication [none|simple]; authentication [none|simple];
password "<text>"; password "<text>";
}; };
@ -1126,6 +1128,11 @@ protocol ospf <name> {
When the router does not receive any messages from a neighbor in When the router does not receive any messages from a neighbor in
<m/dead count/*<m/hello/ seconds, it will consider the neighbor down. <m/dead count/*<m/hello/ seconds, it will consider the neighbor down.
<tag>dead <M>num</M></tag>
When the router does not receive any messages from a neighbor in
<m/dead/ seconds, it will consider the neighbor down. If both directives
<m/dead count/ and <m/dead/ are used, <m/dead/ has precendence.
<tag>type broadcast</tag> <tag>type broadcast</tag>
BIRD detects a type of a connected network automatically, but sometimes it's BIRD detects a type of a connected network automatically, but sometimes it's
convenient to force use of a different type manually. convenient to force use of a different type manually.

View file

@ -96,6 +96,7 @@ ospf_vlink_item:
| RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=0) cf_error("Retransmit int must be greater than zero"); } | RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=0) cf_error("Retransmit int must be greater than zero"); }
| TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); } | TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); }
| WAIT expr { OSPF_PATT->waitint = $2 ; } | WAIT expr { OSPF_PATT->waitint = $2 ; }
| DEAD expr { OSPF_PATT->dead = $2 ; if ($2<=1) cf_error("Dead interval must be greater than one"); }
| DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); } | DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); }
| AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE ; } | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE ; }
| AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE ; } | AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE ; }
@ -115,6 +116,7 @@ ospf_vlink_start: VIRTUAL LINK idval
OSPF_PATT->inftransdelay = INFTRANSDELAY_D; OSPF_PATT->inftransdelay = INFTRANSDELAY_D;
OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D; OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D;
OSPF_PATT->deadc = DEADC_D; OSPF_PATT->deadc = DEADC_D;
OSPF_PATT->dead = 0;
OSPF_PATT->type = OSPF_IT_VLINK; OSPF_PATT->type = OSPF_IT_VLINK;
init_list(&OSPF_PATT->nbma_list); init_list(&OSPF_PATT->nbma_list);
OSPF_PATT->autype = OSPF_AUTH_NONE; OSPF_PATT->autype = OSPF_AUTH_NONE;
@ -129,6 +131,7 @@ ospf_iface_item:
| TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); } | TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); }
| PRIORITY expr { OSPF_PATT->priority = $2 ; if (($2<0) || ($2>255)) cf_error("Priority must be in range 0-255"); } | PRIORITY expr { OSPF_PATT->priority = $2 ; if (($2<0) || ($2>255)) cf_error("Priority must be in range 0-255"); }
| WAIT expr { OSPF_PATT->waitint = $2 ; } | WAIT expr { OSPF_PATT->waitint = $2 ; }
| DEAD expr { OSPF_PATT->dead = $2 ; if ($2<=1) cf_error("Dead interval must be greater than one"); }
| DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); } | DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); }
| TYPE BROADCAST { OSPF_PATT->type = OSPF_IT_BCAST ; } | TYPE BROADCAST { OSPF_PATT->type = OSPF_IT_BCAST ; }
| TYPE NONBROADCAST { OSPF_PATT->type = OSPF_IT_NBMA ; } | TYPE NONBROADCAST { OSPF_PATT->type = OSPF_IT_NBMA ; }
@ -210,6 +213,7 @@ ospf_iface_start:
OSPF_PATT->priority = PRIORITY_D; OSPF_PATT->priority = PRIORITY_D;
OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D; OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D;
OSPF_PATT->deadc = DEADC_D; OSPF_PATT->deadc = DEADC_D;
OSPF_PATT->dead = 0;
OSPF_PATT->type = OSPF_IT_UNDEF; OSPF_PATT->type = OSPF_IT_UNDEF;
OSPF_PATT->strictnbma = 0; OSPF_PATT->strictnbma = 0;
OSPF_PATT->stub = 0; OSPF_PATT->stub = 0;

View file

@ -38,7 +38,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
return; return;
} }
if (ntohl(ps->deadint) != ifa->helloint * ifa->deadc) if (ntohl(ps->deadint) != ifa->dead)
{ {
log(L_ERR "%s%I%sdead interval mismatch (%d).", beg, faddr, rec, log(L_ERR "%s%I%sdead interval mismatch (%d).", beg, faddr, rec,
ntohl(ps->deadint)); ntohl(ps->deadint));
@ -209,7 +209,7 @@ ospf_hello_send(timer * timer, int poll, struct ospf_neighbor *dirn)
pkt->helloint = ntohs(ifa->helloint); pkt->helloint = ntohs(ifa->helloint);
pkt->options = ifa->oa->opt.byte; pkt->options = ifa->oa->opt.byte;
pkt->priority = ifa->priority; pkt->priority = ifa->priority;
pkt->deadint = htonl(ifa->deadc * ifa->helloint); pkt->deadint = htonl(ifa->dead);
pkt->dr = ifa->drip; pkt->dr = ifa->drip;
ipa_hton(pkt->dr); ipa_hton(pkt->dr);
pkt->bdr = ifa->bdrip; pkt->bdr = ifa->bdrip;

View file

@ -393,7 +393,7 @@ ospf_iface_new(struct proto_ospf *po, struct iface *iface,
ifa->pollint = ip->pollint; ifa->pollint = ip->pollint;
ifa->strictnbma = ip->strictnbma; ifa->strictnbma = ip->strictnbma;
ifa->waitint = ip->waitint; ifa->waitint = ip->waitint;
ifa->deadc = ip->deadc; ifa->dead = (ip->dead == 0) ? ip->deadc * ifa->helloint : ip->dead;
ifa->stub = ip->stub; ifa->stub = ip->stub;
ifa->autype = ip->autype; ifa->autype = ip->autype;
ifa->passwords = ip->passwords; ifa->passwords = ip->passwords;
@ -585,7 +585,7 @@ ospf_iface_info(struct ospf_iface *ifa)
cli_msg(-1015, "\tPoll timer: %u", ifa->pollint); cli_msg(-1015, "\tPoll timer: %u", ifa->pollint);
} }
cli_msg(-1015, "\tWait timer: %u", ifa->waitint); cli_msg(-1015, "\tWait timer: %u", ifa->waitint);
cli_msg(-1015, "\tDead timer: %u", ifa->deadc * ifa->helloint); cli_msg(-1015, "\tDead timer: %u", ifa->dead);
cli_msg(-1015, "\tRetransmit timer: %u", ifa->rxmtint); cli_msg(-1015, "\tRetransmit timer: %u", ifa->rxmtint);
if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA)) if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA))
{ {

View file

@ -309,7 +309,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event)
case NEIGHBOR_DOWN: case NEIGHBOR_DOWN:
neigh_chstate(n, NEIGHBOR_INIT); neigh_chstate(n, NEIGHBOR_INIT);
default: default:
tm_start(n->inactim, n->ifa->deadc * n->ifa->helloint); /* Restart inactivity timer */ tm_start(n->inactim, n->ifa->dead); /* Restart inactivity timer */
break; break;
} }
break; break;

View file

@ -721,7 +721,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
/* DEAD COUNT */ /* DEAD COUNT */
if (ip1->deadc != ip2->deadc) if (ip1->deadc != ip2->deadc)
{ {
ifa->deadc = ip2->deadc; ifa->dead = ip2->dead;
OSPF_TRACE(D_EVENTS, OSPF_TRACE(D_EVENTS,
"Changing dead count on interface %s from %d to %d", "Changing dead count on interface %s from %d to %d",
ifa->iface->name, ip1->deadc, ip2->deadc); ifa->iface->name, ip1->deadc, ip2->deadc);

View file

@ -138,7 +138,7 @@ struct ospf_iface
u32 waitint; /* number of sec before changing state from wait */ u32 waitint; /* number of sec before changing state from wait */
u32 rxmtint; /* number of seconds between LSA retransmissions */ u32 rxmtint; /* number of seconds between LSA retransmissions */
u32 pollint; /* Poll interval */ u32 pollint; /* Poll interval */
u32 deadc; /* after "deadint" missing hellos is router dead */ u32 dead; /* after "deadint" missing hellos is router dead */
u32 vid; /* Id of peer of virtual link */ u32 vid; /* Id of peer of virtual link */
ip_addr vip; /* IP of peer of virtual link */ ip_addr vip; /* IP of peer of virtual link */
struct ospf_area *voa; /* Area wich the vlink goes through */ struct ospf_area *voa; /* Area wich the vlink goes through */
@ -548,6 +548,7 @@ struct ospf_iface_patt
u32 priority; u32 priority;
u32 waitint; u32 waitint;
u32 deadc; u32 deadc;
u32 dead;
u32 type; u32 type;
u32 autype; u32 autype;
u32 strictnbma; u32 strictnbma;