BGPCEP-578: Extended peer-group support
[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 2018-03-21 {
29         description "Augment Peer group with transport config.";
30     }
31
32     revision 2017-12-07 {
33         description "Add support for add-path in base BGP NLRI.";
34     }
35
36     revision 2016-06-14 {
37         description
38             "Update to follow naming conventions.";
39     }
40
41     revision 2015-09-30 {
42         description "Initial revision";
43     }
44
45     identity IPV4-FLOW {
46         base bgp-types:afi-safi-type;
47         description
48           "IPv4 Flow specification (AFI,SAFI = 1,133)";
49         reference "https://tools.ietf.org/html/rfc5575";
50     }
51
52     identity IPV6-FLOW {
53         base bgp-types:afi-safi-type;
54         description
55           "IPv6 Flow specification (AFI,SAFI = 2,133)";
56         reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06";
57     }
58
59     identity IPV6-L3VPN-FLOW {
60         base bgp-types:afi-safi-type;
61         description
62           "IPv6 Flow specification (AFI,SAFI = 2,133)";
63         reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06";
64     }
65
66     identity IPV4-L3VPN-FLOW {
67         base bgp-types:afi-safi-type;
68         description
69           "IPv6 Flow specification (AFI,SAFI = 2,133)";
70         reference "https://tools.ietf.org/html/rfc5575";
71     }
72
73     identity LINKSTATE {
74         base bgp-types:afi-safi-type;
75         description
76           "Link-State (AFI,SAFI = 16388,71)";
77         reference "https://tools.ietf.org/html/rfc7752";
78     }
79
80     grouping transport-config {
81         leaf remote-port {
82             type inet:port-number;
83             default 179;
84             description
85                 "Remote port being used by the peer for the TCP session
86                  supporting the BGP session";
87         }
88     }
89
90     augment /netinst:network-instances/netinst:network-instance/netinst:protocols/netinst:protocol {
91         ext:augment-identifier network-instance-protocol;
92         uses openconfig-bgp:bgp-top {
93             augment bgp/neighbors/neighbor/afi-safis/afi-safi {
94                 ext:augment-identifier neighbor-add-paths-config;
95                 uses openconfig-bgp:bgp-neighbor-add-paths_config;
96             }
97             augment bgp/global/afi-safis/afi-safi {
98                 ext:augment-identifier global-add-paths-config;
99                 uses openconfig-bgp:bgp-neighbor-add-paths_config;
100             }
101             augment bgp/global/afi-safis/afi-safi/state {
102                 ext:augment-identifier global-afi-safi_state-augmentation;
103                 uses bgp-op:bgp-global-afi-safi_state;
104             }
105             augment bgp/neighbors/neighbor/transport/config {
106                 ext:augment-identifier neighbor-transport-config;
107                 uses transport-config;
108             }
109             augment bgp/neighbors/neighbor/config {
110                 ext:augment-identifier neighbor-peer-group-config;
111                 description
112                     "Augmentation to allow association of a neighbor with a
113                      peer-group";
114                 uses openconfig-bgp:bgp-neighbor-peer-group_config;
115             }
116             augment bgp/global/config {
117                 ext:augment-identifier global-config-augmentation;
118                 leaf route-reflector-cluster-id {
119                     type bgp-types:rr-cluster-id-type;
120                     description
121                       "Route-reflector cluster id to use when local router is
122                       configured as a route reflector.";
123                   }
124             }
125             augment bgp/neighbors/neighbor/state {
126                 ext:augment-identifier neighbor_state-augmentation;
127                 uses bgp-op:bgp-neighbor_state;
128             }
129             augment bgp/neighbors/neighbor/state {
130                 ext:augment-identifier bgp-neighbor_state-augmentation;
131                 container messages {
132                     container sent {
133                         uses bgp-op:bgp-neighbor-message-counters-sent_state;
134                     }
135
136                     container received {
137                         uses bgp-op:bgp-neighbor-message-counters-received_state;
138                     }
139                 }
140
141                 container queues {
142                     uses bgp-op:bgp-neighbor-queue-counters_state;
143                 }
144             }
145             augment bgp/neighbors/neighbor/timers/state {
146                 ext:augment-identifier neighbor-timers_state-augmentation;
147                 uses bgp-op:bgp-neighbor-timers_state;
148             }
149             augment bgp/neighbors/neighbor/transport/state {
150                 ext:augment-identifier neighbor-transport_state-augmentation;
151                 uses bgp-op:bgp-neighbor-transport_state;
152             }
153             augment bgp/neighbors/neighbor/error-handling/state {
154                 ext:augment-identifier neighbor-error-handling_state-augmentation;
155                 uses bgp-op:bgp-neighbor-error-handling_state;
156             }
157             augment bgp/neighbors/neighbor/afi-safis/afi-safi/state {
158                 ext:augment-identifier neighbor-afi-safi_state-augmentation;
159                 uses bgp-op:bgp-neighbor-afi-safi_state;
160             }
161             augment bgp/neighbors/neighbor/graceful-restart/state {
162                 ext:augment-identifier neighbor-graceful-restart_state-augmentation;
163                 uses bgp-op:bgp-afi-safi-graceful-restart_state;
164             }
165             augment bgp/neighbors/neighbor/afi-safis/afi-safi/graceful-restart/state {
166                 ext:augment-identifier neighbor-afi-safi-graceful-restart_state-augmentation;
167                 uses bgp-op:bgp-neighbor-afi-safi-graceful-restart_state;
168             }
169             augment bgp/peer-groups/peer-group/state {
170                 ext:augment-identifier peer-group_state-augmentation;
171                 uses bgp-op:bgp-peer-group_state;
172             }
173             augment bgp/peer-groups/peer-group/transport/config {
174                 ext:augment-identifier peer-group-transport-config;
175                 uses transport-config;
176             }
177         }
178     }
179
180 }