mark-mask-out = <hex encoded outbound Netfilter mark mask>
if-id-in = <hex encoded inbound XFRM interface ID>
if-id-out = <hex encoded outbound XFRM interface ID>
+ label = <hex encoded security label>
encr-alg = <ESP encryption algorithm name, if any>
encr-keysize = <ESP encryption key size, if applicable>
integ-alg = <ESP or AH integrity algorithm name, if any>
child = <CHILD_SA configuration name>
ike = <IKE_SA configuration name or namespace, if available>
mode = <policy mode, tunnel|transport|pass|drop>
+ label = <hex encoded security label>
local-ts = [
<list of local traffic selectors>
]
children = {
<CHILD_SA config name>* = {
mode = <IPsec mode>
+ label = <hex encoded security label>
rekey_time = <CHILD_SA rekeying interval in seconds>
rekey_bytes = <CHILD_SA rekeying interval in bytes>
rekey_packets = <CHILD_SA rekeying interval in packets>
}
}
+/**
+ * List the security label of a CHILD_SA or config
+ */
+static void list_label(vici_builder_t *b, child_sa_t *child, child_cfg_t *cfg)
+{
+ sec_label_t *label = NULL;
+ chunk_t enc;
+
+ if (child)
+ {
+ label = child->get_label(child);
+ }
+ else if (cfg)
+ {
+ label = cfg->get_label(cfg);
+ }
+ if (label)
+ {
+ enc = label->get_encoding(label);
+ b->add_kv(b, "label", "%+B", &enc);
+ }
+}
+
/**
* List IPsec-related details about a CHILD_SA
*/
state = child->get_state(child);
b->add_kv(b, "state", "%N", child_sa_state_names, state);
list_mode(b, child, NULL);
+ list_label(b, child, NULL);
switch (state)
{
b->add_kv(b, "ike", "%s", ike);
list_mode(b, child, NULL);
+ list_label(b, child, NULL);
b->begin_list(b, "local-ts");
enumerator = child->create_ts_enumerator(child, TRUE);
}
list_mode(b, NULL, cfg);
+ list_label(b, NULL, cfg);
b->begin_list(b, "local-ts");
list = cfg->get_traffic_selectors(cfg, TRUE, NULL, NULL, FALSE);
b->begin_section(b, child_cfg->get_name(child_cfg));
list_mode(b, NULL, child_cfg);
+ list_label(b, NULL, child_cfg);
lft = child_cfg->get_lifetime(child_cfg, FALSE);
b->add_kv(b, "rekey_time", "%"PRIu64, lft->time.rekey);