FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
igmp.api
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  *------------------------------------------------------------------
4  * Copyright (c) 2017 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *------------------------------------------------------------------
17  */
18 
19 option version = "1.0.0";
20 import "vnet/ip/ip_types.api";
21 import "vnet/interface_types.api";
22 
23 /**
24  * @brief Filter mode
25  */
27  EXCLUDE = 0,
28  INCLUDE = 1,
29 };
30 
31 
32 /**
33  * @brief
34  * Used by a 'host' to enable the reception/listening of packets for a specific
35  * multicast group
36  *
37  * For each socket on which IPMulticastListen has been invoked, the
38  * system records the desired multicast reception state for that socket.
39  * That state conceptually consists of a set of records of the form:
40  *
41  * (interface, multicast-address, filter-mode, source-list)
42  *
43  * The socket state evolves in response to each invocation of
44  * IPMulticastListen on the socket, as follows:
45  *
46  * o If the requested filter mode is INCLUDE *and* the requested source
47  * list is empty, then the entry corresponding to the requested
48  * interface and multicast address is deleted if present. If no such
49  * entry is present, the request is ignored.
50  *
51  * o If the requested filter mode is EXCLUDE *or* the requested source
52  * list is non-empty, then the entry corresponding to the requested
53  * interface and multicast address, if present, is changed to contain
54  * the requested filter mode and source list. If no such entry is
55  * present, a new entry is created, using the parameters specified in
56  * the request.
57  *
58  * @param client_index - opaque cookie to identify the sender
59  * @param context - sender context, to match reply w/ request
60  * @param sw_if_index - interface sw index
61  * @param filter - filter mode
62  * @param saddr - source address
63  * @param gaddr - group address
64  */
65 typedef igmp_group
66 {
67  vl_api_filter_mode_t filter;
69  vl_api_interface_index_t sw_if_index;
70  vl_api_ip4_address_t gaddr;
71  vl_api_ip4_address_t saddrs[n_srcs];
72 };
73 autoreply define igmp_listen
74 {
77 
78  vl_api_igmp_group_t group;
79 };
80 
81 /**
82  * @brief
83  * Used by a 'router' and 'host' to enable the reception of IGMP packets.
84  * For hosts this must be called once before igmp_listen.
85  *
86  * @param client_index - opaque cookie to identify the sender
87  * @param context - sender context, to match reply w/ request
88  * @param enable - if set, enable igmp messages on configuration
89  * @param mode - Host (1) or router (0) mode
90  * @param sw_if_index - interface sw index
91  */
92 autoreply define igmp_enable_disable
93 {
96 
97  bool enable;
99  vl_api_interface_index_t sw_if_index;
100 };
101 
102 /**
103  * @brief
104  * Add/del proxy device on specified VRF.
105  * Interface must be IGMP enabled in HOST mode.
106  *
107  * @param client_index - opaque cookie to identify the sender
108  * @param context - sender context, to match reply w/ request
109  * @param add - add (1) del (0)
110  * @param vrf_id - VRF id
111  * @param sw_if_index - upstream interface sw index
112  */
114 {
117 
120  vl_api_interface_index_t sw_if_index;
121 };
122 
123 /**
124  * @brief
125  * Add/del downstream interface to/from proxy device.
126  * Interface must be IGMP enabled in ROUTER mode.
127  *
128  * @param client_index - opaque cookie to identify the sender
129  * @param context - sender context, to match reply w/ request
130  * @param add - add (1) del (0)
131  * @param vrf_id - VRF id
132  * @param sw_if_index - downstream interface sw index
133  */
135 {
138 
139  bool add;
141  vl_api_interface_index_t sw_if_index;
142 };
143 
144 /**
145  * @brief dump (S,G)s from interface
146  * @param client_index - opaque cookie to identify the sender
147  * @param context - sender context, to match reply w/ request
148  * @param sw_if_index - interface sw index (~0 for all)
149 */
150 define igmp_dump
151 {
154 
155  vl_api_interface_index_t sw_if_index;
156 };
157 
158 /**
159  * @brief igmp details
160  * @param context - sender context, to match reply w/ request
161  * @param sw_if_index - interface sw index
162  * @param saddr - source address
163  * @param gaddr - group address
164  */
165 define igmp_details
166 {
168 
169  vl_api_interface_index_t sw_if_index;
170  vl_api_ip4_address_t saddr;
171  vl_api_ip4_address_t gaddr;
172 };
173 
174 /** \brief remove all (S,G)s from an interface
175  @param client_index - opaque cookie to identify the sender
176  @param context - sender context, to match reply w/ request
177  @param sw_if_index - interface sw index
178 */
179 autoreply define igmp_clear_interface
180 {
183 
184  vl_api_interface_index_t sw_if_index;
185 };
186 
187 /**
188  * @brief register for igmp events
189  * @param client_index - opaque cookie to identify the sender
190  * @param context - sender context, to match reply w/ request
191  * @param pid - sender's pid
192  * @param enable - 1 enable, 0 disable igmp events
193  */
194 autoreply define want_igmp_events
195 {
198 
201 };
202 
204  rpc want_igmp_events returns want_igmp_events_reply
206 };
207 
208 /**
209  * @brief igmp event details
210  * @param client_index - opaque cookie to identify the sender
211  * @param context - sender context, to match reply w/ request
212  * @param sw_if_index - interface sw index
213  * @param saddr - source address
214  * @param gaddr - group address
215  *@param filter - filter mode
216  */
218 {
219  vl_api_interface_index_t sw_if_index;
220  vl_api_filter_mode_t filter;
221  vl_api_ip4_address_t saddr;
222  vl_api_ip4_address_t gaddr;
223 };
224 
225 /**
226  * @brief enum to specify either ASM or SSM semantics
227  */
229 {
230  ASM = 0,
231  SSM = 1,
232 };
233 
234 /**
235  * @brief Definition of a Group prefix and its type
236  */
237 typedef group_prefix
238 {
239  vl_api_group_prefix_type_t type;
240  vl_api_prefix_t prefix;
241 };
242 
243 /**
244  * @brief Configure a prefix for SSM or ASM semantics
245  * @param address - Prefix address
246  * @param address_length - Prefix length
247  */
248 autoreply define igmp_group_prefix_set
249 {
252 
253  vl_api_group_prefix_t gp;
254 };
255 
256 define igmp_group_prefix_dump
257 {
260 };
261 
262 define igmp_group_prefix_details
263 {
265 
266  vl_api_group_prefix_t gp;
267 };
268 
269 
270 /*
271  * Local Variables:
272  * eval: (c-set-style "gnu")
273  * End:
274  */
vl_api_want_igmp_events_t
register for igmp events
Definition: igmp.api:194
EXCLUDE
@ EXCLUDE
Definition: igmp.api:27
vl_api_igmp_enable_disable_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:99
version
option version
Definition: igmp.api:19
vl_api_igmp_details_t::saddr
vl_api_ip4_address_t saddr
Definition: igmp.api:170
vl_api_igmp_group_prefix_details_t::context
u32 context
Definition: igmp.api:264
vl_api_want_igmp_events_t::client_index
u32 client_index
Definition: igmp.api:196
SSM
@ SSM
Definition: igmp.api:231
vl_api_igmp_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:169
vl_api_igmp_clear_interface_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:184
vl_api_igmp_listen_t::client_index
u32 client_index
Definition: igmp.api:75
vl_api_igmp_listen_t
Definition: igmp.api:73
vl_api_igmp_proxy_device_add_del_interface_t
Add/del downstream interface to/from proxy device.
Definition: igmp.api:134
vl_api_igmp_group_prefix_dump_t
Definition: igmp.api:256
vl_api_igmp_proxy_device_add_del_t::vrf_id
u32 vrf_id
Definition: igmp.api:119
vl_api_igmp_proxy_device_add_del_interface_t::vrf_id
u32 vrf_id
Definition: igmp.api:140
service
service
Definition: igmp.api:203
vl_api_igmp_proxy_device_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:120
vl_api_igmp_group_prefix_details_t
Definition: igmp.api:262
vl_api_igmp_clear_interface_t::context
u32 context
Definition: igmp.api:182
group_prefix
typedef group_prefix
Definition of a Group prefix and its type.
Definition: igmp.api:238
n_srcs
u8 n_srcs
Definition: igmp.api:68
vl_api_igmp_group_prefix_details_t::gp
vl_api_group_prefix_t gp
Definition: igmp.api:266
vl_api_igmp_proxy_device_add_del_interface_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:141
vl_api_igmp_group_prefix_set_t
Configure a prefix for SSM or ASM semantics.
Definition: igmp.api:248
vl_api_igmp_event_t::filter
vl_api_filter_mode_t filter
Definition: igmp.api:220
prefix
vl_api_prefix_t prefix
Definition: igmp.api:240
vl_api_igmp_proxy_device_add_del_t::add
u8 add
Definition: igmp.api:118
vl_api_igmp_enable_disable_t::mode
u8 mode
Definition: igmp.api:98
events
static perfmon_event_t events[]
Definition: core.c:21
vl_api_igmp_dump_t
dump (S,G)s from interface
Definition: igmp.api:150
vl_api_igmp_proxy_device_add_del_interface_t::context
u32 context
Definition: igmp.api:137
vl_api_igmp_group_prefix_set_t::gp
vl_api_group_prefix_t gp
Definition: igmp.api:253
vl_api_igmp_event_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:219
vl_api_want_igmp_events_t::context
u32 context
Definition: igmp.api:197
vl_api_igmp_event_t
igmp event details
Definition: igmp.api:217
vl_api_igmp_group_prefix_dump_t::context
u32 context
Definition: igmp.api:259
vl_api_igmp_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:155
vl_api_igmp_details_t
igmp details
Definition: igmp.api:165
vl_api_igmp_enable_disable_t
Used by a 'router' and 'host' to enable the reception of IGMP packets.
Definition: igmp.api:92
vl_api_igmp_details_t::context
u32 context
Definition: igmp.api:167
vl_api_igmp_proxy_device_add_del_t
Add/del proxy device on specified VRF.
Definition: igmp.api:113
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: igmp.api:69
vl_api_igmp_dump_t::client_index
u32 client_index
Definition: igmp.api:152
igmp_listen
int igmp_listen(vlib_main_t *vm, igmp_filter_mode_t mode, u32 sw_if_index, const ip46_address_t *saddrs, const ip46_address_t *gaddr)
igmp listen Called by a host to request reception of multicast packets
Definition: igmp.c:133
igmp_proxy_device_add_del
int igmp_proxy_device_add_del(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del.
Definition: igmp_proxy.c:80
igmp_proxy_device_add_del_interface
int igmp_proxy_device_add_del_interface(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del interface.
Definition: igmp_proxy.c:141
vl_api_igmp_group_prefix_set_t::context
u32 context
Definition: igmp.api:251
INCLUDE
@ INCLUDE
Definition: igmp.api:28
saddrs
vl_api_ip4_address_t saddrs[n_srcs]
Definition: igmp.api:71
igmp_group_prefix_set
void igmp_group_prefix_set(const fib_prefix_t *pfx, igmp_group_prefix_type_t type)
Definition: igmp_ssm_range.c:50
u32
unsigned int u32
Definition: types.h:88
vl_api_igmp_enable_disable_t::enable
bool enable
Definition: igmp.api:97
group_prefix_type
group_prefix_type
enum to specify either ASM or SSM semantics
Definition: igmp.api:228
gaddr
vl_api_ip4_address_t gaddr
Definition: igmp.api:70
vl_api_want_igmp_events_t::pid
u32 pid
Definition: igmp.api:200
vl_api_igmp_enable_disable_t::context
u32 context
Definition: igmp.api:95
vl_api_igmp_group_prefix_dump_t::client_index
u32 client_index
Definition: igmp.api:258
vl_api_igmp_proxy_device_add_del_interface_t::add
bool add
Definition: igmp.api:139
vl_api_igmp_proxy_device_add_del_t::client_index
u32 client_index
Definition: igmp.api:115
vl_api_igmp_listen_t::context
u32 context
Definition: igmp.api:76
vl_api_igmp_dump_t::context
u32 context
Definition: igmp.api:153
vl_api_igmp_event_t::gaddr
vl_api_ip4_address_t gaddr
Definition: igmp.api:222
vl_api_igmp_details_t::gaddr
vl_api_ip4_address_t gaddr
Definition: igmp.api:171
vl_api_want_igmp_events_t::enable
u32 enable
Definition: igmp.api:199
vl_api_igmp_proxy_device_add_del_interface_t::client_index
u32 client_index
Definition: igmp.api:136
u8
unsigned char u8
Definition: types.h:56
igmp_enable_disable
int igmp_enable_disable(u32 sw_if_index, u8 enable, igmp_mode_t mode)
IGMP interface enable/disable.
Definition: igmp.c:340
vl_api_igmp_clear_interface_t::client_index
u32 client_index
Definition: igmp.api:181
vl_api_igmp_clear_interface_t
remove all (S,G)s from an interface
Definition: igmp.api:179
filter_mode
filter_mode
Filter mode.
Definition: igmp.api:26
vl_api_igmp_enable_disable_t::client_index
u32 client_index
Definition: igmp.api:94
ASM
@ ASM
Definition: igmp.api:230
vl_api_igmp_listen_t::group
vl_api_igmp_group_t group
Definition: igmp.api:78
igmp_event
void igmp_event(igmp_filter_mode_t filter, u32 sw_if_index, const ip46_address_t *saddr, const ip46_address_t *gaddr)
Send an IGMP event to listening parties.
Definition: igmp_api.c:388
igmp_group
typedef igmp_group
Used by a 'host' to enable the reception/listening of packets for a specific multicast group.
Definition: igmp.api:66
vl_api_igmp_proxy_device_add_del_t::context
u32 context
Definition: igmp.api:116
vl_api_igmp_group_prefix_set_t::client_index
u32 client_index
Definition: igmp.api:250
vl_api_igmp_event_t::saddr
vl_api_ip4_address_t saddr
Definition: igmp.api:221
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123