diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-08-11 11:50:37 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-08-11 16:52:46 +0900 |
commit | 19dd57ff210cd166e02688aa9522a6ae68c30dc3 (patch) | |
tree | edf210afe80192cf0e843b5261a048bcc960fe2c | |
parent | b88ac60d37caf91057e032fe32f6e6f09680521e (diff) |
config: insert gobgp-specific elements with augment statements defined in gobgp.yang
-rw-r--r-- | config/bgp_configs.go | 180 | ||||
-rw-r--r-- | tools/pyang_plugins/README.rst | 1 | ||||
-rw-r--r-- | tools/pyang_plugins/bgpyang2golang.py | 36 | ||||
-rw-r--r-- | tools/pyang_plugins/gobgp.yang | 343 |
4 files changed, 468 insertions, 92 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index bbc5edbd..62809af1 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -66,15 +66,6 @@ const ( BGP_SESSION_DIRECTION_OUTBOUND ) -// typedef for typedef bgp-types:bgp-origin-attr-type -type BgpOriginAttrType int - -const ( - BGP_ORIGIN_ATTR_TYPE_IGP BgpOriginAttrType = 0 - BGP_ORIGIN_ATTR_TYPE_EGP = 1 - BGP_ORIGIN_ATTR_TYPE_INCOMPLETE = 2 -) - // typedef for typedef ptypes:match-set-options-restricted-type type MatchSetOptionsRestrictedType int @@ -121,6 +112,15 @@ const ( BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE ) +// typedef for typedef gobgp:bgp-origin-attr-type +type BgpOriginAttrType int + +const ( + BGP_ORIGIN_ATTR_TYPE_IGP BgpOriginAttrType = 0 + BGP_ORIGIN_ATTR_TYPE_EGP = 1 + BGP_ORIGIN_ATTR_TYPE_INCOMPLETE = 2 +) + //struct for container bgp:state type PeerGroupState struct { // original -> bgp:peer-as @@ -195,8 +195,6 @@ type PeerGroup struct { EbgpMultihop EbgpMultihop // original -> bgp:route-reflector RouteReflector RouteReflector - // original -> bgp:route-server - RouteServer RouteServer // original -> bgp:as-path-options AsPathOptions AsPathOptions // original -> bgp:add-paths @@ -209,6 +207,8 @@ type PeerGroup struct { ApplyPolicy ApplyPolicy // original -> bgp-mp:use-multiple-paths UseMultiplePaths UseMultiplePaths + // original -> gobgp:route-server + RouteServer RouteServer } //struct for container bgp:peer-groups @@ -217,6 +217,28 @@ type PeerGroups struct { PeerGroupList []PeerGroup } +//struct for container gobgp:state +type RouteServerState struct { + // original -> gobgp:route-server-client + //gobgp:route-server-client's original type is boolean + RouteServerClient bool +} + +//struct for container gobgp:config +type RouteServerConfig struct { + // original -> gobgp:route-server-client + //gobgp:route-server-client's original type is boolean + RouteServerClient bool +} + +//struct for container gobgp:route-server +type RouteServer struct { + // original -> gobgp:route-server-config + RouteServerConfig RouteServerConfig + // original -> gobgp:route-server-state + RouteServerState RouteServerState +} + //struct for container bgp-op:prefixes type Prefixes struct { // original -> bgp-op:received @@ -280,28 +302,6 @@ type AsPathOptions struct { } //struct for container bgp:state -type RouteServerState struct { - // original -> bgp:route-server-client - //bgp:route-server-client's original type is boolean - RouteServerClient bool -} - -//struct for container bgp:config -type RouteServerConfig struct { - // original -> bgp:route-server-client - //bgp:route-server-client's original type is boolean - RouteServerClient bool -} - -//struct for container bgp:route-server -type RouteServer struct { - // original -> bgp:route-server-config - RouteServerConfig RouteServerConfig - // original -> bgp:route-server-state - RouteServerState RouteServerState -} - -//struct for container bgp:state type RouteReflectorState struct { // original -> bgp:route-reflector-cluster-id RouteReflectorClusterId RrClusterIdType @@ -409,9 +409,6 @@ type TransportState struct { // original -> bgp:passive-mode //bgp:passive-mode's original type is boolean PassiveMode bool - // original -> bgp:local-address - //bgp:local-address's original type is inet:ip-address - LocalAddress net.IP // original -> bgp-op:local-port //bgp-op:local-port's original type is inet:port-number LocalPort uint16 @@ -421,6 +418,9 @@ type TransportState struct { // original -> bgp-op:remote-port //bgp-op:remote-port's original type is inet:port-number RemotePort uint16 + // original -> gobgp:local-address + //gobgp:local-address's original type is inet:ip-address + LocalAddress net.IP } //struct for container bgp:config @@ -433,8 +433,8 @@ type TransportConfig struct { // original -> bgp:passive-mode //bgp:passive-mode's original type is boolean PassiveMode bool - // original -> bgp:local-address - //bgp:local-address's original type is inet:ip-address + // original -> gobgp:local-address + //gobgp:local-address's original type is inet:ip-address LocalAddress net.IP } @@ -457,23 +457,23 @@ type TimersState struct { // original -> bgp:keepalive-interval //bgp:keepalive-interval's original type is decimal64 KeepaliveInterval float64 - // original -> bgp:idle-hold-time-after-reset - //bgp:idle-hold-time-after-reset's original type is decimal64 - IdleHoldTimeAfterReset float64 // original -> bgp:minimum-advertisement-interval //bgp:minimum-advertisement-interval's original type is decimal64 MinimumAdvertisementInterval float64 // original -> bgp-op:uptime //bgp-op:uptime's original type is yang:timeticks Uptime int64 - // original -> bgp-op:downtime - //bgp-op:downtime's original type is yang:timeticks - Downtime int64 - // original -> bgp-op:update-recv-time - UpdateRecvTime int64 // original -> bgp-op:negotiated-hold-time //bgp-op:negotiated-hold-time's original type is decimal64 NegotiatedHoldTime float64 + // original -> gobgp:idle-hold-time-after-reset + //gobgp:idle-hold-time-after-reset's original type is decimal64 + IdleHoldTimeAfterReset float64 + // original -> gobgp:downtime + //gobgp:downtime's original type is yang:timeticks + Downtime int64 + // original -> gobgp:update-recv-time + UpdateRecvTime int64 } //struct for container bgp:config @@ -487,12 +487,12 @@ type TimersConfig struct { // original -> bgp:keepalive-interval //bgp:keepalive-interval's original type is decimal64 KeepaliveInterval float64 - // original -> bgp:idle-hold-time-after-reset - //bgp:idle-hold-time-after-reset's original type is decimal64 - IdleHoldTimeAfterReset float64 // original -> bgp:minimum-advertisement-interval //bgp:minimum-advertisement-interval's original type is decimal64 MinimumAdvertisementInterval float64 + // original -> gobgp:idle-hold-time-after-reset + //gobgp:idle-hold-time-after-reset's original type is decimal64 + IdleHoldTimeAfterReset float64 } //struct for container bgp:timers @@ -517,17 +517,17 @@ type Received struct { Update uint64 // original -> bgp-op:NOTIFICATION Notification uint64 - // original -> bgp-op:OPEN + // original -> gobgp:OPEN Open uint64 - // original -> bgp-op:REFRESH + // original -> gobgp:REFRESH Refresh uint64 - // original -> bgp-op:KEEPALIVE + // original -> gobgp:KEEPALIVE Keepalive uint64 - // original -> bgp-op:DYNAMIC-CAP + // original -> gobgp:DYNAMIC-CAP DynamicCap uint64 - // original -> bgp-op:DISCARDED + // original -> gobgp:DISCARDED Discarded uint64 - // original -> bgp-op:TOTAL + // original -> gobgp:TOTAL Total uint64 } @@ -537,17 +537,17 @@ type Sent struct { Update uint64 // original -> bgp-op:NOTIFICATION Notification uint64 - // original -> bgp-op:OPEN + // original -> gobgp:OPEN Open uint64 - // original -> bgp-op:REFRESH + // original -> gobgp:REFRESH Refresh uint64 - // original -> bgp-op:KEEPALIVE + // original -> gobgp:KEEPALIVE Keepalive uint64 - // original -> bgp-op:DYNAMIC-CAP + // original -> gobgp:DYNAMIC-CAP DynamicCap uint64 - // original -> bgp-op:DISCARDED + // original -> gobgp:DISCARDED Discarded uint64 - // original -> bgp-op:TOTAL + // original -> gobgp:TOTAL Total uint64 } @@ -591,17 +591,17 @@ type NeighborState struct { // original -> bgp-op:supported-capabilities //original type is list of identityref SupportedCapabilities []string - // original -> bgp-op:established-count - EstablishedCount uint32 - // original -> bgp-op:flops - Flops uint32 // original -> bgp:messages Messages Messages // original -> bgp:queues Queues Queues - // original -> bgp:admin-down - //bgp:admin-down's original type is boolean + // original -> gobgp:admin-down + //gobgp:admin-down's original type is boolean AdminDown bool + // original -> gobgp:established-count + EstablishedCount uint32 + // original -> gobgp:flops + Flops uint32 } //struct for container bgp:config @@ -653,8 +653,6 @@ type Neighbor struct { EbgpMultihop EbgpMultihop // original -> bgp:route-reflector RouteReflector RouteReflector - // original -> bgp:route-server - RouteServer RouteServer // original -> bgp:as-path-options AsPathOptions AsPathOptions // original -> bgp:add-paths @@ -667,6 +665,8 @@ type Neighbor struct { ApplyPolicy ApplyPolicy // original -> bgp-mp:use-multiple-paths UseMultiplePaths UseMultiplePaths + // original -> gobgp:route-server + RouteServer RouteServer } //struct for container bgp:neighbors @@ -811,9 +811,9 @@ type ApplyPolicyState struct { ExportPolicy []string // original -> rpol:default-export-policy DefaultExportPolicy DefaultPolicyType - // original -> rpol:in-policy + // original -> gobgp:in-policy InPolicy []string - // original -> rpol:default-in-policy + // original -> gobgp:default-in-policy DefaultInPolicy DefaultPolicyType } @@ -827,9 +827,9 @@ type ApplyPolicyConfig struct { ExportPolicy []string // original -> rpol:default-export-policy DefaultExportPolicy DefaultPolicyType - // original -> rpol:in-policy + // original -> gobgp:in-policy InPolicy []string - // original -> rpol:default-in-policy + // original -> gobgp:default-in-policy DefaultInPolicy DefaultPolicyType } @@ -1261,11 +1261,11 @@ type SetCommunity struct { //struct for container bgp-pol:set-as-path-prepend type SetAsPathPrepend struct { - // original -> bgp-pol:as - //bgp-pol:as's original type is union - As string // original -> bgp-pol:repeat-n RepeatN uint8 + // original -> gobgp:as + //gobgp:as's original type is union + As string } //struct for container bgp-pol:bgp-actions @@ -1454,9 +1454,9 @@ type PolicyDefinitions struct { PolicyDefinitionList []PolicyDefinition } -//struct for container bgp-pol:as-path +//struct for container gobgp:as-path type AsPath struct { - // original -> bgp-pol:as-path + // original -> gobgp:as-path AsPath string } @@ -1464,7 +1464,9 @@ type AsPath struct { type AsPathSet struct { // original -> bgp-pol:as-path-set-name AsPathSetName string - // original -> bgp-pol:as-path + // original -> bgp-pol:as-path-set-member + AsPathSetMember []string + // original -> gobgp:as-path AsPathList []AsPath } @@ -1474,9 +1476,9 @@ type AsPathSets struct { AsPathSetList []AsPathSet } -//struct for container bgp-pol:ext-community +//struct for container gobgp:ext-community type ExtCommunity struct { - // original -> bgp-pol:ext-community + // original -> gobgp:ext-community ExtCommunity string } @@ -1484,7 +1486,7 @@ type ExtCommunity struct { type ExtCommunitySet struct { // original -> bgp-pol:ext-community-set-name ExtCommunitySetName string - // original -> bgp-pol:ext-community + // original -> gobgp:ext-community ExtCommunityList []ExtCommunity } @@ -1494,9 +1496,9 @@ type ExtCommunitySets struct { ExtCommunitySetList []ExtCommunitySet } -//struct for container bgp-pol:community +//struct for container gobgp:community type Community struct { - // original -> bgp-pol:community + // original -> gobgp:community Community string } @@ -1504,7 +1506,7 @@ type Community struct { type CommunitySet struct { // original -> bgp-pol:community-set-name CommunitySetName string - // original -> bgp-pol:community + // original -> gobgp:community CommunityList []Community } @@ -1544,10 +1546,10 @@ type TagSets struct { TagSetList []TagSet } -//struct for container rpol:neighbor-info +//struct for container gobgp:neighbor-info type NeighborInfo struct { - // original -> rpol:address - //rpol:address's original type is inet:ip-address + // original -> gobgp:address + //gobgp:address's original type is inet:ip-address Address net.IP } @@ -1555,7 +1557,7 @@ type NeighborInfo struct { type NeighborSet struct { // original -> rpol:neighbor-set-name NeighborSetName string - // original -> rpol:neighbor-info + // original -> gobgp:neighbor-info NeighborInfoList []NeighborInfo } diff --git a/tools/pyang_plugins/README.rst b/tools/pyang_plugins/README.rst index dc4e2a0e..eaf3f89e 100644 --- a/tools/pyang_plugins/README.rst +++ b/tools/pyang_plugins/README.rst @@ -22,4 +22,5 @@ How to use -p $YANG_DIR/experimental/openconfig/policy \ -f golang $YANG_DIR/experimental/openconfig/bgp/bgp.yang \ --augment $YANG_DIR/experimental/openconfig/bgp/bgp-policy.yang \ + --augment $GOBGP_PATH/tools/pyang_plugins/gobgp.yang \ | gofmt > $GOBGP_PATH/config/bgp_configs.go diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py index 569cc9bf..8ba5ef41 100644 --- a/tools/pyang_plugins/bgpyang2golang.py +++ b/tools/pyang_plugins/bgpyang2golang.py @@ -52,7 +52,7 @@ class GolangPlugin(plugin.PyangPlugin): def add_opts(self, optparser): optlist = [ optparse.make_option("--augment", - dest="augment", + dest="augment", action="append", help="Yang file which has augment statements"), ] g = optparser.add_option_group("GolangPlugin specific options") @@ -75,7 +75,7 @@ class GolangPlugin(plugin.PyangPlugin): # load augment module if ctx.opts.augment: aug_mod_path = ctx.opts.augment - for p in aug_mod_path.split(","): + for p in aug_mod_path: with open(p) as fd: try: text = fd.read() @@ -151,6 +151,10 @@ def emit_class_def(ctx, yang_statement, struct_name, prefix): print >> o, '//struct for container %s:%s' % (prefix, yang_statement.arg) print >> o, 'type %s struct {' % convert_to_golang(struct_name) for child in yang_statement.i_children: + + if child.path in _path_exclude: + continue + container_or_list_name = child.uniq_name val_name_go = convert_to_golang(child.arg) child_prefix = get_orig_prefix(child.i_orig_module) @@ -254,9 +258,21 @@ def get_orig_prefix(module): return module.i_prefix +def get_path(c): + path = '' + if c.parent is not None: + p = '' + if hasattr(c, 'i_module'): + mod = c.i_module + prefix = mod.search_one('prefix') + + p = prefix.arg + ":" if prefix else '' + path = get_path(c.parent) + "/" + p + c.arg + return path + + def visit_children(ctx, module, children): for c in children: - prefix = '' if is_case(c): prefix = get_orig_prefix(c.parent.i_orig_module) @@ -298,6 +314,8 @@ def visit_children(ctx, module, children): ctx.golang_struct_names[prefix+':'+c.uniq_name] = c ctx.golang_struct_def.append(c) + c.path = get_path(c) + # print(c.path) if hasattr(c, 'i_children'): visit_children(ctx, module, c.i_children) @@ -325,6 +343,8 @@ def visit_typedef(ctx, module): child_map = {} for stmts in module.substmts: if stmts.keyword == 'typedef': + stmts.path = get_path(stmts) + # print(stmts.path) name = stmts.arg stmts.golang_name = convert_to_golang(name) if stmts.golang_name == 'PeerType': @@ -375,6 +395,9 @@ def emit_typedef(ctx, module): t_map = ctx.golang_typedef_map[prefix] for name, stmt in t_map.items(): + if stmt.path in _typedef_exclude: + continue + # skip identityref type because currently skip identity if get_type_spec(stmt) == 'identityref': continue @@ -528,6 +551,13 @@ _module_excluded = ["ietf-inet-types", "ietf-yang-types", ] +_path_exclude = ["/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:config/bgp:local-address", + "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:state/bgp:local-address", + "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set/rpol:neighbor", + "/rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:community-sets/bgp-pol:community-set/bgp-pol:community-member", + "/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"] + +_typedef_exclude =["/bgp-types:bgp-origin-attr-type"] def generate_header(ctx): print _COPYRIGHT_NOTICE diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang new file mode 100644 index 00000000..c3c4d800 --- /dev/null +++ b/tools/pyang_plugins/gobgp.yang @@ -0,0 +1,343 @@ +module bgp-gobgp { + + yang-version "1"; + + // namespace + namespace "https://github.com/osrg/gobgp"; + + prefix "gobgp"; + + // import some basic types + import bgp { prefix bgp; } + import routing-policy {prefix rpol; } + import bgp-policy {prefix bgp-pol; } + import ietf-inet-types { prefix inet; } + + // meta + organization + "GoBGP"; + + contact + "GoBGP http://osrg.github.io/gobgp/"; + + description + "This module contains definitions for GoBGP-specific configuration. + It augments bgp modules with GoBGP-specific options."; + + revision "2015-08-10" { + description + "Updated model to augment base bgp modules"; + reference "TBD"; + } + + typedef bgp-origin-attr-type { + type enumeration { + enum IGP { + value 0; + description "Origin of the NLRI is internal"; + } + enum EGP { + value 1; + description "Origin of the NLRI is EGP"; + } + enum INCOMPLETE { + value 2; + description "Origin of the NLRI is neither IGP or EGP"; + } + } + } + + grouping gobgp-message-counter { + description + "Counters for all BGPMessage types"; + + leaf OPEN { + type uint64; + description + "Number of BGP open messages announcing, withdrawing + or modifying paths exchanged."; + } + + leaf REFRESH { + type uint64; + description + "Number of BGP Route-Refresh messages indicating an + error condition has occurred exchanged."; + } + + leaf KEEPALIVE { + type uint64; + description + "Number of BGP Keepalive messages indicating an + error condition has occurred exchanged."; + } + + leaf DYNAMIC-CAP { + type uint64; + description + "Number of BGP dynamic-cap messages indicating an + error condition has occurred exchanged."; + } + + leaf DISCARDED { + type uint64; + description + "Number of discarded messages indicating an + error condition has occurred exchanged."; + } + + leaf TOTAL { + type uint64; + description + "Number of total messages indicating an + error condition has occurred exchanged."; + } + } + + + grouping gobgp-timer { + description "additional timer"; + + leaf idle-hold-time-after-reset { + type decimal64 { + fraction-digits 2; + } + default 30; + description + "Time interval in seconds that a BGP session will be + in idle state after neighbor reset operation."; + } + } + + + grouping gobgp-neighbor-timer { + description "additional timer"; + + leaf downtime { + type yang:timeticks; + description + "This timer determines the amount of time since the + BGP last transitioned out of the Established state"; + } + + leaf update-recv-time { + type int64; + description + "The number of seconds elasped since January 1, 1970 UTC + last time the BGP session received an UPDATE message"; + } + } + + + grouping gobgp-in-policy { + description + "additional policy"; + + leaf-list in-policy { + type leafref { + path "/rpol:routing-policy/rpol:policy-definitions/" + + "rpol:policy-definition/rpol:name"; + //require-instance true; + } + description + "list of policy names in sequence to be applied on + sending a routing update in the current context, e.g., + for the current other route server clients."; + } + + leaf default-in-policy { + type rpol:default-policy-type; + default REJECT-ROUTE; + description + "explicitly set a default policy if no policy definition + in the in-policy chain is satisfied."; + } + } + + grouping gobgp-route-server-config { + description + "Configuration parameter specifying whether + the neighbor is route server client or not."; + + leaf route-server-client { + type boolean; + default "false"; + description + "Configure the neighbor as a route server client."; + } + } + + grouping gobgp-route-server-config-set { + description + "set of configurations for route server client."; + + container route-server { + description + "Configure the local router as a route server"; + + container config { + description + "Configuration parameters relating to route server + client(s) used for the BGP neighbor"; + uses gobgp-route-server-config; + } + container state { + config false; + description + "State information relating to route server + client(s) used for the BGP neighbor"; + uses gobgp-route-server-config; + } + } + } + + + // augment statements + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:sent" { + description "additional counters"; + uses gobgp-message-counter; + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:received" { + description "additional counters"; + uses gobgp-message-counter; + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" { + description "additional state elements"; + + leaf admin-down { + type boolean; + description + "The state of administrative operation. If the state is true, it indicates the neighbor is disabled by the administrator"; + } + + leaf established-count { + type uint32; + description + "The number of how many the peer became established state"; + } + + leaf flops { + type uint32; + description + "The number of flip-flops"; + } + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:timers/bgp:config" { + description "additional timer"; + uses gobgp-timer; + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:timers/bgp:state" { + description "additional timers"; + uses gobgp-timer; + uses gobgp-neighbor-timer; + } + + augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" { + description "route server configuration for peer-group"; + uses gobgp-route-server-config-set; + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" { + description "route server configuration for neighbor"; + uses gobgp-route-server-config-set; + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:config" { + description "neighbor's local ip address, whose type is inet:ip-address"; + leaf local-address { + type inet:ip-address; + } + } + + augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:state" { + description "neighbor's local ip address, whose type is inet:ip-address"; + leaf local-address { + type inet:ip-address; + } + } + + augment "/bgp:bgp/bgp:global/bgp:apply-policy/bgp:config" { + description "addtional policy"; + uses gobgp-in-policy; + + } + + augment "/bgp:bgp/bgp:global/bgp:apply-policy/bgp:state" { + description "additional policy"; + uses gobgp-in-policy; + + } + + augment "/rpol:routing-policy/rpol:policy-definitions/" + + "rpol:policy-definition/rpol:statements/rpol:statement/" + + "rpol:actions/bgp-pol:bgp-actions/bgp-pol:set-as-path-prepend" { + description "as number used for aspath prepend"; + + leaf as { + type union { + type inet:as-number; + type string { + pattern "last-as"; + } + } + description + "autonomous system number or 'last-as' which means + the leftmost as number in the AS-path to be prepended"; + } + } + + augment "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set" { + description "alternative for the existing neighbor element"; + + list neighbor-info { + leaf address { + type inet:ip-address; + description + "neighbor ip address"; + } + } + } + + augment "/rpol:routing-policy/rpol:defined-sets/" + + "bgp-pol:bgp-defined-sets/bgp-pol:community-sets/bgp-pol:community-set" { + description "alternative for the existing community-member"; + + list community { + leaf community { + type string; + description + "community set member"; + } + } + } + + augment "/rpol:routing-policy/rpol:defined-sets/" + + "bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/bgp-pol:ext-community-set" { + description "alternative for the existing ext-community-member"; + + list ext-community { + leaf ext-community { + type string; + description + "extended community set member"; + } + } + } + + augment "/rpol:routing-policy/rpol:defined-sets/" + + "bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set" { + description "alternative for the existing as-path-set-member"; + + list as-path { + leaf as-path { + type string; + description + "AS path expression"; + } + } + } +} |