]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-vrrpd.yang
Merge pull request #6114 from rgirada/frr-static
[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 advertisement-interval {
114 type uint16 {
115 range "1..4095";
116 }
117 units "centiseconds";
118 default "100";
119 description
120 "Sets the interval between successive VRRP
121 advertisements -- RFC 5798 defines this as a 12-bit
122 value expressed as 0.1 seconds, with default 100, i.e.,
123 1 second. Several implementation express this in units of
124 seconds";
125 }
126
127 leaf shutdown {
128 type boolean;
129 default "false";
130 description
131 "Administrative shutdown for this VRRP group.";
132 }
133 }
134
135 grouping ip-vrrp-state {
136 description
137 "Grouping for operational state data for a virtual router";
138 leaf current-priority {
139 type uint8;
140 config false;
141 description
142 "Operational value of the priority for the
143 interface in the VRRP group.";
144 }
145
146 leaf vrrp-interface {
147 type frr-interface:interface-ref;
148 config false;
149 description
150 "The interface used to transmit VRRP traffic.";
151 }
152
153 leaf source-address {
154 type inet:ip-address;
155 config false;
156 description
157 "The source IP address used for VRRP advertisements.";
158 }
159
160 leaf state {
161 type enumeration {
162 enum "Initialize" {
163 description
164 "State when virtual router is waiting for a Startup event.";
165 }
166 enum "Master" {
167 description
168 "State when virtual router is functioning as the forwarding router
169 for the virtual addresses.";
170 }
171 enum "Backup" {
172 description
173 "State when virtual router is monitoring the availability and state
174 of the Master router.";
175 }
176 }
177 config false;
178 }
179
180 leaf master-advertisement-interval {
181 type uint16 {
182 range "0..4095";
183 }
184 units "centiseconds";
185 config false;
186 description
187 "Advertisement interval contained in advertisements received from the Master.";
188 }
189
190 leaf skew-time {
191 type uint16;
192 units "centiseconds";
193 config false;
194 description
195 "Time to skew Master_Down_Interval.";
196 }
197
198 container counter {
199 config false;
200 leaf state-transition {
201 type yang:zero-based-counter32;
202 description
203 "Number of state transitions the virtual router has experienced.";
204 }
205
206 container tx {
207 leaf advertisement {
208 type yang:zero-based-counter32;
209 description
210 "Number of sent VRRP advertisements.";
211 }
212 }
213
214 container rx {
215 leaf advertisement {
216 type yang:zero-based-counter32;
217 description
218 "Number of received VRRP advertisements.";
219 }
220 }
221 }
222 }
223
224 grouping ip-vrrp-top {
225 description
226 "Top-level grouping for Virtual Router Redundancy Protocol";
227 container vrrp {
228 description
229 "Enclosing container for VRRP groups handled by this
230 IP interface";
231 reference
232 "RFC 5798 - Virtual Router Redundancy Protocol
233 (VRRP) Version 3 for IPv4 and IPv6";
234 list vrrp-group {
235 key "virtual-router-id";
236 description
237 "List of VRRP groups, keyed by virtual router id";
238 uses ip-vrrp-config;
239
240 container v4 {
241 leaf-list virtual-address {
242 type inet:ipv4-address;
243 description
244 "Configure one or more IPv4 virtual addresses for the
245 VRRP group";
246 }
247
248 uses ip-vrrp-state {
249 augment "./counter/tx" {
250 leaf gratuitous-arp {
251 type yang:zero-based-counter32;
252 description
253 "Number of sent gratuitous ARP requests.";
254 }
255 }
256 }
257 }
258
259 container v6 {
260 when "../version = 3";
261 leaf-list virtual-address {
262 type inet:ipv6-address;
263 description
264 "Configure one or more IPv6 virtual addresses for the
265 VRRP group";
266 }
267
268 uses ip-vrrp-state {
269 augment "./counter/tx" {
270 leaf neighbor-advertisement {
271 type yang:zero-based-counter32;
272 description
273 "Number of sent unsolicited Neighbor Advertisements.";
274 }
275 }
276 }
277 }
278 }
279 }
280 }
281
282 augment "/frr-interface:lib/frr-interface:interface" {
283 uses ip-vrrp-top;
284 }
285 }