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