From: Martin Willi Date: Fri, 10 Apr 2015 12:05:44 +0000 (+0200) Subject: starter: Send configuration load/reload events during startup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=601dd43d33d929135500e80608bd904269e337aa;p=thirdparty%2Fstrongswan.git starter: Send configuration load/reload events during startup --- diff --git a/src/starter/starter.c b/src/starter/starter.c index 74b5b52861..fae0a39df7 100644 --- a/src/starter/starter.c +++ b/src/starter/starter.c @@ -705,6 +705,11 @@ int main (int argc, char **argv) exit(LSB_RC_SUCCESS); } + if (starter_charon_pid()) + { + starter_stroke_config_reload_start(); + } + /* * Delete all connections. Will be added below */ @@ -848,6 +853,7 @@ int main (int argc, char **argv) } _action_ &= ~FLAG_ACTION_START_CHARON; + starter_stroke_config_reload_start(); for (ca = cfg->ca_first; ca; ca = ca->next) { if (ca->state == STATE_ADDED) @@ -913,6 +919,7 @@ int main (int argc, char **argv) } } } + starter_stroke_config_reload_end(); } /* diff --git a/src/starter/starterstroke.c b/src/starter/starterstroke.c index 6e1f1605de..3f87008502 100644 --- a/src/starter/starterstroke.c +++ b/src/starter/starterstroke.c @@ -109,6 +109,24 @@ static char* connection_name(starter_conn_t *conn) return conn->name; } +int starter_stroke_config_reload_start() +{ + stroke_msg_t msg; + + msg.type = STR_CONF_RELOAD_START; + msg.length = offsetof(stroke_msg_t, buffer); + return send_stroke_msg(&msg); +} + +int starter_stroke_config_reload_end() +{ + stroke_msg_t msg; + + msg.type = STR_CONF_RELOAD_END; + msg.length = offsetof(stroke_msg_t, buffer); + return send_stroke_msg(&msg); +} + static void starter_stroke_add_end(stroke_msg_t *msg, stroke_end_t *msg_end, starter_end_t *conn_end) { msg_end->auth = push_string(msg, conn_end->auth); diff --git a/src/starter/starterstroke.h b/src/starter/starterstroke.h index 1264863257..ddb335dafc 100644 --- a/src/starter/starterstroke.h +++ b/src/starter/starterstroke.h @@ -18,6 +18,8 @@ #include "confread.h" +int starter_stroke_config_reload_start(); +int starter_stroke_config_reload_end(); int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn); int starter_stroke_del_conn(starter_conn_t *conn); int starter_stroke_route_conn(starter_conn_t *conn);