mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
config: remove redundant definition in gobgp.yang
Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
committed by
FUJITA Tomonori
parent
3bed393b01
commit
033c8bfdb8
+34
-34
@@ -169,6 +169,40 @@ func (v BgpSessionDirection) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// typedef for typedef bgp-types:bgp-origin-attr-type
|
||||
type BgpOriginAttrType string
|
||||
|
||||
const (
|
||||
BGP_ORIGIN_ATTR_TYPE_IGP BgpOriginAttrType = "igp"
|
||||
BGP_ORIGIN_ATTR_TYPE_EGP BgpOriginAttrType = "egp"
|
||||
BGP_ORIGIN_ATTR_TYPE_INCOMPLETE BgpOriginAttrType = "incomplete"
|
||||
)
|
||||
|
||||
func (v BgpOriginAttrType) ToInt() int {
|
||||
for i, vv := range []string{"igp", "egp", "incomplete"} {
|
||||
if string(v) == vv {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
func (v BgpOriginAttrType) FromInt(i int) BgpOriginAttrType {
|
||||
for j, vv := range []string{"igp", "egp", "incomplete"} {
|
||||
if i == j {
|
||||
return BgpOriginAttrType(vv)
|
||||
}
|
||||
}
|
||||
return BgpOriginAttrType("")
|
||||
}
|
||||
|
||||
func (v BgpOriginAttrType) Validate() error {
|
||||
if v.ToInt() < 0 {
|
||||
return fmt.Errorf("invalid BgpOriginAttrType: %s", v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// typedef for typedef ptypes:match-set-options-restricted-type
|
||||
type MatchSetOptionsRestrictedType string
|
||||
|
||||
@@ -406,40 +440,6 @@ func (v RpkiValidationResultType) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// typedef for typedef gobgp:bgp-origin-attr-type
|
||||
type BgpOriginAttrType string
|
||||
|
||||
const (
|
||||
BGP_ORIGIN_ATTR_TYPE_IGP BgpOriginAttrType = "igp"
|
||||
BGP_ORIGIN_ATTR_TYPE_EGP BgpOriginAttrType = "egp"
|
||||
BGP_ORIGIN_ATTR_TYPE_INCOMPLETE BgpOriginAttrType = "incomplete"
|
||||
)
|
||||
|
||||
func (v BgpOriginAttrType) ToInt() int {
|
||||
for i, vv := range []string{"igp", "egp", "incomplete"} {
|
||||
if string(v) == vv {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
func (v BgpOriginAttrType) FromInt(i int) BgpOriginAttrType {
|
||||
for j, vv := range []string{"igp", "egp", "incomplete"} {
|
||||
if i == j {
|
||||
return BgpOriginAttrType(vv)
|
||||
}
|
||||
}
|
||||
return BgpOriginAttrType("")
|
||||
}
|
||||
|
||||
func (v BgpOriginAttrType) Validate() error {
|
||||
if v.ToInt() < 0 {
|
||||
return fmt.Errorf("invalid BgpOriginAttrType: %s", v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//struct for container gobgp:state
|
||||
type BmpServerState struct {
|
||||
}
|
||||
|
||||
@@ -570,7 +570,7 @@ _path_exclude = ["/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:config/b
|
||||
"/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 =["/bgp-types:bgp-origin-attr-type"]
|
||||
_typedef_exclude =[]
|
||||
|
||||
def generate_header(ctx):
|
||||
print _COPYRIGHT_NOTICE
|
||||
|
||||
@@ -32,23 +32,6 @@ module gobgp {
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef bmp-route-monitoring-policy-type {
|
||||
type enumeration {
|
||||
enum PRE-POLICY {
|
||||
|
||||
Reference in New Issue
Block a user