From 32f7faa8e7f83c20e50a37e44ba01a498939f574 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Fri, 27 Apr 2018 11:28:32 +0900 Subject: config: Enable to configure VRF via config file This patch enables to configure VRF tables by using config file. This feature is useful when using VRF-Neighbor feature. Example of Usage: ```toml [[vrfs]] [vrfs.config] name = "vrf1" id = 1 rd = "65000:100" both-rt-list = ["65000:100"] ``` Signed-off-by: IWASE Yusuke --- tools/pyang_plugins/gobgp.yang | 93 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang index 9022d680..053ef0a0 100644 --- a/tools/pyang_plugins/gobgp.yang +++ b/tools/pyang_plugins/gobgp.yang @@ -618,6 +618,90 @@ module gobgp { } } } + grouping gobgp-vrf-common { + description + "Common parameters for VRF configuration and state."; + + leaf name { + description + "Unique name among all VRF instances."; + type string; + } + + leaf id { + description + "Unique identifier among all VRF instances."; + type uint32; + } + + leaf rd { + description + "Route Distinguisher for this VRF."; + type string; + } + + leaf-list import-rt { + description + "List of import Route Targets for this VRF."; + type string; + } + + leaf-list export-rt { + description + "List of export Route Targets for this VRF."; + type string; + } + } + + grouping gobgp-vrf-config { + description + "Configuration parameters for VRF."; + + leaf-list both-rt { + description + "List of both import and export Route Targets for this VRF. Each + configuration for import and export Route Targets will be preferred."; + type string; + } + } + + grouping gobgp-vrf-set { + description "Set of VRF instance configuration and state"; + + container config { + description + "Configuration parameters for VRF."; + uses gobgp-vrf-common; + uses gobgp-vrf-config; + } + + container state { + description + "Configured states of VRF."; + uses gobgp-vrf-common; + } + } + + grouping gobgp-vrfs { + description + "Virtual Routing and Forwarding (VRF) instances."; + + container vrfs { + list vrf { + description + "VRF instance configurations on the local system."; + + key "name"; + leaf name { + type leafref { + path "../config/name"; + } + } + + uses gobgp-vrf-set; + } + } + } grouping long-lived-graceful-restart { container long-lived-graceful-restart { @@ -1025,15 +1109,20 @@ module gobgp { } augment "/bgp:bgp" { - description "additional rpki configuration and state"; + description "Additional RPKI configuration and state"; uses gobgp-rpki-servers; } augment "/bgp:bgp" { - description "additional bmp configuration"; + description "Additional BMP configuration and state"; uses gobgp-bmp-servers; } + augment "/bgp:bgp" { + description "Additional VRF configuration and state"; + uses gobgp-vrfs; + } + typedef mrt-type { type enumeration { enum UPDATES { -- cgit v1.2.3