FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
vrrp.api
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2020 Rubicon Communications, LLC (Netgate)
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  */
7 
8 option version = "1.0.1";
9 
10 import "vnet/interface_types.api";
11 import "vnet/ip/ip_types.api";
12 import "vnet/ethernet/ethernet_types.api";
13 
14 typedef vrrp_vr_key
15 {
16  vl_api_interface_index_t sw_if_index;
19 };
20 
22 {
27 };
28 
29 typedef vrrp_vr_conf
30 {
31  vl_api_interface_index_t sw_if_index;
32  u8 vr_id;
35  vl_api_vrrp_vr_flags_t flags;
36 };
37 
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
49 */
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];
61 };
62 
63 /** \brief VRRP: dump virtual router data
64  @param client_index - opaque cookie to identify the sender
65  @param context - sender context, to match reply w/ request
66  @param sw_if_index - interface to use as filter (0,~0 == "all")
67 */
68 define vrrp_vr_dump {
71  vl_api_interface_index_t sw_if_index;
72 };
73 
75 {
80 };
81 
82 typedef vrrp_vr_tracking
83 {
84  u32 interfaces_dec;
85  u8 priority;
86 };
87 
88 typedef vrrp_vr_runtime
89 {
90  vl_api_vrrp_vr_state_t state;
94  vl_api_mac_address_t mac;
95  vl_api_vrrp_vr_tracking_t tracking;
96 };
97 
98 /** \brief VRRP: VR dump response
99  @param context - sender context which was passed in the request
100  @param conf - configuration parameters for the VR
101  @param runtime - runtime state for the VR
102 */
103 define vrrp_vr_details {
105  vl_api_vrrp_vr_conf_t config;
106  vl_api_vrrp_vr_runtime_t runtime;
108  vl_api_address_t addrs[n_addrs];
109 };
110 
111 /** \brief VRRP: start or shutdown the VRRP protocol for a virtual router
112  @param client_index - opaque cookie to identify the sender
113  @param context - sender context, to match reply w/ request
114  @param sw_if_index - interface ID that VR is backing up
115  @param vr_id - VR ID
116  @param is_ipv6 - 1 for IPv6, 0 for IPv4
117  @param is_start - 1 to start VRRP proto on this VR, 0 to shutdown
118 */
119 autoreply define vrrp_vr_start_stop {
122  vl_api_interface_index_t sw_if_index;
126 };
127 
128 /** \brief VRRP: set unicast peers for a VR
129  @param client_index - opaque cookie to identify the sender
130  @param context - sender context, to match reply w/ request
131  @param sw_if_index - interface ID that VR is backing up
132  @param vr_id - VR ID
133  @param is_ipv6 - 1 for IPv6, 0 for IPv4
134  @param n_addrs - number of peer addresses
135  @param addrs - peer addresses
136 */
137 autoreply define vrrp_vr_set_peers {
140  vl_api_interface_index_t sw_if_index;
144  vl_api_address_t addrs[n_addrs];
145 };
146 
147 /** \brief VRRP: dump virtual router peer address data
148  @param client_index - opaque cookie to identify the sender
149  @param context - sender context, to match reply w/ request
150  @param sw_if_index - interface (0,~0 == "all" -> ignore is_ipv6 & vr_id))
151  @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
152  @param vr_id - ID of VR to dump
153 */
154 define vrrp_vr_peer_dump {
157  vl_api_interface_index_t sw_if_index;
160 };
161 
162 /** \brief VRRP: VR peer dump response
163  @param context - sender context which was passed in the request
164  @param sw_if_index - interface index
165  @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
166  @param vr_id - ID of VR
167  @param n_peer_addrs - number of peer addresses
168  @param peer_addrs - peer addresses
169 */
170 define vrrp_vr_peer_details {
173  vl_api_interface_index_t sw_if_index;
177  vl_api_address_t peer_addrs[n_peer_addrs];
178 };
179 
180 /** \brief VR interface tracking
181  @param sw_if_index - the interface index to track (not the VR sw_if_index)
182  @param priority - the adjustment to VR priority if intf is down
183 */
184 typedef vrrp_vr_track_if
185 {
186  vl_api_interface_index_t sw_if_index;
187  u8 priority;
188 };
189 
190 /** \brief VRRP: Add/delete VR priority tracking of interface status
191  @param context - sender context which was passed in the request
192  @param sw_if_index - interface index
193  @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
194  @param vr_id - ID of VR
195  @param is_add - 0 -> delete, 1 -> add
196  @param n_ifs - number of interface tracking records
197  @param ifs - array of interface tracking records
198 */
199 autoreply define vrrp_vr_track_if_add_del
200 {
203  vl_api_interface_index_t sw_if_index;
208  vl_api_vrrp_vr_track_if_t ifs[n_ifs];
209 };
210 
211 /** \brief VRRP: dump virtual router interface tracking data
212  @param client_index - opaque cookie to identify the sender
213  @param context - sender context, to match reply w/ request
214  @param sw_if_index - interface
215  @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
216  @param vr_id - ID of VR to dump
217  @param dump_all - dump all VR interface tracking, ignore other fields
218 */
219 define vrrp_vr_track_if_dump {
222  vl_api_interface_index_t sw_if_index;
226 };
227 
228 /** \brief VRRP: VR interface tracking dump response
229  @param context - sender context which was passed in the request
230  @param sw_if_index - interface index
231  @param is_ipv6 - 0 -> IPv4, 1 -> IPv6
232  @param vr_id - ID of VR
233  @param n_ifs - number of tracked interfaces
234  @param ifs - array of tracked interface data
235 */
236 define vrrp_vr_track_if_details {
239  vl_api_interface_index_t sw_if_index;
243  vl_api_vrrp_vr_track_if_t ifs[n_ifs];
244 };
245 
246 /** \brief Notification about VRRP VR state change event
247  @param client_index - opaque cookie to identify the sender
248  @param pid - client pid registered to receive notification
249  @param vr - configuration parameters identifying the VR
250  @param old_state - old state of VR
251  @param new_state - new state of VR
252 */
254 {
257  vl_api_vrrp_vr_key_t vr;
258  vl_api_vrrp_vr_state_t old_state;
259  vl_api_vrrp_vr_state_t new_state;
260 };
261 
263  rpc want_vrrp_vr_events returns want_vrrp_vr_events_reply
265 };
266 
267 /** \brief Register for VRRP VR state change events
268  @param client_index - opaque cookie to identify the sender
269  @param context - sender context, to match reply w/ request
270  @param enable_disable - 1 to register, 0 to cancel registration
271  @param pid - sender's pid
272 */
273 autoreply define want_vrrp_vr_events
274 {
279 };
vl_api_vrrp_vr_set_peers_t
VRRP: set unicast peers for a VR.
Definition: vrrp.api:137
flags
vl_api_vrrp_vr_flags_t flags
Definition: vrrp.api:35
vl_api_vrrp_vr_peer_details_t::context
u32 context
Definition: vrrp.api:172
vl_api_vrrp_vr_event_t
Notification about VRRP VR state change event.
Definition: vrrp.api:253
vl_api_vrrp_vr_details_t::context
u32 context
Definition: vrrp.api:104
vl_api_vrrp_vr_add_del_t::interval
u16 interval
Definition: vrrp.api:57
vl_api_vrrp_vr_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:54
mac
vl_api_mac_address_t mac
Definition: vrrp.api:94
vl_api_vrrp_vr_peer_dump_t::vr_id
u8 vr_id
Definition: vrrp.api:159
vl_api_vrrp_vr_track_if_dump_t::context
u32 context
Definition: vrrp.api:221
vl_api_vrrp_vr_track_if_add_del_t::context
u32 context
Definition: vrrp.api:202
VRRP_API_VR_ACCEPT
@ VRRP_API_VR_ACCEPT
Definition: vrrp.api:24
vl_api_want_vrrp_vr_events_t::enable_disable
bool enable_disable
Definition: vrrp.api:277
vrrp_vr_flags
vrrp_vr_flags
Definition: vrrp.api:21
vl_api_vrrp_vr_peer_details_t::n_peer_addrs
u8 n_peer_addrs
Definition: vrrp.api:176
vl_api_want_vrrp_vr_events_t
Register for VRRP VR state change events.
Definition: vrrp.api:273
vl_api_vrrp_vr_add_del_t::client_index
u32 client_index
Definition: vrrp.api:51
vl_api_want_vrrp_vr_events_t::context
u32 context
Definition: vrrp.api:276
vl_api_vrrp_vr_track_if_details_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:241
vl_api_vrrp_vr_track_if_add_del_t::is_add
u8 is_add
Definition: vrrp.api:206
vl_api_vrrp_vr_track_if_add_del_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:204
vrrp_vr_event
void vrrp_vr_event(vrrp_vr_t *vr, vrrp_vr_state_t new_state)
Definition: vrrp_api.c:507
vl_api_vrrp_vr_peer_details_t::peer_addrs
vl_api_address_t peer_addrs[n_peer_addrs]
Definition: vrrp.api:177
vl_api_vrrp_vr_add_del_t
VRRP: Add or delete a VRRP virtual router.
Definition: vrrp.api:50
VRRP_API_VR_STATE_BACKUP
@ VRRP_API_VR_STATE_BACKUP
Definition: vrrp.api:77
vl_api_vrrp_vr_set_peers_t::client_index
u32 client_index
Definition: vrrp.api:138
vl_api_vrrp_vr_track_if_add_del_t::n_ifs
u8 n_ifs
Definition: vrrp.api:207
vl_api_vrrp_vr_track_if_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:203
vl_api_vrrp_vr_dump_t::client_index
u32 client_index
Definition: vrrp.api:69
vl_api_want_vrrp_vr_events_t::pid
u32 pid
Definition: vrrp.api:278
vl_api_vrrp_vr_track_if_add_del_t::ifs
vl_api_vrrp_vr_track_if_t ifs[n_ifs]
Definition: vrrp.api:208
u16
unsigned short u16
Definition: types.h:57
state
vl_api_dhcp_client_state_t state
Definition: dhcp.api:201
vl_api_vrrp_vr_track_if_details_t::context
u32 context
Definition: vrrp.api:238
vl_api_vrrp_vr_track_if_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:239
vl_api_vrrp_vr_event_t::old_state
vl_api_vrrp_vr_state_t old_state
Definition: vrrp.api:258
vl_api_vrrp_vr_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:71
vl_api_vrrp_vr_add_del_t::priority
u8 priority
Definition: vrrp.api:56
VRRP_API_VR_STATE_MASTER
@ VRRP_API_VR_STATE_MASTER
Definition: vrrp.api:78
vl_api_vrrp_vr_peer_details_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:175
vl_api_vrrp_vr_track_if_details_t
VRRP: VR interface tracking dump response.
Definition: vrrp.api:236
vl_api_vrrp_vr_peer_dump_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:158
vl_api_vrrp_vr_start_stop_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:124
vr_id
u8 vr_id
Definition: vrrp.api:17
vl_api_vrrp_vr_peer_dump_t
VRRP: dump virtual router peer address data.
Definition: vrrp.api:154
vl_api_vrrp_vr_track_if_dump_t::client_index
u32 client_index
Definition: vrrp.api:220
VRRP_API_VR_STATE_INTF_DOWN
@ VRRP_API_VR_STATE_INTF_DOWN
Definition: vrrp.api:79
VRRP_API_VR_STATE_INIT
@ VRRP_API_VR_STATE_INIT
Definition: vrrp.api:76
vl_api_vrrp_vr_details_t::config
vl_api_vrrp_vr_conf_t config
Definition: vrrp.api:105
vrrp_vr_track_if
typedef vrrp_vr_track_if
VR interface tracking.
Definition: vrrp.api:185
vl_api_vrrp_vr_peer_dump_t::client_index
u32 client_index
Definition: vrrp.api:155
vl_api_want_vrrp_vr_events_t::client_index
u32 client_index
Definition: vrrp.api:275
vl_api_vrrp_vr_details_t::addrs
vl_api_address_t addrs[n_addrs]
Definition: vrrp.api:108
vl_api_vrrp_vr_details_t::n_addrs
u8 n_addrs
Definition: vrrp.api:107
vrrp_vr_tracking
Definition: vrrp.h:63
vl_api_vrrp_vr_event_t::vr
vl_api_vrrp_vr_key_t vr
Definition: vrrp.api:257
vl_api_vrrp_vr_set_peers_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:142
vl_api_vrrp_vr_details_t
VRRP: VR dump response.
Definition: vrrp.api:103
vl_api_vrrp_vr_peer_details_t::vr_id
u8 vr_id
Definition: vrrp.api:174
vrrp_vr_set_peers
int vrrp_vr_set_peers(vrrp_vr_key_t *vr_key, ip46_address_t *peers)
Definition: vrrp.c:803
vl_api_vrrp_vr_start_stop_t::is_start
u8 is_start
Definition: vrrp.api:125
VRRP_API_VR_PREEMPT
@ VRRP_API_VR_PREEMPT
Definition: vrrp.api:23
vl_api_vrrp_vr_set_peers_t::context
u32 context
Definition: vrrp.api:139
service
service
Definition: vrrp.api:262
vl_api_vrrp_vr_start_stop_t::vr_id
u8 vr_id
Definition: vrrp.api:123
vl_api_vrrp_vr_set_peers_t::addrs
vl_api_address_t addrs[n_addrs]
Definition: vrrp.api:144
events
static perfmon_event_t events[]
Definition: core.c:21
vl_api_vrrp_vr_peer_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:157
vl_api_vrrp_vr_track_if_dump_t
VRRP: dump virtual router interface tracking data.
Definition: vrrp.api:219
priority
u8 priority
Definition: vrrp.api:33
vl_api_vrrp_vr_event_t::client_index
u32 client_index
Definition: vrrp.api:255
interval
u16 interval
Definition: vrrp.api:34
vl_api_vrrp_vr_peer_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:173
vl_api_vrrp_vr_track_if_dump_t::vr_id
u8 vr_id
Definition: vrrp.api:224
vl_api_vrrp_vr_track_if_details_t::n_ifs
u8 n_ifs
Definition: vrrp.api:242
vl_api_vrrp_vr_track_if_details_t::ifs
vl_api_vrrp_vr_track_if_t ifs[n_ifs]
Definition: vrrp.api:243
vl_api_vrrp_vr_track_if_add_del_t::client_index
u32 client_index
Definition: vrrp.api:201
vl_api_vrrp_vr_add_del_t::vr_id
u8 vr_id
Definition: vrrp.api:55
vl_api_vrrp_vr_add_del_t::flags
vl_api_vrrp_vr_flags_t flags
Definition: vrrp.api:58
vl_api_vrrp_vr_track_if_dump_t::dump_all
u8 dump_all
Definition: vrrp.api:225
vl_api_vrrp_vr_set_peers_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:140
vrrp_vr_key
Definition: vrrp.h:29
vl_api_vrrp_vr_start_stop_t::client_index
u32 client_index
Definition: vrrp.api:120
vl_api_vrrp_vr_track_if_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:222
u32
unsigned int u32
Definition: types.h:88
vl_api_vrrp_vr_set_peers_t::n_addrs
u8 n_addrs
Definition: vrrp.api:143
vl_api_vrrp_vr_track_if_details_t::vr_id
u8 vr_id
Definition: vrrp.api:240
vl_api_vrrp_vr_dump_t
VRRP: dump virtual router data.
Definition: vrrp.api:68
vl_api_vrrp_vr_dump_t::context
u32 context
Definition: vrrp.api:70
vl_api_vrrp_vr_event_t::new_state
vl_api_vrrp_vr_state_t new_state
Definition: vrrp.api:259
vl_api_vrrp_vr_track_if_dump_t::is_ipv6
u8 is_ipv6
Definition: vrrp.api:223
skew
u16 skew
Definition: vrrp.api:92
vl_api_vrrp_vr_start_stop_t::context
u32 context
Definition: vrrp.api:121
vrrp_vr_runtime
Definition: vrrp.h:94
vl_api_vrrp_vr_peer_dump_t::context
u32 context
Definition: vrrp.api:156
vl_api_vrrp_vr_add_del_t::context
u32 context
Definition: vrrp.api:52
u8
unsigned char u8
Definition: types.h:56
vl_api_vrrp_vr_start_stop_t
VRRP: start or shutdown the VRRP protocol for a virtual router.
Definition: vrrp.api:119
master_adv_int
u16 master_adv_int
Definition: vrrp.api:91
vrrp_vr_start_stop
int vrrp_vr_start_stop(u8 is_start, vrrp_vr_key_t *vr_key)
Definition: vrrp.c:710
vrrp_vr_conf
typedef vrrp_vr_conf
Definition: vrrp.api:30
vl_api_vrrp_vr_track_if_add_del_t
VRRP: Add/delete VR priority tracking of interface status.
Definition: vrrp.api:199
vl_api_vrrp_vr_add_del_t::is_add
u8 is_add
Definition: vrrp.api:53
VRRP_API_VR_IPV6
@ VRRP_API_VR_IPV6
Definition: vrrp.api:26
master_down_int
u16 master_down_int
Definition: vrrp.api:93
vl_api_vrrp_vr_add_del_t::n_addrs
u8 n_addrs
Definition: vrrp.api:59
vl_api_vrrp_vr_add_del_t::addrs
vl_api_address_t addrs[n_addrs]
Definition: vrrp.api:60
vrrp_vr_state
vrrp_vr_state
Definition: vrrp.api:74
vl_api_vrrp_vr_track_if_add_del_t::vr_id
u8 vr_id
Definition: vrrp.api:205
vl_api_vrrp_vr_peer_details_t::client_index
u32 client_index
Definition: vrrp.api:171
vrrp_vr_add_del
int vrrp_vr_add_del(u8 is_add, vrrp_vr_config_t *vr_conf)
Definition: vrrp.c:622
VRRP_API_VR_UNICAST
@ VRRP_API_VR_UNICAST
Definition: vrrp.api:25
vl_api_vrrp_vr_start_stop_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: vrrp.api:122
vl_api_vrrp_vr_peer_details_t
VRRP: VR peer dump response.
Definition: vrrp.api:170
vl_api_vrrp_vr_set_peers_t::vr_id
u8 vr_id
Definition: vrrp.api:141
tracking
vl_api_vrrp_vr_tracking_t tracking
Definition: vrrp.api:95
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_vrrp_vr_details_t::runtime
vl_api_vrrp_vr_runtime_t runtime
Definition: vrrp.api:106
vl_api_vrrp_vr_track_if_details_t::client_index
u32 client_index
Definition: vrrp.api:237
is_ipv6
u8 is_ipv6
Definition: vrrp.api:18
vl_api_vrrp_vr_event_t::pid
u32 pid
Definition: vrrp.api:256
version
option version
Definition: vrrp.api:8