]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-vrrpd.yang
Merge pull request #12322 from fdumontet6WIND/confed_num
[mirror_frr.git] / yang / frr-vrrpd.yang
1 module frr-vrrpd {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/vrrpd";
4 prefix frr-vrrpd;
5
6 import ietf-inet-types {
7 prefix inet;
8 }
9
10 import ietf-yang-types {
11 prefix yang;
12 }
13
14 import frr-interface {
15 prefix frr-interface;
16 }
17
18 organization
19 "FRRouting";
20 contact
21 "FRR Users List: <mailto:frog@lists.frrouting.org>
22 FRR Development List: <mailto:dev@lists.frrouting.org>";
23 description
24 "This module defines a model for managing FRR vrrpd daemon.
25
26 Copyright 2020 FRRouting
27
28 Redistribution and use in source and binary forms, with or without
29 modification, are permitted provided that the following conditions
30 are met:
31
32 1. Redistributions of source code must retain the above copyright notice,
33 this list of conditions and the following disclaimer.
34
35 2. Redistributions in binary form must reproduce the above copyright
36 notice, this list of conditions and the following disclaimer in the
37 documentation and/or other materials provided with the distribution.
38
39 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
41 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
42 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
50
51 revision 2019-09-09 {
52 description
53 "Initial revision.";
54 }
55
56 grouping ip-vrrp-config {
57 description
58 "Configuration data for VRRP on IP interfaces";
59 leaf virtual-router-id {
60 type uint8 {
61 range "1..255";
62 }
63 description
64 "Set the virtual router id for use by the VRRP group. This
65 usually also determines the virtual MAC address that is
66 generated for the VRRP group";
67 }
68
69 leaf version {
70 type enumeration {
71 enum "2" {
72 value 2;
73 description
74 "VRRP version 2.";
75 }
76 enum "3" {
77 value 3;
78 description
79 "VRRP version 3.";
80 }
81 }
82 default "3";
83 }
84
85 leaf priority {
86 type uint8 {
87 range "1..254";
88 }
89 default "100";
90 description
91 "Specifies the sending VRRP interface's priority
92 for the virtual router. Higher values equal higher
93 priority";
94 }
95
96 leaf preempt {
97 type boolean;
98 default "true";
99 description
100 "When set to true, enables preemption by a higher
101 priority backup router of a lower priority master router";
102 }
103
104 leaf accept-mode {
105 type boolean;
106 default "true";
107 description
108 "Configure whether packets destined for
109 virtual addresses are accepted even when the virtual
110 address is not owned by the router interface";
111 }
112
113 leaf checksum-with-ipv4-pseudoheader {
114 type boolean;
115 default "true";
116 description
117 "Enabled if VRRPv3 checksum for IPv4 involves pseudoheader";
118 }
119
120 leaf advertisement-interval {
121 type uint16 {
122 range "1..4095";
123 }
124 units "centiseconds";
125 default "100";
126 description
127 "Sets the interval between successive VRRP
128 advertisements -- RFC 5798 defines this as a 12-bit
129 value expressed as 0.1 seconds, with default 100, i.e.,
130 1 second. Several implementation express this in units of
131 seconds";
132 }
133
134 leaf shutdown {
135 type boolean;
136 default "false";
137 description
138 "Administrative shutdown for this VRRP group.";
139 }
140 }
141
142 grouping ip-vrrp-state {
143 description
144 "Grouping for operational state data for a virtual router";
145 leaf current-priority {
146 type uint8;
147 config false;
148 description
149 "Operational value of the priority for the
150 interface in the VRRP group.";
151 }
152
153 leaf vrrp-interface {
154 type frr-interface:interface-ref;
155 config false;
156 description
157 "The interface used to transmit VRRP traffic.";
158 }
159
160 leaf source-address {
161 type inet:ip-address;
162 config false;
163 description
164 "The source IP address used for VRRP advertisements.";
165 }
166
167 leaf state {
168 type enumeration {
169 enum "Initialize" {
170 description
171 "State when virtual router is waiting for a Startup event.";
172 }
173 enum "Master" {
174 description
175 "State when virtual router is functioning as the forwarding router
176 for the virtual addresses.";
177 }
178 enum "Backup" {
179 description
180 "State when virtual router is monitoring the availability and state
181 of the Master router.";
182 }
183 }
184 config false;
185 }
186
187 leaf master-advertisement-interval {
188 type uint16 {
189 range "0..4095";
190 }
191 units "centiseconds";
192 config false;
193 description
194 "Advertisement interval contained in advertisements received from the Master.";
195 }
196
197 leaf skew-time {
198 type uint16;
199 units "centiseconds";
200 config false;
201 description
202 "Time to skew Master_Down_Interval.";
203 }
204
205 container counter {
206 config false;
207 leaf state-transition {
208 type yang:zero-based-counter32;
209 description
210 "Number of state transitions the virtual router has experienced.";
211 }
212
213 container tx {
214 leaf advertisement {
215 type yang:zero-based-counter32;
216 description
217 "Number of sent VRRP advertisements.";
218 }
219 }
220
221 container rx {
222 leaf advertisement {
223 type yang:zero-based-counter32;
224 description
225 "Number of received VRRP advertisements.";
226 }
227 }
228 }
229 }
230
231 grouping ip-vrrp-top {
232 description
233 "Top-level grouping for Virtual Router Redundancy Protocol";
234 container vrrp {
235 description
236 "Enclosing container for VRRP groups handled by this
237 IP interface";
238 reference
239 "RFC 5798 - Virtual Router Redundancy Protocol
240 (VRRP) Version 3 for IPv4 and IPv6";
241 list vrrp-group {
242 key "virtual-router-id";
243 description
244 "List of VRRP groups, keyed by virtual router id";
245 uses ip-vrrp-config;
246
247 container v4 {
248 leaf-list virtual-address {
249 type inet:ipv4-address;
250 description
251 "Configure one or more IPv4 virtual addresses for the
252 VRRP group";
253 }
254
255 uses ip-vrrp-state {
256 augment "counter/tx" {
257 leaf gratuitous-arp {
258 type yang:zero-based-counter32;
259 description
260 "Number of sent gratuitous ARP requests.";
261 }
262 }
263 }
264 }
265
266 container v6 {
267 when "../version = 3";
268 leaf-list virtual-address {
269 type inet:ipv6-address;
270 description
271 "Configure one or more IPv6 virtual addresses for the
272 VRRP group";
273 }
274
275 uses ip-vrrp-state {
276 augment "counter/tx" {
277 leaf neighbor-advertisement {
278 type yang:zero-based-counter32;
279 description
280 "Number of sent unsolicited Neighbor Advertisements.";
281 }
282 }
283 }
284 }
285 }
286 }
287 }
288
289 augment "/frr-interface:lib/frr-interface:interface" {
290 uses ip-vrrp-top;
291 }
292 }