summaryrefslogtreecommitdiffstats
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-01-17 12:17:33 +0100
committerMartin Mares <mj@ucw.cz>2000-01-17 12:17:33 +0100
commitf7fcb752520759ab3aed274ca608e8e6f96665c8 (patch)
tree1697ba3e07ec676c52984974f76c726e3b3bad5e /sysdep
parent0ec90e9fc6f6bec2d0b64f6b9711a6d3edb4bd52 (diff)
downloadbird-f7fcb752520759ab3aed274ca608e8e6f96665c8.tar
bird-f7fcb752520759ab3aed274ca608e8e6f96665c8.zip
Reconfiguration for device protocol.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/linux/netlink/krt-iface.h2
-rw-r--r--sysdep/unix/krt-iface.h4
-rw-r--r--sysdep/unix/krt.c19
3 files changed, 24 insertions, 1 deletions
diff --git a/sysdep/linux/netlink/krt-iface.h b/sysdep/linux/netlink/krt-iface.h
index b0fbdd1..eddfbac 100644
--- a/sysdep/linux/netlink/krt-iface.h
+++ b/sysdep/linux/netlink/krt-iface.h
@@ -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
diff --git a/sysdep/unix/krt-iface.h b/sysdep/unix/krt-iface.h
index b27e86d..48075d6 100644
--- a/sysdep/unix/krt-iface.h
+++ b/sysdep/unix/krt-iface.h
@@ -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
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 7c92c55..bbca8cf 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -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,
};
/*