diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-10 05:08:24 +0000 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-14 02:15:35 +0000 |
commit | 926ab34220431de2561c17269d473f8fc8f33217 (patch) | |
tree | 1b3caab92f0a59adc3c8acebe4b8a31626ec8152 /tools/pyang_plugins/bgpyang2golang.py | |
parent | d23cea2d7c95b0d6683fbd80abcdb65e303816a4 (diff) |
config: use struct type instead of []byte for capability and open msg
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'tools/pyang_plugins/bgpyang2golang.py')
-rw-r--r-- | tools/pyang_plugins/bgpyang2golang.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py index 9f131df0..5be6569f 100644 --- a/tools/pyang_plugins/bgpyang2golang.py +++ b/tools/pyang_plugins/bgpyang2golang.py @@ -665,6 +665,8 @@ _type_translation_map = { 'yang:timeticks': 'int64', 'ptypes:install-protocol-type': 'string', 'binary': '[]byte', + 'bgp-capability': 'bgp.ParameterCapabilityInterface', + 'bgp-open-message': '*bgp.BGPMessage', } @@ -690,7 +692,9 @@ _path_exclude = ["/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol "/rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/bgp-pol:ext-community-set/bgp-pol:ext-community-member", "/rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/bgp-pol:as-path-set-member"] -_typedef_exclude =[] +_typedef_exclude =["/gobgp:bgp-capability", + "/gobgp:bgp-open-message"] + def generate_header(ctx): print _COPYRIGHT_NOTICE @@ -698,7 +702,8 @@ def generate_header(ctx): print '' print 'import (' print '"fmt"' - print '"bytes"' + print '' + print '"github.com/osrg/gobgp/packet/bgp"' print ')' print '' |