diff options
author | Martin Mares <mj@ucw.cz> | 2000-04-25 21:58:17 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-04-25 21:58:17 +0000 |
commit | 42532f084640645cfde9af7c0aa69a36b1de91ad (patch) | |
tree | 805e4266eefc9c8b1bddf84fcceda7980095847c /proto/bgp/bgp.c | |
parent | 41b26cfb552a4a441490779344326ff85819252b (diff) |
Support dynamic reconfiguration.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 403d8583..cdbdf461 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -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 }; |