summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--config/bgp_configs.go92
-rw-r--r--tools/pyang_plugins/gobgp.yang3
2 files changed, 50 insertions, 45 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go
index 4fa29bd4..3a5a1b6b 100644
--- a/config/bgp_configs.go
+++ b/config/bgp_configs.go
@@ -633,6 +633,51 @@ func (v DefaultPolicyType) Validate() error {
return nil
}
+// typedef for typedef bgp-pol:bgp-next-hop-type
+type BgpNextHopType string
+
+// typedef for typedef bgp-pol:bgp-as-path-prepend-repeat
+type BgpAsPathPrependRepeat uint8
+
+// typedef for typedef bgp-pol:bgp-set-med-type
+type BgpSetMedType string
+
+// typedef for identity bgp-pol:bgp-set-community-option-type
+type BgpSetCommunityOptionType string
+
+const (
+ BGP_SET_COMMUNITY_OPTION_TYPE_ADD BgpSetCommunityOptionType = "add"
+ BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE BgpSetCommunityOptionType = "remove"
+ BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE BgpSetCommunityOptionType = "replace"
+)
+
+var BgpSetCommunityOptionTypeToIntMap = map[BgpSetCommunityOptionType]int{
+ BGP_SET_COMMUNITY_OPTION_TYPE_ADD: 0,
+ BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE: 1,
+ BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE: 2,
+}
+
+func (v BgpSetCommunityOptionType) ToInt() int {
+ i, ok := BgpSetCommunityOptionTypeToIntMap[v]
+ if !ok {
+ return -1
+ }
+ return i
+}
+
+var IntToBgpSetCommunityOptionTypeMap = map[int]BgpSetCommunityOptionType{
+ 0: BGP_SET_COMMUNITY_OPTION_TYPE_ADD,
+ 1: BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE,
+ 2: BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE,
+}
+
+func (v BgpSetCommunityOptionType) Validate() error {
+ if _, ok := BgpSetCommunityOptionTypeToIntMap[v]; !ok {
+ return fmt.Errorf("invalid BgpSetCommunityOptionType: %s", v)
+ }
+ return nil
+}
+
// typedef for identity bgp:session-state
type SessionState string
@@ -714,51 +759,6 @@ func (v Mode) Validate() error {
return nil
}
-// typedef for typedef bgp-pol:bgp-next-hop-type
-type BgpNextHopType string
-
-// typedef for typedef bgp-pol:bgp-as-path-prepend-repeat
-type BgpAsPathPrependRepeat uint8
-
-// typedef for typedef bgp-pol:bgp-set-med-type
-type BgpSetMedType string
-
-// typedef for identity bgp-pol:bgp-set-community-option-type
-type BgpSetCommunityOptionType string
-
-const (
- BGP_SET_COMMUNITY_OPTION_TYPE_ADD BgpSetCommunityOptionType = "add"
- BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE BgpSetCommunityOptionType = "remove"
- BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE BgpSetCommunityOptionType = "replace"
-)
-
-var BgpSetCommunityOptionTypeToIntMap = map[BgpSetCommunityOptionType]int{
- BGP_SET_COMMUNITY_OPTION_TYPE_ADD: 0,
- BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE: 1,
- BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE: 2,
-}
-
-func (v BgpSetCommunityOptionType) ToInt() int {
- i, ok := BgpSetCommunityOptionTypeToIntMap[v]
- if !ok {
- return -1
- }
- return i
-}
-
-var IntToBgpSetCommunityOptionTypeMap = map[int]BgpSetCommunityOptionType{
- 0: BGP_SET_COMMUNITY_OPTION_TYPE_ADD,
- 1: BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE,
- 2: BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE,
-}
-
-func (v BgpSetCommunityOptionType) Validate() error {
- if _, ok := BgpSetCommunityOptionTypeToIntMap[v]; !ok {
- return fmt.Errorf("invalid BgpSetCommunityOptionType: %s", v)
- }
- return nil
-}
-
// typedef for identity gobgp:bmp-route-monitoring-policy-type
type BmpRouteMonitoringPolicyType string
@@ -1811,6 +1811,8 @@ type AfiSafi struct {
RouteSelectionOptions RouteSelectionOptions `mapstructure:"route-selection-options"`
// original -> bgp-mp:use-multiple-paths
UseMultiplePaths UseMultiplePaths `mapstructure:"use-multiple-paths"`
+ // original -> bgp-mp:prefix-limit
+ PrefixLimit PrefixLimit `mapstructure:"prefix-limit"`
}
//struct for container bgp:state
diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang
index 775d851d..d042792d 100644
--- a/tools/pyang_plugins/gobgp.yang
+++ b/tools/pyang_plugins/gobgp.yang
@@ -808,4 +808,7 @@ module gobgp {
}
}
+ augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi" {
+ uses bgp-mp:all-afi-safi-common;
+ }
}