]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Since now I can also use 'dead interval', not just 'dead counter'.
authorOndrej Filip <feela@network.cz>
Sun, 20 Feb 2005 04:27:56 +0000 (04:27 +0000)
committerOndrej Filip <feela@network.cz>
Sun, 20 Feb 2005 04:27:56 +0000 (04:27 +0000)
doc/bird.conf.example
doc/bird.sgml
proto/ospf/config.Y
proto/ospf/hello.c
proto/ospf/iface.c
proto/ospf/neighbor.c
proto/ospf/ospf.c
proto/ospf/ospf.h

index 704abef055039c8a6b07b0c954e50e325f17f8a5..8260c028c332e6d8c3c0a64e0ca3dc8f23510781 100644 (file)
@@ -122,6 +122,7 @@ protocol static {
 #              interface "arc0" {
 #                      type nonbroadcast;
 #                      poll 14;
+#                      dead 75;
 #                      neighbors {
 #                              10.1.1.2 eligible;
 #                              10.1.1.4;
index 79d7e96418a41b747329d31a4ca1f578179e2c43..3c2330953b800fed85a6548c6d46d938ea079a8a 100644 (file)
@@ -1024,6 +1024,7 @@ protocol ospf &lt;name&gt; {
                        priority &lt;num&gt;;
                        wait &lt;num&gt;;
                        dead count &lt;num&gt;;
+                       dead &lt;num&gt;;
                        type [broadcast|nonbroadcast|pointopoint];
                        strict nonbroadcast &lt;switch&gt;;
                        authentication [none|simple];
@@ -1048,6 +1049,7 @@ protocol ospf &lt;name&gt; {
                        retransmit &lt;num&gt;;
                        wait &lt;num&gt;;
                        dead count &lt;num&gt;;
+                       dead &lt;num&gt;;
                        authentication [none|simple];
                        password "&lt;text&gt;";
                };
@@ -1126,6 +1128,11 @@ protocol ospf &lt;name&gt; {
         When the router does not receive any messages from a neighbor in
         <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>
         BIRD detects a type of a connected network automatically, but sometimes it's
         convenient to force use of a different type manually.
index 5f9f12ce6806372b963aee94d86cfadcb2c271b5..f14f1a4c6613bc547d9b39136ea14d7d04f5805d 100644 (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"); }
  | 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 ; }
+ | 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"); }
  | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE ; }
  | 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->waitint = WAIT_DMH*HELLOINT_D;
   OSPF_PATT->deadc = DEADC_D;
+  OSPF_PATT->dead = 0;
   OSPF_PATT->type = OSPF_IT_VLINK;
   init_list(&OSPF_PATT->nbma_list);
   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"); }
  | 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 ; }
+ | 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"); }
  | TYPE BROADCAST { OSPF_PATT->type = OSPF_IT_BCAST ; }
  | TYPE NONBROADCAST { OSPF_PATT->type = OSPF_IT_NBMA ; }
@@ -210,6 +213,7 @@ ospf_iface_start:
   OSPF_PATT->priority = PRIORITY_D;
   OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D;
   OSPF_PATT->deadc = DEADC_D;
+  OSPF_PATT->dead = 0;
   OSPF_PATT->type = OSPF_IT_UNDEF;
   OSPF_PATT->strictnbma = 0;
   OSPF_PATT->stub = 0;
index 5711ac5fd0107a4c7afb0039fa38d01a1f134f54..ce87431bff869620f305ba0d2d8bc7c4628ac1b8 100644 (file)
@@ -38,7 +38,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
     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,
        ntohl(ps->deadint));
@@ -209,7 +209,7 @@ ospf_hello_send(timer * timer, int poll, struct ospf_neighbor *dirn)
   pkt->helloint = ntohs(ifa->helloint);
   pkt->options = ifa->oa->opt.byte;
   pkt->priority = ifa->priority;
-  pkt->deadint = htonl(ifa->deadc * ifa->helloint);
+  pkt->deadint = htonl(ifa->dead);
   pkt->dr = ifa->drip;
   ipa_hton(pkt->dr);
   pkt->bdr = ifa->bdrip;
index 68b6377d9c6b44dbc45b6495b0a2dd1e85cfacba..cce7fafe1e151923f54416f1bf5883888fff5a2f 100644 (file)
@@ -393,7 +393,7 @@ ospf_iface_new(struct proto_ospf *po, struct iface *iface,
   ifa->pollint = ip->pollint;
   ifa->strictnbma = ip->strictnbma;
   ifa->waitint = ip->waitint;
-  ifa->deadc = ip->deadc;
+  ifa->dead = (ip->dead == 0) ? ip->deadc * ifa->helloint : ip->dead;
   ifa->stub = ip->stub;
   ifa->autype = ip->autype;
   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, "\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);
   if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA))
   {
index 59a98057bbfd02c1d541a9b1ae269582761633f2..7696d45e34b5f7299bdaf1252c5492d6ff3c766f 100644 (file)
@@ -309,7 +309,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event)
     case NEIGHBOR_DOWN:
       neigh_chstate(n, NEIGHBOR_INIT);
     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;
index ce01a37b4a7a4a66edd1d4558cc9718385738de5..e43c741bf808b8e701e616a9279d231b84e6b694 100644 (file)
@@ -721,7 +721,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
        /* DEAD COUNT */
        if (ip1->deadc != ip2->deadc)
        {
-         ifa->deadc = ip2->deadc;
+         ifa->dead = ip2->dead;
          OSPF_TRACE(D_EVENTS,
                     "Changing dead count on interface %s from %d to %d",
                     ifa->iface->name, ip1->deadc, ip2->deadc);
index 44ba10f01c8d10306f68291d209ed2e2d9acfe70..79d1f4f73a1ebfac9604466c7e5c7eab6aae7461 100644 (file)
@@ -138,7 +138,7 @@ struct ospf_iface
   u32 waitint;                 /* number of sec before changing state from wait */
   u32 rxmtint;                 /* number of seconds between LSA retransmissions */
   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 */
   ip_addr vip;                 /* IP of peer of virtual link */
   struct ospf_area *voa;       /* Area wich the vlink goes through */
@@ -548,6 +548,7 @@ struct ospf_iface_patt
   u32 priority;
   u32 waitint;
   u32 deadc;
+  u32 dead;
   u32 type;
   u32 autype;
   u32 strictnbma;