From 68cd6c4585007e4bce4d91f33b8e32c9f121d8a8 Mon Sep 17 00:00:00 2001 From: Max Rottenkolber Date: Thu, 17 Nov 2022 13:19:40 +0100 Subject: [PATCH] snabb-snabbflow-v1.yang: use leafrefs where sensible --- src/lib/yang/snabb-snabbflow-v1.yang | 35 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/lib/yang/snabb-snabbflow-v1.yang b/src/lib/yang/snabb-snabbflow-v1.yang index ad6299dce1..333d1f125d 100644 --- a/src/lib/yang/snabb-snabbflow-v1.yang +++ b/src/lib/yang/snabb-snabbflow-v1.yang @@ -106,7 +106,10 @@ module snabb-snabbflow-v1 { "Sofware RSS configuration for the selected exporter."; leaf name { - type string-name; + type leafref { + path "/snabbflow-config/ipfix/exporter/name"; + require-instance true; + } description "The 'name' of an exporter defined in /snabbflow-config/ipfix/exporter."; @@ -184,7 +187,10 @@ module snabb-snabbflow-v1 { ordered-by user; leaf exporter { - type string-name; + type leafref { + path "/snabbflow-config/ipfix/exporter/name"; + require-instance true; + } description "An exporter defined in /snabbflow-config/ipfix/exporter. Packets matched by the class are processed by this exporter."; @@ -215,7 +221,10 @@ module snabb-snabbflow-v1 { any other traffic class."; leaf exporter { - type string-name; + type leafref { + path "/snabbflow-config/ipfix/exporter/name"; + require-instance true; + } description "An exporter defined in /snabbflow-config/ipfix/exporter. Flows matched by the default class are processed by this @@ -390,7 +399,7 @@ module snabb-snabbflow-v1 { type string-name; description "Identifier used to refer to the collector pool in - /snabbflow-config/ipic/exporter."; + /snabbflow-config/ipfix/exporter/collector-pool."; } list collector { @@ -436,7 +445,7 @@ module snabb-snabbflow-v1 { type string-name; description "The name used to refer to this exporter in - /snabbflow-config/rss/software-scaling."; + /snabbflow-config/rss/software-scaling/exporter/name."; } leaf-list template { @@ -447,7 +456,11 @@ module snabb-snabbflow-v1 { } leaf collector-pool { - type string; + type leafref { + path "/snabbflow-config/ipfix/collector-pool/name"; + require-instance true; + } + mandatory true; description "A collector pool defined in /snabbflow-config/ipfix/collector-pool."; } @@ -500,7 +513,9 @@ module snabb-snabbflow-v1 { "Exporter statistics."; leaf name { - type string-name; + type leafref { + path "/snabbflow-config/ipfix/exporter/name"; + } description "An exporter defined in /snabbflow-config/ipfix/exporter."; } @@ -555,7 +570,9 @@ module snabb-snabbflow-v1 { /snabbflow-config/rss/software-scaling."; leaf name { - type string-name; + type leafref { + path "/snabbflow-config/ipfix/exporter/name"; + } description "An exporter defined in /snabbflow-config/ipfix/exporter."; } @@ -589,7 +606,7 @@ module snabb-snabbflow-v1 { grouping interface-state { leaf device { - type string; + type pci-address; description "PCI address of the network device."; }