summaryrefslogtreecommitdiff
path: root/nest/protocol.h
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-01-16 16:44:50 +0000
committerMartin Mares <mj@ucw.cz>2000-01-16 16:44:50 +0000
commit50fe90edf3deab409ea7887c131bfe6ce89fa556 (patch)
treed9aad4ed34285a59cfcc0286a22ca5ccdb63a82f /nest/protocol.h
parent394aec8fdd112a81da1e2f6f0e09ee74256dc24e (diff)
First attempt on dynamic reconfiguration. There are still lots of bugs
and problems to solve, but the hardest part works.
Diffstat (limited to 'nest/protocol.h')
-rw-r--r--nest/protocol.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/nest/protocol.h b/nest/protocol.h
index 39d1cf5d..72f88b6b 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -41,7 +41,7 @@ struct protocol {
void (*preconfig)(struct protocol *, struct config *); /* Just before configuring */
void (*postconfig)(struct proto_config *); /* After configuring each instance */
struct proto * (*init)(struct proto_config *); /* Create new instance */
- int (*reconfigure)(struct proto *, struct proto_config *); /* Try to reconfigure instance */
+ int (*reconfigure)(struct proto *, struct proto_config *); /* Try to reconfigure instance, returns success */
void (*dump)(struct proto *); /* Debugging dump */
void (*dump_attrs)(struct rte *); /* Dump protocol-dependent attributes */
int (*start)(struct proto *); /* Start the instance */
@@ -54,8 +54,7 @@ struct protocol {
void protos_build(void);
void protos_preconfig(struct config *);
void protos_postconfig(struct config *);
-void protos_commit(struct config *);
-void protos_start(void);
+void protos_commit(struct config *new, struct config *old, int force_restart);
void protos_dump_all(void);
void protos_shutdown(void);
@@ -92,6 +91,7 @@ struct proto {
node n;
struct protocol *proto; /* Protocol */
struct proto_config *cf; /* Configuration data */
+ struct proto_config *cf_new; /* Configuration we want to switch to after shutdown (NULL=delete) */
pool *pool; /* Pool containing local objects */
struct event *attn; /* "Pay attention" event */
@@ -103,6 +103,7 @@ struct proto {
unsigned proto_state; /* Protocol state machine (see below) */
unsigned core_state; /* Core state machine (see below) */
unsigned core_goal; /* State we want to reach (see below) */
+ unsigned reconfiguring; /* We're shutting down due to reconfiguration */
bird_clock_t last_state_change; /* Time of last state transition */
/*