diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-08-04 15:54:44 +0900 |
---|---|---|
committer | fujita <fujita@fujita-no-MacBook.local> | 2017-09-14 09:22:04 +0900 |
commit | bb7d2f2541d67e7c2660ab80a91cb852e49ce1fb (patch) | |
tree | 4dc594a662f997f37bf2855514978d7bb006975f /tools | |
parent | e82f1ebad2214e16960d08fe2ad85cd9422a187b (diff) |
config: Introduce Family field into AfiSafiState
To reduce the translations of "AfiSafiName" into "bgp.RouteFamily", this
patch introduces "Family" field into "AfiSafiState" and stores the
translated value.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pyang_plugins/bgpyang2golang.py | 1 | ||||
-rw-r--r-- | tools/pyang_plugins/gobgp.yang | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py index aa0e2c35..96e24d87 100644 --- a/tools/pyang_plugins/bgpyang2golang.py +++ b/tools/pyang_plugins/bgpyang2golang.py @@ -721,6 +721,7 @@ _type_translation_map = { 'yang:timeticks': 'int64', 'ptypes:install-protocol-type': 'string', 'binary': '[]byte', + 'route-family': 'bgp.RouteFamily', 'bgp-capability': 'bgp.ParameterCapabilityInterface', 'bgp-open-message': '*bgp.BGPMessage', } diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang index 46d3866f..a06a7fa2 100644 --- a/tools/pyang_plugins/gobgp.yang +++ b/tools/pyang_plugins/gobgp.yang @@ -1227,6 +1227,18 @@ module gobgp { } } + grouping afi-safi-state { + leaf family { + description + "Address family value of AFI-SAFI pair translated from afi-safi-name."; + type route-family; + } + } + + augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi/bgp:state" { + uses afi-safi-state; + } + augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi" { container route-target-membership { container config { |