diff options
author | Martin Willi <martin@revosec.ch> | 2010-11-03 15:12:05 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2010-11-03 15:12:05 +0100 |
commit | 851d60484ea9f3d61d133fbd0eecea7eff015b3c (patch) | |
tree | a7e50781153f2dcdba9da42dcbf816c9d247153f /src/stroke/stroke.c | |
parent | 49a9028201f3d2be9b3b7e640eae5de65ce9b5cd (diff) | |
download | strongswan-851d60484ea9f3d61d133fbd0eecea7eff015b3c.tar.bz2 strongswan-851d60484ea9f3d61d133fbd0eecea7eff015b3c.tar.xz |
Added a stroke rekey command to trigger IKE/CHILD_SA rekeying manually
Diffstat (limited to 'src/stroke/stroke.c')
-rw-r--r-- | src/stroke/stroke.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c index 103617f08..7c27e124a 100644 --- a/src/stroke/stroke.c +++ b/src/stroke/stroke.c @@ -197,6 +197,16 @@ static int terminate_connection_srcip(char *start, char *end) return send_stroke_msg(&msg); } +static int rekey_connection(char *name) +{ + stroke_msg_t msg; + + msg.type = STR_REKEY; + msg.length = offsetof(stroke_msg_t, buffer); + msg.rekey.name = push_string(&msg, name); + return send_stroke_msg(&msg); +} + static int route_connection(char *name) { stroke_msg_t msg; @@ -443,6 +453,13 @@ int main(int argc, char *argv[]) } res = terminate_connection_srcip(argv[2], argc > 3 ? argv[3] : NULL); break; + case STROKE_REKEY: + if (argc < 3) + { + exit_usage("\"rekey\" needs a connection name"); + } + res = rekey_connection(argv[2]); + break; case STROKE_ROUTE: if (argc < 3) { |