vici_res_t *res;
bool noblock = FALSE;
command_format_options_t format = COMMAND_FORMAT_NONE;
- char *arg, *ike = NULL;
- int ike_id = 0, ret;
+ char *arg, *ike = NULL, *child = NULL;
+ int ike_id = 0, child_id = 0, ret;
while (TRUE)
{
case 'I':
ike_id = atoi(arg);
continue;
+ case 'c':
+ child = arg;
+ continue;
+ case 'C':
+ child_id = atoi(arg);
+ continue;
case 'n':
noblock = TRUE;
continue;
{
vici_add_key_valuef(req, "ike-id", "%d", ike_id);
}
+ if (child)
+ {
+ vici_add_key_valuef(req, "child", "%s", child);
+ }
+ if (child_id)
+ {
+ vici_add_key_valuef(req, "child-id", "%d", child_id);
+ }
if (noblock)
{
vici_add_key_valuef(req, "noblock", "yes");
{
command_register((command_t) {
list_sas, 'l', "list-sas", "list currently active IKE_SAs",
- {"[--raw|--pretty]"},
+ {"[--ike <name>|--ike-id <id>] [--child <name>|--child-id <id>]",
+ "[--raw|--pretty]"},
{
{"help", 'h', 0, "show usage information"},
{"ike", 'i', 1, "filter IKE_SAs by name"},
{"ike-id", 'I', 1, "filter IKE_SAs by unique identifier"},
+ {"child", 'c', 1, "filter CHILD_SAs by name"},
+ {"child-id", 'C', 1, "filter CHILD_SAs by unique identifier"},
{"noblock", 'n', 0, "don't wait for IKE_SAs in use"},
{"raw", 'r', 0, "dump raw response message"},
{"pretty", 'P', 0, "dump raw response message in pretty print"},
{"help", 'h', 0, "show usage information"},
{"child", 'c', 1, "terminate by CHILD_SA name"},
{"ike", 'i', 1, "terminate by IKE_SA name"},
- {"child-id", 'C', 1, "terminate by CHILD_SA reqid"},
+ {"child-id", 'C', 1, "terminate by CHILD_SA unique identifier"},
{"ike-id", 'I', 1, "terminate by IKE_SA unique identifier"},
{"force", 'f', 0, "terminate IKE_SA without waiting, unless timeout is set"},
{"timeout", 't', 1, "timeout in seconds before detaching"},