diff options
-rw-r--r-- | config/bgp_configs.go | 11 | ||||
-rw-r--r-- | tools/pyang_plugins/gobgp.yang | 36 |
2 files changed, 47 insertions, 0 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index f3f66a09..422c9954 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -112,6 +112,15 @@ const ( BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE ) +// typedef for typedef gobgp:rpki-validation-result-type +type RpkiValidationResultType int + +const ( + RPKI_VALIDATION_RESULT_TYPE_NOT_FOUND RpkiValidationResultType = iota + RPKI_VALIDATION_RESULT_TYPE_VALID + RPKI_VALIDATION_RESULT_TYPE_INVALID +) + // typedef for typedef gobgp:bgp-origin-attr-type type BgpOriginAttrType int @@ -1376,6 +1385,8 @@ type BgpConditions struct { // original -> bgp-pol:route-type //bgp-pol:route-type's original type is enumeration RouteType uint32 + // original -> gobgp:rpki-validation-result + RpkiValidationResult RpkiValidationResultType } //struct for container rpol:igp-conditions diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang index c3c4d800..1c1ed740 100644 --- a/tools/pyang_plugins/gobgp.yang +++ b/tools/pyang_plugins/gobgp.yang @@ -191,6 +191,34 @@ module bgp-gobgp { } } + grouping gobgp-rpki-validation-result { + description "additional rpki"; + leaf rpki-validation-result { + type rpki-validation-result-type; + default NOT-FOUND; + description + "specify the validation result of RPKI based on ROA as conditions"; + } + } + + typedef rpki-validation-result-type { + type enumeration { + enum NOT-FOUND { + description "If the origin AS, prefix, maximum prefix length + does not exist in the range of ROA"; + } + enum VALID { + description "If the origin AS, prefix, maximum prefix length is + exist in the range of ROA"; + } + enum INVALID { + description "if the origin AS is different when prefix, + maximum prefix length is exist in the range of ROA"; + } + } + description + "indicate the validation result of RPKI based on ROA"; + } // augment statements augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:sent" { @@ -340,4 +368,12 @@ module bgp-gobgp { } } } + + augment "/rpol:routing-policy/rpol:policy-definitions/" + + "rpol:policy-definition/rpol:statements/rpol:statement/" + + "rpol:conditions/bgp-pol:bgp-conditions" { + description "additional rpki condition"; + uses gobgp-rpki-validation-result; + } + } |