Added a stroke rekey command to trigger IKE/CHILD_SA rekeying manually

This commit is contained in:
Martin Willi
2010-11-03 15:12:05 +01:00
parent 49a9028201
commit 851d60484e
7 changed files with 150 additions and 28 deletions
+17
View File
@@ -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)
{