chiark / gitweb /
site: Change site->control(bool_t) to site->startup()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 14:23:24 +0000 (14:23 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 15:03:24 +0000 (15:03 +0000)
This is only ever called with run=True.  We are going to want to rely
on this property.

If we ever do more runtime reconfig that will be done differently.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
secnet.c
secnet.h
site.c

index de16eb3aaa02832fda22ede160897543adf32026..a00124f17706079f1074305ad25f830b0d57e9d5 100644 (file)
--- a/secnet.c
+++ b/secnet.c
@@ -247,7 +247,7 @@ static void start_sites(dict_t *config) {
                cfgfatal(site->loc,"system","non-site closure in site list");
            }
            s=site->data.closure->interface;
-           s->control(s->st,True);
+           s->startup(s->st);
        }
     }
 }
index d447ffbd48b5c466e920ee6a7d7c1135bed3bfb0..fd4b48f70cbeed0fd78d9ccafa7f201c8668292d 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -659,11 +659,11 @@ void log_early_init(void);
 
 /* Pretty much a placeholder; allows starting and stopping of processing,
    key expiry, etc. */
-typedef void site_control_fn(void *st, bool_t run);
+typedef void site_startup_fn(void *st);
 typedef uint32_t site_status_fn(void *st);
 struct site_if {
     void *st;
-    site_control_fn *control;
+    site_startup_fn *startup;
     site_status_fn *status;
 };
 
diff --git a/site.c b/site.c
index 317bdc53e31aabbcba4a76fdbfdbfe958338a17e..a0715000285f5f65e4dd7a617726f2dcfe79922b 100644 (file)
--- a/site.c
+++ b/site.c
@@ -2283,11 +2283,10 @@ static bool_t site_incoming(void *sst, struct buffer_if *buf,
     return False;
 }
 
-static void site_control(void *vst, bool_t run)
+static void site_startup(void *vst)
 {
     struct site *st=vst;
-    if (run) enter_state_run(st);
-    else enter_state_stop(st);
+    enter_state_run(st);
 }
 
 static void site_phase_hook(void *sst, uint32_t newphase)
@@ -2331,7 +2330,7 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context,
     st->cl.apply=NULL;
     st->cl.interface=&st->ops;
     st->ops.st=st;
-    st->ops.control=site_control;
+    st->ops.startup=site_startup;
     st->ops.status=site_status;
     st->peerkeys_path=0;
     st->peerkeys_tmpl.buffer=0;