From a760dfb253161911fc3aa3c8b879c461d53ade6e Mon Sep 17 00:00:00 2001 From: YohanPipereau Date: Wed, 6 Mar 2019 14:01:58 +0100 Subject: Sweetcomb global cleanup -Merge IETF and Openconfig to use SCVPP 2 -Move L2 bridge from sc_vpp_interface to sc_vpp_v3po -Implement tav2 dump -Make openconfig-interfaces functions static -Try one more dispatch after failure in VAPI_CALL -Add error return code for scvpp -Remove unused length maccros -Return appropriate error code for interface dump when interface not found -Improve scvpp test suite -Change get_interface_id prototype -Use interface_dump_iface in openconfig_interface. -No more vapi types in openconfig_interfaces.c -Move openconfig_local_routing VAPI operations to sc_vpp_ip -Implement a multiple dump with a stack data structure -Comment out state_cb code from openconfig_local_routing to use new functions later. -Rename YANG model to their fully qualified name : @ -Remove headers almost empty and put registration declaration in sc_model.h -Shorten vapi context global variable name -Reorganize scvpp unit test suite -Add instructions to Makefile to install/uninstall YANG models in sysrepo. -Add this new instructions to README.md. -Reimplement interface_dump_all -Use a common message at INFO Log Level to know when sysrepo callbacks are triggered -Remove old structure to perform dump of all interfaces -Reimplement get_interface_name and add scvpp test for it -Clean sys_util -Use UNUSED maccro everywhere to have lighter prototypes -Have ietf-interfaces:interfaces-state work with new dump function -Add setup and teardown for NAT tests -Remove unused tapv2 dump -Remove useless sysrepo module callback -Remove xpath_find_first_key usage in openconfig-interfaces -Remove xpath_find_first_key in oc_local_routing and in the rest of sweetcomb -Reorganize scvpp include dir and fix scvpp_test new warnings -Fix scvpp tests for ip routes -Factorize scvpp nat and test return code of its function -Correct test_dump_if_all if there is an existing hardware interface -Implement a per-prefix dump in scvpp -free changes iterator in ietf-interfaces -Add new XPATH in oc local-routing -Introduce helper methods for sysrepo config callbacks -Factorize config callback -Refactor the openconfig-local-routing config callback -Use common foreach_change to iterate over changes in all models -Create a sample directory gathering example of configurations supposed to work with sweetcomb -Fix state callback of oc-local-routing -Add new sample for get operation on next-hop -foreach_elt maccro condition forgets to read one element Change-Id: I8e87fce577a00337977588f057a6e095a20f457c Signed-off-by: YohanPipereau --- samples/ietf-interfaces/set-ip.xml | 18 ++++++++++ samples/openconfig-interfaces/get-iface.xpath | 1 + samples/openconfig-interfaces/get-subiface.xpath | 1 + samples/openconfig-interfaces/set-enable.xml | 15 ++++++++ samples/openconfig-interfaces/set-ip.xml | 36 +++++++++++++++++++ .../add_route_with_iface.xml | 41 ++++++++++++++++++++++ .../add_route_with_nhop.xml | 20 +++++++++++ .../get-prefix-nhop-interface.xpath | 2 ++ .../openconfig-local-routing/get-prefix-nhop.xpath | 1 + samples/openconfig-local-routing/get-prefix.xpath | 1 + 10 files changed, 136 insertions(+) create mode 100644 samples/ietf-interfaces/set-ip.xml create mode 100644 samples/openconfig-interfaces/get-iface.xpath create mode 100644 samples/openconfig-interfaces/get-subiface.xpath create mode 100644 samples/openconfig-interfaces/set-enable.xml create mode 100644 samples/openconfig-interfaces/set-ip.xml create mode 100644 samples/openconfig-local-routing/add_route_with_iface.xml create mode 100644 samples/openconfig-local-routing/add_route_with_nhop.xml create mode 100644 samples/openconfig-local-routing/get-prefix-nhop-interface.xpath create mode 100644 samples/openconfig-local-routing/get-prefix-nhop.xpath create mode 100644 samples/openconfig-local-routing/get-prefix.xpath (limited to 'samples') diff --git a/samples/ietf-interfaces/set-ip.xml b/samples/ietf-interfaces/set-ip.xml new file mode 100644 index 0000000..2d8f1e2 --- /dev/null +++ b/samples/ietf-interfaces/set-ip.xml @@ -0,0 +1,18 @@ + + + + local0 + eth0 + ianaift:ethernetCsmacd + + true + 1514 +
+ 192.168.50.72 + 24 +
+
+ true +
+
+ diff --git a/samples/openconfig-interfaces/get-iface.xpath b/samples/openconfig-interfaces/get-iface.xpath new file mode 100644 index 0000000..bc829f6 --- /dev/null +++ b/samples/openconfig-interfaces/get-iface.xpath @@ -0,0 +1 @@ +get --filter-xpath /openconfig-interfaces:interfaces/interface[name="tap0"]/state diff --git a/samples/openconfig-interfaces/get-subiface.xpath b/samples/openconfig-interfaces/get-subiface.xpath new file mode 100644 index 0000000..e38de57 --- /dev/null +++ b/samples/openconfig-interfaces/get-subiface.xpath @@ -0,0 +1 @@ +get --filter-xpath /openconfig-interfaces:interfaces/interface[name="tap0"]/subinterfaces/* diff --git a/samples/openconfig-interfaces/set-enable.xml b/samples/openconfig-interfaces/set-enable.xml new file mode 100644 index 0000000..dc60769 --- /dev/null +++ b/samples/openconfig-interfaces/set-enable.xml @@ -0,0 +1,15 @@ + + + + GigabitEthernet0/9/0 + + GigabitEthernet0/9/0 + ianaift:ethernetCsmacd + 1501 + true + openconfig + true + + + + diff --git a/samples/openconfig-interfaces/set-ip.xml b/samples/openconfig-interfaces/set-ip.xml new file mode 100644 index 0000000..80b368c --- /dev/null +++ b/samples/openconfig-interfaces/set-ip.xml @@ -0,0 +1,36 @@ + + + + tap0 + + tap0 + ianaift:ethernetCsmacd + 1501 + true + openconfig + true + + + + 0 + + +
+ 192.168.0.2 + + 192.168.0.2 + 24 + +
+
+
+ + 0 + openconfig + true + +
+
+
+
+ diff --git a/samples/openconfig-local-routing/add_route_with_iface.xml b/samples/openconfig-local-routing/add_route_with_iface.xml new file mode 100644 index 0000000..378a927 --- /dev/null +++ b/samples/openconfig-local-routing/add_route_with_iface.xml @@ -0,0 +1,41 @@ + + + + GigabitEthernet0/9/0 + + GigabitEthernet0/9/0 + ianaift:ethernetCsmacd + 1501 + true + openconfig + true + + + + + + + + + + 10.0.0.0/24 + + 10.0.0.0/24 + + + + 0 + + 0 + 10.0.0.1 + + + + GigabitEthernet0/9/0 + + + + + + + diff --git a/samples/openconfig-local-routing/add_route_with_nhop.xml b/samples/openconfig-local-routing/add_route_with_nhop.xml new file mode 100644 index 0000000..8089c4d --- /dev/null +++ b/samples/openconfig-local-routing/add_route_with_nhop.xml @@ -0,0 +1,20 @@ + + + + + 10.0.0.2/24 + + 10.0.0.2/24 + + + + 0 + + 0 + 10.0.0.1 + + + + + + diff --git a/samples/openconfig-local-routing/get-prefix-nhop-interface.xpath b/samples/openconfig-local-routing/get-prefix-nhop-interface.xpath new file mode 100644 index 0000000..68c96ca --- /dev/null +++ b/samples/openconfig-local-routing/get-prefix-nhop-interface.xpath @@ -0,0 +1,2 @@ +get --filter-xpath /openconfig-local-routing:local-routes/static-routes/static[prefix="10.0.0.0/24"]/next-hops/next-hop[index="0"]/interface-ref/state + diff --git a/samples/openconfig-local-routing/get-prefix-nhop.xpath b/samples/openconfig-local-routing/get-prefix-nhop.xpath new file mode 100644 index 0000000..4e161da --- /dev/null +++ b/samples/openconfig-local-routing/get-prefix-nhop.xpath @@ -0,0 +1 @@ +get --filter-xpath /openconfig-local-routing:local-routes/static-routes/static[prefix="10.0.0.0/24"]/next-hops/next-hop[index="0"]/state diff --git a/samples/openconfig-local-routing/get-prefix.xpath b/samples/openconfig-local-routing/get-prefix.xpath new file mode 100644 index 0000000..936442b --- /dev/null +++ b/samples/openconfig-local-routing/get-prefix.xpath @@ -0,0 +1 @@ +get --filter-xpath /openconfig-local-routing:local-routes/static-routes/static[prefix="10.0.0.0/24"]/state -- cgit 1.2.3-korg