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