diff options
-rw-r--r-- | config/bgp_configs.go | 81 | ||||
-rw-r--r-- | tools/pyang_plugins/gobgp.yang | 218 |
2 files changed, 279 insertions, 20 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 309f7d65..03e719fd 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -131,6 +131,85 @@ const ( BGP_ORIGIN_ATTR_TYPE_INCOMPLETE = 2 ) +//struct for container gobgp:rpki-received +type RpkiReceived struct { + // original -> gobgp:serial-notify + SerialNotify int64 + // original -> gobgp:cache-reset + CacheReset int64 + // original -> gobgp:cache-response + CacheResponse int64 + // original -> gobgp:ipv4-prefix + Ipv4Prefix int64 + // original -> gobgp:ipv6-prefix + Ipv6Prefix int64 + // original -> gobgp:end-of-data + EndOfData int64 + // original -> gobgp:error + Error int64 +} + +//struct for container gobgp:rpki-sent +type RpkiSent struct { + // original -> gobgp:serial-query + SerialQuery int64 + // original -> gobgp:reset-query + ResetQuery int64 + // original -> gobgp:error + Error int64 +} + +//struct for container gobgp:rpki-messages +type RpkiMessages struct { + // original -> gobgp:rpki-sent + RpkiSent RpkiSent + // original -> gobgp:rpki-received + RpkiReceived RpkiReceived +} + +//struct for container gobgp:state +type RpkiServerState struct { + // original -> gobgp:uptime + Uptime int64 + // original -> gobgp:downtime + Downtime int64 + // original -> gobgp:last-pdu-recv-time + LastPduRecvTime int64 + // original -> gobgp:rpki-messages + RpkiMessages RpkiMessages +} + +//struct for container gobgp:config +type RpkiServerConfig struct { + // original -> gobgp:address + //gobgp:address's original type is inet:ip-address + Address net.IP + // original -> gobgp:port + Port uint32 + // original -> gobgp:refresh-time + RefreshTime int64 + // original -> gobgp:hold-time + HoldTime int64 + // original -> gobgp:record-lifetime + RecordLifetime int64 + // original -> gobgp:preference + Preference uint8 +} + +//struct for container gobgp:rpki-server +type RpkiServer struct { + // original -> gobgp:rpki-server-config + RpkiServerConfig RpkiServerConfig + // original -> gobgp:rpki-server-state + RpkiServerState RpkiServerState +} + +//struct for container gobgp:rpki-servers +type RpkiServers struct { + // original -> gobgp:rpki-server + RpkiServerList []RpkiServer +} + //struct for container bgp:state type PeerGroupState struct { // original -> bgp:peer-as @@ -1231,6 +1310,8 @@ type Bgp struct { Neighbors Neighbors // original -> bgp:peer-groups PeerGroups PeerGroups + // original -> gobgp:rpki-servers + RpkiServers RpkiServers } //struct for container bgp-pol:set-ext-community-method diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang index 6b188097..2fa51887 100644 --- a/tools/pyang_plugins/gobgp.yang +++ b/tools/pyang_plugins/gobgp.yang @@ -171,33 +171,23 @@ module bgp-gobgp { description "set of configurations for route server client."; - container route-server { + 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; + 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; - } - } - } - - grouping gobgp-rpki-validation-result { - description "additional rpki"; - leaf rpki-validation-result { - type rpki-validation-result-type; - default NOT-FOUND; + config false; description - "specify the validation result of RPKI based on ROA as conditions"; + "State information relating to route server + client(s) used for the BGP neighbor"; + uses gobgp-route-server-config; + } } } @@ -223,6 +213,188 @@ module bgp-gobgp { "indicate the validation result of RPKI based on ROA"; } + 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"; + } + } + + grouping gobgp-rpki-server-messages-sent { + description "additional RPKI sent messages"; + + leaf serial-query { + type int64; + description + "Number of serial query message sent to RPKI server"; + } + leaf reset-query { + type int64; + description + "Number of reset query message sent to RPKI server"; + } + leaf error { + type int64; + description + "Number of error message sent to RPKI server"; + } + } + + grouping gobgp-rpki-server-messages-received { + description "additional RPKI receive messages"; + + leaf serial-notify { + type int64; + description + "Number of serial notify message received from RPKI server"; + } + leaf cache-reset { + type int64; + description + "Number of cache reset message received from RPKI server"; + } + leaf cache-response { + type int64; + description + "Number of cache response message received from RPKI server"; + } + leaf ipv4-prefix { + type int64; + description + "Number of ipv4 prefix message received from RPKI server"; + } + leaf ipv6-prefix { + type int64; + description + "Number of ipv6 prefix message received from RPKI server"; + } + leaf end-of-data { + type int64; + description + "Number of end of data message received from RPKI server"; + } + leaf error { + type int64; + description + "Number of error message received from RPKI server"; + } + } + + grouping gobgp-rpki-server-messages { + description "additional RPKI messages"; + + container rpki-sent { + description + "Counters for transmission RPKI Message types"; + uses gobgp-rpki-server-messages-sent; + } + container rpki-received { + description + "Counters for reception RPKI Message types"; + uses gobgp-rpki-server-messages-received; + } + } + + grouping gobgp-rpki-server-state { + description "additional RPKI state"; + + leaf uptime { + type int64; + description + "This timer determines the amount of time since the + RPKI last transitioned in of the Established state"; + } + leaf downtime { + type int64; + description + "This timer determines the amount of time since the + RPKI last transitioned out of the Established state"; + } + leaf last-pdu-recv-time { + type int64; + description + "last time the received an pdu message from RPKI server"; + } + container rpki-messages { + description + "Counters for transmission and reception RPKI Message types"; + uses gobgp-rpki-server-messages; + } + } + + grouping gobgp-rpki-server-config { + description "additional RPKI config"; + + leaf address { + type inet:ip-address; + description + "Reference to the address of the RPKI server used as + a key in the RPKI server list"; + } + leaf port { + type uint32; + description + "Reference to the port of the RPKI server"; + } + leaf refresh-time { + type int64; + description + "Check interval for a configured RPKI server."; + } + leaf hold-time { + type int64; + description + "Specify the length of time in seconds that the session between + the router and RPKI server is to be considered operational + without any activity"; + } + leaf record-lifetime { + type int64; + description + "Indicate the expiration date of the route validation recode + received from RPKI server"; + } + leaf preference { + type uint8; + description + "RPKI server has a static preference. + Higher the preference values indicates a higher priority RPKI server"; + } + } + + grouping gobgp-rpki-server-set { + description "additional RPKI configuration and state"; + + container config { + description + "Configuration parameters relating to RPKI server"; + uses gobgp-rpki-server-config; + } + container state { + description + "State information relating to RPKI server"; + uses gobgp-rpki-server-state; + } + } + + grouping gobgp-rpki-servers { + description "additional RPKI structure"; + + container rpki-servers { + description + "List of RPKI servers configured on the local system"; + list rpki-server { + container rpki-server { + uses gobgp-rpki-server-set; + } + } + } + } + // augment statements augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:sent" { description "additional counters"; @@ -379,4 +551,10 @@ module bgp-gobgp { uses gobgp-rpki-validation-result; } + augment "/bgp:bgp" { + description "additional rpki configuration and state"; + uses gobgp-rpki-servers; + + } + } |