]> git.proxmox.com Git - mirror_frr.git/blame - yang/frr-vrrpd.yang
lib: add ipaddr_isset()
[mirror_frr.git] / yang / frr-vrrpd.yang
CommitLineData
21a22f4c
QY
1module 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
e6a70ae8
QY
10 import ietf-yang-types {
11 prefix yang;
12 }
13
21a22f4c
QY
14 import frr-interface {
15 prefix frr-interface;
16 }
17
4c5b9fae
QY
18 organization
19 "Free Range Routing";
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
21a22f4c
QY
26 revision 2019-09-09 {
27 description
28 "Initial revision.";
29 }
30
21a22f4c
QY
31 grouping ip-vrrp-tracking-config {
32 description
33 "Configuration data for tracking interfaces
34 in a VRRP group";
35 leaf-list track-interface {
36 type frr-interface:interface-ref;
37 description
38 "Sets a list of one or more interfaces that should
39 be tracked for up/down events to dynamically change the
40 priority state of the VRRP group, and potentially
41 change the mastership if the tracked interface going
42 down lowers the priority sufficiently. Any of the tracked
43 interfaces going down will cause the priority to be lowered.
44 Some implementations may only support a single
45 tracked interface.";
46 }
47
48 leaf priority-decrement {
49 type uint8 {
50 range "0..254";
51 }
52 default "0";
53 description
54 "Set the value to subtract from priority when
55 the tracked interface goes down";
56 }
57 }
58
59 grouping ip-vrrp-tracking-state {
60 description
61 "Operational state data for tracking interfaces in a VRRP
62 group";
63 }
64
65 grouping ip-vrrp-tracking-top {
66 description
67 "Top-level grouping for VRRP interface tracking";
68 container interface-tracking {
69 description
70 "Top-level container for VRRP interface tracking";
71 container config {
72 description
73 "Configuration data for VRRP interface tracking";
74 uses ip-vrrp-tracking-config;
75 }
76
77 container state {
78 config false;
79 description
80 "Operational state data for VRRP interface tracking";
81 uses ip-vrrp-tracking-config;
82
83 uses ip-vrrp-tracking-state;
84 }
85 }
86 }
87
88 grouping ip-vrrp-config {
89 description
90 "Configuration data for VRRP on IP interfaces";
91 leaf virtual-router-id {
92 type uint8 {
93 range "1..255";
94 }
95 description
96 "Set the virtual router id for use by the VRRP group. This
97 usually also determines the virtual MAC address that is
98 generated for the VRRP group";
99 }
100
4d12b27e
QY
101 leaf version {
102 type enumeration {
103 enum "2" {
104 value 2;
105 description
106 "VRRP version 2.";
107 }
108 enum "3" {
109 value 3;
110 description
111 "VRRP version 3.";
112 }
113 }
114 default "3";
115 }
116
21a22f4c
QY
117 leaf priority {
118 type uint8 {
119 range "1..254";
120 }
121 default "100";
122 description
123 "Specifies the sending VRRP interface's priority
124 for the virtual router. Higher values equal higher
125 priority";
126 }
127
128 leaf preempt {
129 type boolean;
130 default "true";
131 description
132 "When set to true, enables preemption by a higher
133 priority backup router of a lower priority master router";
134 }
135
136 leaf accept-mode {
137 type boolean;
138 default "true";
139 description
140 "Configure whether packets destined for
141 virtual addresses are accepted even when the virtual
142 address is not owned by the router interface";
143 }
144
145 leaf advertisement-interval {
146 type uint16 {
147 range "1..4095";
148 }
149 units "centiseconds";
150 default "100";
151 description
152 "Sets the interval between successive VRRP
153 advertisements -- RFC 5798 defines this as a 12-bit
154 value expressed as 0.1 seconds, with default 100, i.e.,
155 1 second. Several implementation express this in units of
156 seconds";
157 }
4d12b27e
QY
158
159 leaf shutdown {
160 type boolean;
161 default "false";
162 description
163 "Administrative shutdown for this VRRP group.";
164 }
21a22f4c
QY
165 }
166
167 grouping ip-vrrp-state {
168 description
e6a70ae8 169 "Grouping for operational state data for a virtual router";
21a22f4c
QY
170 leaf current-priority {
171 type uint8;
2ea09c73 172 config false;
21a22f4c
QY
173 description
174 "Operational value of the priority for the
e6a70ae8
QY
175 interface in the VRRP group.";
176 }
177
178 leaf vrrp-interface {
179 type frr-interface:interface-ref;
180 config false;
181 description
182 "The interface used to transmit VRRP traffic.";
183 }
184
185 leaf source-address {
186 type inet:ip-address;
187 config false;
188 description
189 "The source IP address used for VRRP advertisements.";
190 }
191
192 leaf state {
193 type enumeration {
194 enum "Initialize" {
195 description
196 "State when virtual router is waiting for a Startup event.";
197 }
198 enum "Master" {
199 description
200 "State when virtual router is functioning as the forwarding router
201 for the virtual addresses.";
202 }
203 enum "Backup" {
204 description
205 "State when virtual router is monitoring the availability and state
206 of the Master router.";
207 }
208 }
209 config false;
210 }
211
212 leaf master-advertisement-interval {
213 type uint16 {
214 range "0..4095";
215 }
216 config false;
217 description
218 "Advertisement interval contained in advertisements received from the Master, in milliseconds.";
219 }
220
221 leaf skew-time {
222 type uint16;
223 config false;
224 description
225 "Time to skew Master_Down_Interval, in milliseconds.";
226 }
227
228 container counter {
229 config false;
230 leaf state-transition {
231 type yang:zero-based-counter32;
232 description
233 "Number of state transitions the virtual router has experienced.";
234 }
235
236 container tx {
237 leaf advertisement {
238 type yang:zero-based-counter32;
239 description
240 "Number of sent VRRP advertisements.";
241 }
242 }
243
244 container rx {
245 leaf advertisement {
246 type yang:zero-based-counter32;
247 description
248 "Number of received VRRP advertisements.";
249 }
250 }
21a22f4c
QY
251 }
252 }
253
254 grouping ip-vrrp-top {
255 description
256 "Top-level grouping for Virtual Router Redundancy Protocol";
257 container vrrp {
258 description
259 "Enclosing container for VRRP groups handled by this
260 IP interface";
261 reference
262 "RFC 5798 - Virtual Router Redundancy Protocol
263 (VRRP) Version 3 for IPv4 and IPv6";
264 list vrrp-group {
265 key "virtual-router-id";
266 description
267 "List of VRRP groups, keyed by virtual router id";
2ea09c73 268 uses ip-vrrp-config;
4d12b27e
QY
269
270 container v4 {
e6a70ae8
QY
271 leaf-list virtual-address {
272 type inet:ipv4-address;
273 description
274 "Configure one or more IPv4 virtual addresses for the
275 VRRP group";
276 }
277
278 uses ip-vrrp-state {
279 augment "./counter/tx" {
280 leaf gratuitous-arp {
281 type yang:zero-based-counter32;
282 description
283 "Number of sent gratuitous ARP requests.";
284 }
285 }
286 }
4d12b27e
QY
287 }
288
289 container v6 {
e6a70ae8
QY
290 when "../version = 3";
291 leaf-list virtual-address {
292 type inet:ipv6-address;
293 description
294 "Configure one or more IPv6 virtual addresses for the
295 VRRP group";
296 }
4d12b27e 297
e6a70ae8
QY
298 uses ip-vrrp-state {
299 augment "./counter/tx" {
300 leaf neighbor-advertisement {
301 type yang:zero-based-counter32;
302 description
303 "Number of sent unsolicited Neighbor Advertisements.";
304 }
305 }
306 }
4d12b27e 307 }
21a22f4c
QY
308 }
309 }
310 }
311
312 augment "/frr-interface:lib/frr-interface:interface" {
313 uses ip-vrrp-top;
314 }
315}