diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-03-03 17:57:16 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-03 18:41:18 +0900 |
commit | 49a725a8999c1d012821b9e543793f95821663ef (patch) | |
tree | 9513612d7e81a52800930b39c9c29fa40f85c9f5 | |
parent | 542f5ef9bb2566e00ef883a7259d83e8512e63a2 (diff) |
config: make a field name same to its type name
embedding doesn't work with toml.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | config/bgp_configs.go | 140 | ||||
-rw-r--r-- | tools/pyang_plugins/bgpyang2golang.py | 2 |
2 files changed, 71 insertions, 71 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 46482cd2..afcef471 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -1,4 +1,4 @@ -// Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. +// Copyright (C) 2014,2015 Nippon Telegraph and Telephone Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -241,9 +241,9 @@ type PrefixLimit struct { //struct for container l2vpn-evpn type L2vpnEvpn struct { // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container l2vpn-vpls @@ -252,9 +252,9 @@ type L2vpnVpls struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container l3vpn-ipv6-multicast @@ -263,9 +263,9 @@ type L3vpnIpv6Multicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container l3vpn-ipv4-multicast @@ -274,9 +274,9 @@ type L3vpnIpv4Multicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container l3vpn-ipv6-unicast @@ -285,9 +285,9 @@ type L3vpnIpv6Unicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container l3vpn-ipv4-unicast @@ -296,9 +296,9 @@ type L3vpnIpv4Unicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container ipv6-labelled-unicast @@ -307,9 +307,9 @@ type Ipv6LabelledUnicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container ipv4-labelled-unicast @@ -318,9 +318,9 @@ type Ipv4LabelledUnicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container ipv6-multicast @@ -329,9 +329,9 @@ type Ipv6Multicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container ipv4-multicast @@ -340,9 +340,9 @@ type Ipv4Multicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit } //struct for container ipv6-unicast @@ -351,9 +351,9 @@ type Ipv6Unicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit // original -> bgp-mp:send-default-route //send-default-route's original type is boolean SendDefaultRoute bool @@ -365,9 +365,9 @@ type Ipv4Unicast struct { //enabled's original type is boolean Enabled bool // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit - PrefixLimit + PrefixLimit PrefixLimit // original -> bgp-mp:send-default-route //send-default-route's original type is boolean SendDefaultRoute bool @@ -378,29 +378,29 @@ type AfiSafi struct { // original -> bgp-mp:afi-safi-name AfiSafiName string // original -> bgp-mp:ipv4-unicast - Ipv4Unicast + Ipv4Unicast Ipv4Unicast // original -> bgp-mp:ipv6-unicast - Ipv6Unicast + Ipv6Unicast Ipv6Unicast // original -> bgp-mp:ipv4-multicast - Ipv4Multicast + Ipv4Multicast Ipv4Multicast // original -> bgp-mp:ipv6-multicast - Ipv6Multicast + Ipv6Multicast Ipv6Multicast // original -> bgp-mp:ipv4-labelled-unicast - Ipv4LabelledUnicast + Ipv4LabelledUnicast Ipv4LabelledUnicast // original -> bgp-mp:ipv6-labelled-unicast - Ipv6LabelledUnicast + Ipv6LabelledUnicast Ipv6LabelledUnicast // original -> bgp-mp:l3vpn-ipv4-unicast - L3vpnIpv4Unicast + L3vpnIpv4Unicast L3vpnIpv4Unicast // original -> bgp-mp:l3vpn-ipv6-unicast - L3vpnIpv6Unicast + L3vpnIpv6Unicast L3vpnIpv6Unicast // original -> bgp-mp:l3vpn-ipv4-multicast - L3vpnIpv4Multicast + L3vpnIpv4Multicast L3vpnIpv4Multicast // original -> bgp-mp:l3vpn-ipv6-multicast - L3vpnIpv6Multicast + L3vpnIpv6Multicast L3vpnIpv6Multicast // original -> bgp-mp:l2vpn-vpls - L2vpnVpls + L2vpnVpls L2vpnVpls // original -> bgp-mp:l2vpn-evpn - L2vpnEvpn + L2vpnEvpn L2vpnEvpn } //struct for container graceful-restart @@ -423,9 +423,9 @@ type Neighbor struct { // original -> bgp:description Description string // original -> bgp:graceful-restart - GracefulRestart + GracefulRestart GracefulRestart // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:afi-safi AfiSafiList []AfiSafi // original -> bgp:auth-password @@ -433,19 +433,19 @@ type Neighbor struct { // original -> bgp:peer-type PeerType PeerTypeDef // original -> bgp:timers - Timers + Timers Timers // original -> bgp:ebgp-multihop - EbgpMultihop + EbgpMultihop EbgpMultihop // original -> bgp:route-reflector - RouteReflector + RouteReflector RouteReflector // original -> bgp:route-server - RouteServer + RouteServer RouteServer // original -> bgp:remove-private-as RemovePrivateAs RemovePrivateAsOption // original -> bgp:bgp-logging-options - BgpLoggingOptions + BgpLoggingOptions BgpLoggingOptions // original -> bgp:transport-options - TransportOptions + TransportOptions TransportOptions // original -> bgp:local-address //local-address's original type is inet:ip-address LocalAddress net.IP @@ -455,13 +455,13 @@ type Neighbor struct { // original -> bgp:send-community SendCommunity CommunityType // original -> bgp:error-handling - ErrorHandling + ErrorHandling ErrorHandling // original -> bgp:as-path-options - AsPathOptions + AsPathOptions AsPathOptions // original -> bgp:add-paths - AddPaths + AddPaths AddPaths // original -> bgp-op:bgp-neighbor-common-state - BgpNeighborCommonState + BgpNeighborCommonState BgpNeighborCommonState } //struct for container ibgp @@ -482,9 +482,9 @@ type Ebgp struct { //struct for container use-multiple-paths type UseMultiplePaths struct { // original -> bgp-mp:ebgp - Ebgp + Ebgp Ebgp // original -> bgp-mp:ibgp - Ibgp + Ibgp Ibgp } //struct for container bgp-group-common-state @@ -496,13 +496,13 @@ type PeerGroup struct { // original -> bgp:group-name GroupName string // original -> bgp-op:bgp-group-common-state - BgpGroupCommonState + BgpGroupCommonState BgpGroupCommonState // original -> bgp:description Description string // original -> bgp:graceful-restart - GracefulRestart + GracefulRestart GracefulRestart // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy // original -> bgp-mp:afi-safi AfiSafiList []AfiSafi // original -> bgp:auth-password @@ -510,19 +510,19 @@ type PeerGroup struct { // original -> bgp:peer-type PeerType PeerTypeDef // original -> bgp:timers - Timers + Timers Timers // original -> bgp:ebgp-multihop - EbgpMultihop + EbgpMultihop EbgpMultihop // original -> bgp:route-reflector - RouteReflector + RouteReflector RouteReflector // original -> bgp:route-server - RouteServer + RouteServer RouteServer // original -> bgp:remove-private-as RemovePrivateAs RemovePrivateAsOption // original -> bgp:bgp-logging-options - BgpLoggingOptions + BgpLoggingOptions BgpLoggingOptions // original -> bgp:transport-options - TransportOptions + TransportOptions TransportOptions // original -> bgp:local-address //local-address's original type is inet:ip-address LocalAddress net.IP @@ -532,13 +532,13 @@ type PeerGroup struct { // original -> bgp:send-community SendCommunity CommunityType // original -> bgp:error-handling - ErrorHandling + ErrorHandling ErrorHandling // original -> bgp:as-path-options - AsPathOptions + AsPathOptions AsPathOptions // original -> bgp:add-paths - AddPaths + AddPaths AddPaths // original -> bgp-mp:use-multiple-paths - UseMultiplePaths + UseMultiplePaths UseMultiplePaths // original -> bgp:neighbor NeighborList []Neighbor } @@ -596,25 +596,25 @@ type Global struct { //router-id's original type is inet:ipv4-address RouterId net.IP // original -> bgp:default-route-distance - DefaultRouteDistance + DefaultRouteDistance DefaultRouteDistance // original -> bgp:confederation - Confederation + Confederation Confederation // original -> bgp-mp:use-multiple-paths - UseMultiplePaths + UseMultiplePaths UseMultiplePaths // original -> bgp-mp:afi-safi AfiSafiList []AfiSafi // original -> bgp-op:bgp-global-state - BgpGlobalState + BgpGlobalState BgpGlobalState } //struct for container bgp type Bgp struct { // original -> bgp:global - Global + Global Global // original -> bgp:peer-group PeerGroupList []PeerGroup // original -> bgp:neighbor NeighborList []Neighbor // original -> rpol:apply-policy - ApplyPolicy + ApplyPolicy ApplyPolicy } diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py index ee81c311..03b274c1 100644 --- a/tools/pyang_plugins/bgpyang2golang.py +++ b/tools/pyang_plugins/bgpyang2golang.py @@ -169,7 +169,7 @@ def emit_class_def(ctx, c, struct_name): emit_type_name = '[]' + t.golang_name if is_container(child): - print >> o, ' %s' % emit_type_name + print >> o, ' %s\t%s' % (emit_type_name, emit_type_name) else: print >> o, ' %s\t%s' % (val_name_go, emit_type_name) |