diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-04-27 11:28:32 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-05-10 21:12:30 +0900 |
commit | 32f7faa8e7f83c20e50a37e44ba01a498939f574 (patch) | |
tree | 014b7755fb5cd873f2ea7bfd9ece4c9f846475ad /tools | |
parent | 0f88373949e2eed7a9dbcd1ebac64d76e54f6d40 (diff) |
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 <iwase.yusuke0@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pyang_plugins/gobgp.yang | 93 |
1 files changed, 91 insertions, 2 deletions
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 { |