Added a stroke rekey command to trigger IKE/CHILD_SA rekeying manually
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user