added possibility to route CHILD_SAs, without to set them up
support for auto=route parameter support for ipsec route and ipsec unroute initiating of CHILD and/or IKE_SAs based on kernel acquires
This commit is contained in:
@@ -169,6 +169,26 @@ static int terminate_connection(char *name)
|
||||
return send_stroke_msg(&msg);
|
||||
}
|
||||
|
||||
static int route_connection(char *name)
|
||||
{
|
||||
stroke_msg_t msg;
|
||||
|
||||
msg.type = STR_ROUTE;
|
||||
msg.length = offsetof(stroke_msg_t, buffer);
|
||||
msg.route.name = push_string(&msg, name);
|
||||
return send_stroke_msg(&msg);
|
||||
}
|
||||
|
||||
static int unroute_connection(char *name)
|
||||
{
|
||||
stroke_msg_t msg;
|
||||
|
||||
msg.type = STR_UNROUTE;
|
||||
msg.length = offsetof(stroke_msg_t, buffer);
|
||||
msg.unroute.name = push_string(&msg, name);
|
||||
return send_stroke_msg(&msg);
|
||||
}
|
||||
|
||||
static int show_status(stroke_keyword_t kw, char *connection)
|
||||
{
|
||||
stroke_msg_t msg;
|
||||
@@ -336,6 +356,20 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
res = terminate_connection(argv[2]);
|
||||
break;
|
||||
case STROKE_ROUTE:
|
||||
if (argc < 3)
|
||||
{
|
||||
exit_usage("\"route\" needs a connection name");
|
||||
}
|
||||
res = route_connection(argv[2]);
|
||||
break;
|
||||
case STROKE_UNROUTE:
|
||||
if (argc < 3)
|
||||
{
|
||||
exit_usage("\"unroute\" needs a connection name");
|
||||
}
|
||||
res = unroute_connection(argv[2]);
|
||||
break;
|
||||
case STROKE_LOGTYPE:
|
||||
if (argc < 5)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user