]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Reconfiguration for device protocol.
authorMartin Mares <mj@ucw.cz>
Mon, 17 Jan 2000 11:17:33 +0000 (11:17 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 17 Jan 2000 11:17:33 +0000 (11:17 +0000)
sysdep/linux/netlink/krt-iface.h
sysdep/unix/krt-iface.h
sysdep/unix/krt.c

index b0fbdd15cdbf1fd75c1a39968a5a1dbf5e73ca84..eddfbac507b3bbeecf289c00cebfc75b6e67f086 100644 (file)
@@ -23,4 +23,6 @@ static inline void krt_if_construct(struct kif_config *c) { };
 static inline void krt_if_shutdown(struct kif_proto *p) { };
 static inline void krt_if_io_init(void) { };
 
+static inline int kif_params_same(struct krt_if_params *old, struct krt_if_params *new) { return 1; }
+
 #endif
index b27e86dc8d9141259d5a8a7f015334dab33c5a54..48075d6b0d612b9335d914e60928f36e779e6e9f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     BIRD -- Unix Kernel Interface Syncer
  *
- *     (c) 1998--1999 Martin Mares <mj@ucw.cz>
+ *     (c) 1998--2000 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -17,4 +17,6 @@ struct krt_if_status {
 
 extern int if_scan_sock;
 
+static inline int kif_params_same(struct krt_if_params *old, struct krt_if_params *new) { return 1; }
+
 #endif
index 7c92c551b7e6e0fe2a251c3492db0586d2860d70..bbca8cfa36f0820c1e11a8c147c90519b7a3a71d 100644 (file)
@@ -140,6 +140,24 @@ kif_shutdown(struct proto *P)
   return PS_DOWN;
 }
 
+static int
+kif_reconfigure(struct proto *p, struct proto_config *new)
+{
+  struct kif_config *o = (struct kif_config *) p->cf;
+  struct kif_config *n = (struct kif_config *) new;
+
+  if (!kif_params_same(&o->iface, &n->iface))
+    return 0;
+  if (o->scan_time != n->scan_time)
+    {
+      tm_stop(kif_scan_timer);
+      kif_scan_timer->recurrent = n->scan_time;
+      kif_scan(kif_scan_timer);
+      tm_start(kif_scan_timer, n->scan_time);
+    }
+  return 1;
+}
+
 struct protocol proto_unix_iface = {
   name:                "Device",
   priority:    100,
@@ -147,6 +165,7 @@ struct protocol proto_unix_iface = {
   init:                kif_init,
   start:       kif_start,
   shutdown:    kif_shutdown,
+  reconfigure: kif_reconfigure,
 };
 
 /*