]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Support dynamic reconfiguration.
authorMartin Mares <mj@ucw.cz>
Tue, 25 Apr 2000 21:58:17 +0000 (21:58 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 25 Apr 2000 21:58:17 +0000 (21:58 +0000)
proto/bgp/bgp.c
proto/bgp/packets.c

index 403d85832348cc8dddd50f21c9fb984becae1c90..cdbdf461285f334525239c4ab69d53e5079f54f4 100644 (file)
@@ -47,7 +47,6 @@ void
 bgp_start_timer(timer *t, int value)
 {
   /* FIXME: Randomize properly */
-  /* FIXME: Check if anybody uses tm_start directly */
   if (value)
     tm_start(t, value);
   else
@@ -432,7 +431,7 @@ bgp_check(struct bgp_config *c)
     cf_error("Neighbor must be configured");
 }
 
-void
+static void
 bgp_get_status(struct proto *P, byte *buf)
 {
   struct bgp_proto *p = (struct bgp_proto *) P;
@@ -440,6 +439,18 @@ bgp_get_status(struct proto *P, byte *buf)
   strcpy(buf, bgp_state_names[MAX(p->incoming_conn.state, p->outgoing_conn.state)]);
 }
 
+static int
+bgp_reconfigure(struct proto *P, struct proto_config *C)
+{
+  struct bgp_config *new = (struct bgp_config *) C;
+  struct bgp_proto *p = (struct bgp_proto *) P;
+  struct bgp_config *old = p->cf;
+
+  return !memcmp(((byte *) old) + sizeof(struct proto_config),
+                ((byte *) new) + sizeof(struct proto_config),
+                sizeof(struct bgp_config) - sizeof(struct proto_config));
+}
+
 struct protocol proto_bgp = {
   name:                        "BGP",
   template:            "bgp%d",
@@ -449,9 +460,9 @@ struct protocol proto_bgp = {
   shutdown:            bgp_shutdown,
   get_status:          bgp_get_status,
   get_attr:            bgp_get_attr,
+  reconfigure:         bgp_reconfigure,
 #if 0
   dump:                        bgp_dump,
   get_route_info:      bgp_get_route_info,
-  /* FIXME: Reconfiguration */
 #endif
 };
index 2f25a3001d1551d2d9e8629ae68bba818b2e5431..d17491b2ab10ad808cae87cbbed7338b4eee6636 100644 (file)
@@ -326,7 +326,6 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, int len)
   prefix = ipa_and(prefix, ipa_mkmask(b));     \
   pxlen = b;                                   \
 } while (0)
-/* FIXME: Check validity of prefixes */
 
 static void
 bgp_rx_update(struct bgp_conn *conn, byte *pkt, int len)
@@ -440,6 +439,7 @@ bgp_log_error(struct bgp_proto *p, char *msg, unsigned code, unsigned subcode, b
   byte *t, argbuf[36];
   unsigned i;
 
+  /* FIXME: Printing of cease messages */
   bsprintf(namebuf, "%d.%d", code, subcode);
   name = namebuf;
   for (i=0; i < ARRAY_SIZE(bgp_msg_table); i++)