]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Allow setting debug value and `disabled' flag in protocol definition.
authorMartin Mares <mj@ucw.cz>
Sun, 29 Nov 1998 14:40:39 +0000 (14:40 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 29 Nov 1998 14:40:39 +0000 (14:40 +0000)
bird.conf
nest/config.Y
nest/protocol.h

index ea7edf8d1008b25387c1ca9cb514ddbead226f37..314e2426ca910cf75230098286f105beeb1e5a0f 100644 (file)
--- a/bird.conf
+++ b/bird.conf
@@ -6,8 +6,9 @@
 
 router id 62.168.0.1
 
-define xyzzy = 120+10;
+define xyzzy = 120+10
 
 protocol rip MyRIP_test {
-       preference xyzzy;
+       preference xyzzy
+       debug all
 }
index f467a1a469a5b943244c0cd87cf1e6be99fcc1b3..9efebbe672b414b8701199f91b4c73ae7d15ea96 100644 (file)
@@ -12,7 +12,7 @@ static struct proto *this_proto;
 
 CF_DECLS
 
-CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE)
+CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF)
 
 %type <i> idval
 
@@ -58,6 +58,10 @@ proto_item:
      if ($2 < 0 || $2 > 255) cf_error("Invalid preference");
      this_proto->preference = $2;
    }
+ | DISABLED { this_proto->disabled = 1; }
+ | DEBUG expr { this_proto->debug = $2; }
+ | DEBUG ALL { this_proto->debug = ~0; }
+ | DEBUG OFF { this_proto->debug = 0; }
  ;
 
 CF_CODE
index d94e02d3adfc79c88002830d1b4e753d589d516f..34624e95d4859c214e22b000fc0390196b752a43 100644 (file)
@@ -60,6 +60,7 @@ struct proto {
   pool *pool;                          /* Local objects */
   unsigned preference;                 /* Default route preference */
   unsigned state;                      /* PRS_... */
+  unsigned disabled;                   /* Manually disabled */
 
   void (*if_notify)(struct proto *, unsigned flags, struct iface *new, struct iface *old);
   void (*rt_notify)(struct proto *, struct network *net, struct rte *new, struct rte *old);