aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2016-03-28 09:03:21 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2016-04-09 16:51:02 +0200
commite9704e90cf506febf7f0806482eec607c813210b (patch)
tree08e675150019d21fbbc9f91021db6624a7ca0d79
parentc26e4330e75688415e1b1a1499851b16d2a8a8e7 (diff)
downloadstrongswan-e9704e90cf506febf7f0806482eec607c813210b.tar.bz2
strongswan-e9704e90cf506febf7f0806482eec607c813210b.tar.xz
Include manual policy priorities and restriction to interfaces in vici list-conn command
-rw-r--r--src/libcharon/plugins/vici/vici_query.c15
-rw-r--r--src/swanctl/commands/list_conns.c13
2 files changed, 27 insertions, 1 deletions
diff --git a/src/libcharon/plugins/vici/vici_query.c b/src/libcharon/plugins/vici/vici_query.c
index 3a005ea57..4bad88984 100644
--- a/src/libcharon/plugins/vici/vici_query.c
+++ b/src/libcharon/plugins/vici/vici_query.c
@@ -682,7 +682,8 @@ CALLBACK(list_conns, vici_message_t*,
peer_cfg_t *peer_cfg;
ike_cfg_t *ike_cfg;
child_cfg_t *child_cfg;
- char *ike, *str;
+ char *ike, *str, *interface;
+ uint32_t manual_prio;
linked_list_t *list;
traffic_selector_t *ts;
vici_builder_t *b;
@@ -761,6 +762,18 @@ CALLBACK(list_conns, vici_message_t*,
list->destroy_offset(list, offsetof(traffic_selector_t, destroy));
b->end_list(b /* remote-ts */);
+ interface = child_cfg->get_interface(child_cfg);
+ if (interface)
+ {
+ b->add_kv(b, "interface", "%s", interface);
+ }
+
+ manual_prio = child_cfg->get_manual_prio(child_cfg);
+ if (manual_prio)
+ {
+ b->add_kv(b, "priority", "%u", manual_prio);
+ }
+
b->end_section(b);
}
children->destroy(children);
diff --git a/src/swanctl/commands/list_conns.c b/src/swanctl/commands/list_conns.c
index 019c88888..22a5633d5 100644
--- a/src/swanctl/commands/list_conns.c
+++ b/src/swanctl/commands/list_conns.c
@@ -80,6 +80,7 @@ CALLBACK(children_sn, int,
hashtable_t *ike, vici_res_t *res, char *name)
{
hashtable_t *child;
+ char *interface, *priority;
int ret;
child = hashtable_create(hashtable_hash_str, hashtable_equals_str, 1);
@@ -89,6 +90,18 @@ CALLBACK(children_sn, int,
printf(" %s: %s\n", name, child->get(child, "mode"));
printf(" local: %s\n", child->get(child, "local-ts"));
printf(" remote: %s\n", child->get(child, "remote-ts"));
+
+ interface = child->get(child, "interface");
+ if (interface)
+ {
+ printf(" interface: %s\n", interface);
+ }
+
+ priority = child->get(child, "priority");
+ if (priority)
+ {
+ printf(" priority: %s\n", priority);
+ }
}
free_hashtable(child);
return ret;