2 * Copyright 2019-2020 Rubicon Communications, LLC (Netgate)
4 * SPDX-License-Identifier: Apache-2.0
8 option version = "1.1.1";
10 import "vnet/interface_types.api";
11 import "vnet/ip/ip_types.api";
12 import "vnet/ethernet/ethernet_types.api";
16 vl_api_interface_index_t sw_if_index;
23 VRRP_API_VR_PREEMPT = 0x1,
24 VRRP_API_VR_ACCEPT = 0x2,
25 VRRP_API_VR_UNICAST = 0x4,
26 VRRP_API_VR_IPV6 = 0x8,
31 vl_api_interface_index_t sw_if_index;
35 vl_api_vrrp_vr_flags_t flags;
38 /** \brief VRRP: Add or delete a VRRP virtual router
39 @param client_index - opaque cookie to identify the sender
40 @param context - sender context, to match reply w/ request
41 @param is_add - 0 if deleting, != 0 if adding
42 @param sw_if_index - interface backed up by this vr
43 @param vr_id - the VR ID advertised by this vr
44 @param priority - the priority advertised for this vr
45 @param interval - interval between advertisements in centiseconds
46 @param flags - bit flags for booleans - preempt, accept, unicast, ipv6
47 @param n_addrs - number of addresses being backed up by this vr
48 @param addrs - the addresses backed up by this vr
50 autoreply define vrrp_vr_add_del {
54 vl_api_interface_index_t sw_if_index;
58 vl_api_vrrp_vr_flags_t flags;
60 vl_api_address_t addrs[n_addrs];
63 /** @brief Replace an existing VRRP virtual router in-place or create a new one
64 @param client_index - opaque cookie to identify the sender
65 @param context - sender context, to match reply w/ request
66 @param vrrp_index - an existing VRRP entry to replace, or 0xffffffff to crate a new one
67 @param sw_if_index - interface backed up by this vr
68 @param vr_id - the VR ID advertised by this vr
69 @param priority - the priority advertised for this vr
70 @param interval - interval between advertisements in centiseconds
71 @param flags - bit flags for booleans - preempt, accept, unicast, ipv6
72 @param n_addrs - number of addresses being backed up by this vr
73 @param addrs - the addresses backed up by this vr
75 define vrrp_vr_update {
79 vl_api_interface_index_t sw_if_index;
83 vl_api_vrrp_vr_flags_t flags;
85 vl_api_address_t addrs[n_addrs];
89 * @brief Reply to a VRRP add/replace
90 * @param context - returned sender context, to match reply w/ request
91 * @param vrrp_index - index of the updated or newly created VRRP instance
92 * @param retval 0 - no error
94 define vrrp_vr_update_reply {
101 * @brief Delete an existing VRRP instance
102 * @param client_index - opaque cookie to identify the sender
103 * @param context - returned sender context, to match reply w/ request
104 * @param vrrp_index - index of the VRRP instance to delete
106 autoreply define vrrp_vr_del {
112 /** \brief VRRP: dump virtual router data
113 @param client_index - opaque cookie to identify the sender
114 @param context - sender context, to match reply w/ request
115 @param sw_if_index - interface to use as filter (0,~0 == "all")
117 define vrrp_vr_dump {
120 vl_api_interface_index_t sw_if_index;
125 VRRP_API_VR_STATE_INIT = 0,
126 VRRP_API_VR_STATE_BACKUP,
127 VRRP_API_VR_STATE_MASTER,
128 VRRP_API_VR_STATE_INTF_DOWN,
131 typedef vrrp_vr_tracking
137 typedef vrrp_vr_runtime
139 vl_api_vrrp_vr_state_t state;
143 vl_api_mac_address_t mac;
144 vl_api_vrrp_vr_tracking_t tracking;
147 /** \brief VRRP: VR dump response
148 @param context - sender context which was passed in the request
149 @param conf - configuration parameters for the VR
150 @param runtime - runtime state for the VR
152 define vrrp_vr_details {
154 vl_api_vrrp_vr_conf_t config;
155 vl_api_vrrp_vr_runtime_t runtime;
157 vl_api_address_t addrs[n_addrs];
160 /** \brief VRRP: start or shutdown the VRRP protocol for a virtual router
161 @param client_index - opaque cookie to identify the sender
162 @param context - sender context, to match reply w/ request
163 @param sw_if_index - interface ID that VR is backing up
165 @param is_ipv6 - 1 for IPv6, 0 for IPv4
166 @param is_start - 1 to start VRRP proto on this VR, 0 to shutdown
168 autoreply define vrrp_vr_start_stop {
171 vl_api_interface_index_t sw_if_index;
177 /** \brief VRRP: set unicast peers for a VR
178 @param client_index - opaque cookie to identify the sender
179 @param context - sender context, to match reply w/ request
180 @param sw_if_index - interface ID that VR is backing up
182 @param is_ipv6 - 1 for IPv6, 0 for IPv4
183 @param n_addrs - number of peer addresses
184 @param addrs - peer addresses
186 autoreply define vrrp_vr_set_peers {
189 vl_api_interface_index_t sw_if_index;
193 vl_api_address_t addrs[n_addrs];
196 /** \brief VRRP: dump virtual router peer address data
197 @param client_index - opaque cookie to identify the sender
198 @param context - sender context, to match reply w/ request
199 @param sw_if_index - interface (0,~0 == "all" -> ignore is_ipv6 & vr_id))
200 @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
201 @param vr_id - ID of VR to dump
203 define vrrp_vr_peer_dump {
206 vl_api_interface_index_t sw_if_index;
211 /** \brief VRRP: VR peer dump response
212 @param context - sender context which was passed in the request
213 @param sw_if_index - interface index
214 @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
215 @param vr_id - ID of VR
216 @param n_peer_addrs - number of peer addresses
217 @param peer_addrs - peer addresses
219 define vrrp_vr_peer_details {
222 vl_api_interface_index_t sw_if_index;
226 vl_api_address_t peer_addrs[n_peer_addrs];
229 /** \brief VR interface tracking
230 @param sw_if_index - the interface index to track (not the VR sw_if_index)
231 @param priority - the adjustment to VR priority if intf is down
233 typedef vrrp_vr_track_if
235 vl_api_interface_index_t sw_if_index;
239 /** \brief VRRP: Add/delete VR priority tracking of interface status
240 @param context - sender context which was passed in the request
241 @param sw_if_index - interface index
242 @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
243 @param vr_id - ID of VR
244 @param is_add - 0 -> delete, 1 -> add
245 @param n_ifs - number of interface tracking records
246 @param ifs - array of interface tracking records
248 autoreply define vrrp_vr_track_if_add_del
252 vl_api_interface_index_t sw_if_index;
257 vl_api_vrrp_vr_track_if_t ifs[n_ifs];
260 /** \brief VRRP: dump virtual router interface tracking data
261 @param client_index - opaque cookie to identify the sender
262 @param context - sender context, to match reply w/ request
263 @param sw_if_index - interface
264 @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
265 @param vr_id - ID of VR to dump
266 @param dump_all - dump all VR interface tracking, ignore other fields
268 define vrrp_vr_track_if_dump {
271 vl_api_interface_index_t sw_if_index;
277 /** \brief VRRP: VR interface tracking dump response
278 @param context - sender context which was passed in the request
279 @param sw_if_index - interface index
280 @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
281 @param vr_id - ID of VR
282 @param n_ifs - number of tracked interfaces
283 @param ifs - array of tracked interface data
285 define vrrp_vr_track_if_details {
288 vl_api_interface_index_t sw_if_index;
292 vl_api_vrrp_vr_track_if_t ifs[n_ifs];
295 /** \brief Notification about VRRP VR state change event
296 @param client_index - opaque cookie to identify the sender
297 @param pid - client pid registered to receive notification
298 @param vr - configuration parameters identifying the VR
299 @param old_state - old state of VR
300 @param new_state - new state of VR
306 vl_api_vrrp_vr_key_t vr;
307 vl_api_vrrp_vr_state_t old_state;
308 vl_api_vrrp_vr_state_t new_state;
312 rpc want_vrrp_vr_events returns want_vrrp_vr_events_reply
313 events vrrp_vr_event;
316 /** \brief Register for VRRP VR state change events
317 @param client_index - opaque cookie to identify the sender
318 @param context - sender context, to match reply w/ request
319 @param enable_disable - 1 to register, 0 to cancel registration
320 @param pid - sender's pid
322 autoreply define want_vrrp_vr_events