5486fb18b70b4982804cc0bb6fa839b4d4e40f56
[bgpcep.git] / bgp / openconfig-api / src / main / yang / bgp-openconfig-extensions.yang
1 module bgp-openconfig-extensions {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions";
4     prefix "odl-oc-ext";
5
6     import openconfig-bgp-types { prefix bgp-types; }
7     import openconfig-network-instance { prefix netinst; }
8     import openconfig-bgp { prefix openconfig-bgp; }
9     import ietf-inet-types { prefix inet; }
10     import yang-ext { prefix ext; revision-date 2013-07-09; }
11     import bgp-rib { prefix bgp-rib; revision-date 2017-12-07; }
12     import openconfig-bgp-operational { prefix bgp-op; }
13
14     organization "Cisco Systems, Inc.";
15     contact "Milos Fabian <milfabia@cisco.com>";
16
17     description
18         "This module contains the custom extensions to the
19         draft-ietf-idr-bgp-model-00 Yang data models.
20
21         Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
22
23         This program and the accompanying materials are made available
24         under the terms of the Eclipse Public License v1.0 which
25         accompanies this distribution, and is available at
26         http://www.eclipse.org/legal/epl-v10.html";
27
28     revision 2017-12-07 {
29         description "Add support for add-path in base BGP NLRI.";
30     }
31
32     revision 2016-06-14 {
33         description
34             "Update to follow naming conventions.";
35     }
36
37     revision 2015-09-30 {
38         description "Initial revision";
39     }
40
41     identity IPV4-FLOW {
42         base bgp-types:afi-safi-type;
43         description
44           "IPv4 Flow specification (AFI,SAFI = 1,133)";
45         reference "https://tools.ietf.org/html/rfc5575";
46     }
47
48     identity IPV6-FLOW {
49         base bgp-types:afi-safi-type;
50         description
51           "IPv6 Flow specification (AFI,SAFI = 2,133)";
52         reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06";
53     }
54
55     identity IPV6-L3VPN-FLOW {
56         base bgp-types:afi-safi-type;
57         description
58           "IPv6 Flow specification (AFI,SAFI = 2,133)";
59         reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06";
60     }
61
62     identity IPV4-L3VPN-FLOW {
63         base bgp-types:afi-safi-type;
64         description
65           "IPv6 Flow specification (AFI,SAFI = 2,133)";
66         reference "https://tools.ietf.org/html/rfc5575";
67     }
68
69     identity LINKSTATE {
70         base bgp-types:afi-safi-type;
71         description
72           "Link-State (AFI,SAFI = 16388,71)";
73         reference "https://tools.ietf.org/html/rfc7752";
74     }
75
76     grouping transport-config {
77         leaf remote-port {
78             type inet:port-number;
79             default 179;
80             description
81                 "Remote port being used by the peer for the TCP session
82                  supporting the BGP session";
83         }
84     }
85
86     augment /netinst:network-instances/netinst:network-instance/netinst:protocols/netinst:protocol {
87         uses openconfig-bgp:bgp-top {
88             augment bgp/neighbors/neighbor/afi-safis/afi-safi {
89                 uses openconfig-bgp:bgp-neighbor-add-paths_config;
90             }
91             augment bgp/global/afi-safis/afi-safi {
92                 uses openconfig-bgp:bgp-neighbor-add-paths_config;
93             }
94             augment bgp/global/afi-safis/afi-safi/state {
95                 ext:augment-identifier global-afi-safi_state-augmentation;
96                 uses bgp-op:bgp-global-afi-safi_state;
97             }
98             augment bgp/neighbors/neighbor/transport/config {
99                 uses transport-config;
100             }
101             augment bgp/neighbors/neighbor/config {
102                 description
103                     "Augmentation to allow association of a neighbor with a
104                      peer-group";
105                 uses openconfig-bgp:bgp-neighbor-peer-group_config;
106             }
107             augment bgp/global/config {
108                 ext:augment-identifier global-config-augmentation;
109                 leaf route-reflector-cluster-id {
110                     type bgp-types:rr-cluster-id-type;
111                     description
112                       "Route-reflector cluster id to use when local router is
113                       configured as a route reflector.";
114                   }
115             }
116             augment bgp/neighbors/neighbor/state {
117                 ext:augment-identifier neighbor_state-augmentation;
118                 uses bgp-op:bgp-neighbor_state;
119             }
120             augment bgp/neighbors/neighbor/state {
121                 ext:augment-identifier bgp-neighbor_state-augmentation;
122                 container messages {
123                     container sent {
124                         uses bgp-op:bgp-neighbor-message-counters-sent_state;
125                     }
126
127                     container received {
128                         uses bgp-op:bgp-neighbor-message-counters-received_state;
129                     }
130                 }
131
132                 container queues {
133                     uses bgp-op:bgp-neighbor-queue-counters_state;
134                 }
135             }
136             augment bgp/neighbors/neighbor/timers/state {
137                 ext:augment-identifier neighbor-timers_state-augmentation;
138                 uses bgp-op:bgp-neighbor-timers_state;
139             }
140             augment bgp/neighbors/neighbor/transport/state {
141                 ext:augment-identifier neighbor-transport_state-augmentation;
142                 uses bgp-op:bgp-neighbor-transport_state;
143             }
144             augment bgp/neighbors/neighbor/error-handling/state {
145                 ext:augment-identifier neighbor-error-handling_state-augmentation;
146                 uses bgp-op:bgp-neighbor-error-handling_state;
147             }
148             augment bgp/neighbors/neighbor/afi-safis/afi-safi/state {
149                 ext:augment-identifier neighbor-afi-safi_state-augmentation;
150                 uses bgp-op:bgp-neighbor-afi-safi_state;
151             }
152             augment bgp/neighbors/neighbor/graceful-restart/state {
153                 ext:augment-identifier neighbor-graceful-restart_state-augmentation;
154                 uses bgp-op:bgp-afi-safi-graceful-restart_state;
155             }
156             augment bgp/neighbors/neighbor/afi-safis/afi-safi/graceful-restart/state {
157                 ext:augment-identifier neighbor-afi-safi-graceful-restart_state-augmentation;
158                 uses bgp-op:bgp-neighbor-afi-safi-graceful-restart_state;
159             }
160             augment bgp/peer-groups/peer-group/state {
161                 ext:augment-identifier peer-group_state-augmentation;
162                 uses bgp-op:bgp-peer-group_state;
163             }
164         }
165     }
166
167 }