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:
Martin Willi
2006-07-21 13:31:53 +00:00
parent c0593835f4
commit 45f76a7ddd
26 changed files with 1011 additions and 142 deletions
+34
View File
@@ -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)
{