summaryrefslogtreecommitdiffhomepage
path: root/tools/pyang_plugins/gobgp.yang
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pyang_plugins/gobgp.yang')
-rw-r--r--tools/pyang_plugins/gobgp.yang343
1 files changed, 343 insertions, 0 deletions
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";
+ }
+ }
+ }
+}