FD.io VPP  v19.01.2-3-gf61a1a8
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 
22 /**
23  * @brief Filter mode
24  */
26  EXCLUDE = 0,
27  INCLUDE = 1,
28 };
29 
30 
31 /**
32  * @brief
33  * Used by a 'host' to enable the reception/listening of packets for a specific
34  * multicast group
35  *
36  * For each socket on which IPMulticastListen has been invoked, the
37  * system records the desired multicast reception state for that socket.
38  * That state conceptually consists of a set of records of the form:
39  *
40  * (interface, multicast-address, filter-mode, source-list)
41  *
42  * The socket state evolves in response to each invocation of
43  * IPMulticastListen on the socket, as follows:
44  *
45  * o If the requested filter mode is INCLUDE *and* the requested source
46  * list is empty, then the entry corresponding to the requested
47  * interface and multicast address is deleted if present. If no such
48  * entry is present, the request is ignored.
49  *
50  * o If the requested filter mode is EXCLUDE *or* the requested source
51  * list is non-empty, then the entry corresponding to the requested
52  * interface and multicast address, if present, is changed to contain
53  * the requested filter mode and source list. If no such entry is
54  * present, a new entry is created, using the parameters specified in
55  * the request.
56  *
57  * @param client_index - opaque cookie to identify the sender
58  * @param context - sender context, to match reply w/ request
59  * @param sw_if_index - interface sw index
60  * @param filter - filter mode
61  * @param saddr - source address
62  * @param gaddr - group address
63  */
64 typeonly define igmp_group
65 {
66  vl_api_filter_mode_t filter;
69  vl_api_ip4_address_t gaddr;
70  vl_api_ip4_address_t saddrs[n_srcs];
71 };
72 autoreply define igmp_listen
73 {
76 
78 };
79 
80 /**
81  * @brief
82  * Used by a 'router' and 'host' to enable the reception of IGMP packets.
83  * For hosts this must be called once before igmp_listen.
84  *
85  * @param client_index - opaque cookie to identify the sender
86  * @param context - sender context, to match reply w/ request
87  * @param enable - if set, enable igmp messages on configuration
88  * @param mode - Host (1) or router (0) mode
89  * @param sw_if_index - interface sw index
90  */
91 autoreply define igmp_enable_disable
92 {
95 
99 };
100 
101 /**
102  * @brief
103  * Add/del proxy device on specified VRF.
104  * Interface must be IGMP enabled in HOST mode.
105  *
106  * @param client_index - opaque cookie to identify the sender
107  * @param context - sender context, to match reply w/ request
108  * @param add - add (1) del (0)
109  * @param vrf_id - VRF id
110  * @param sw_if_index - upstream interface sw index
111  */
113 {
116 
120 };
121 
122 /**
123  * @brief
124  * Add/del downstream interface to/from proxy device.
125  * Interface must be IGMP enabled in ROUTER mode.
126  *
127  * @param client_index - opaque cookie to identify the sender
128  * @param context - sender context, to match reply w/ request
129  * @param add - add (1) del (0)
130  * @param vrf_id - VRF id
131  * @param sw_if_index - downstream interface sw index
132  */
134 {
137 
141 };
142 
143 /**
144  * @brief dump (S,G)s from interface
145  * @param client_index - opaque cookie to identify the sender
146  * @param context - sender context, to match reply w/ request
147  * @param sw_if_index - interface sw index (~0 for all)
148 */
149 define igmp_dump
150 {
153 
155 };
156 
157 /**
158  * @brief igmp details
159  * @param context - sender context, to match reply w/ request
160  * @param sw_if_index - interface sw index
161  * @param saddr - source address
162  * @param gaddr - group address
163  */
164 define igmp_details
165 {
167 
169  vl_api_ip4_address_t saddr;
170  vl_api_ip4_address_t gaddr;
171 };
172 
173 /** \brief remove all (S,G)s from an interface
174  @param client_index - opaque cookie to identify the sender
175  @param context - sender context, to match reply w/ request
176  @param sw_if_index - interface sw index
177 */
178 autoreply define igmp_clear_interface
179 {
182 
184 };
185 
186 /**
187  * @brief register for igmp events
188  * @param client_index - opaque cookie to identify the sender
189  * @param context - sender context, to match reply w/ request
190  * @param pid - sender's pid
191  * @param enable - 1 enable, 0 disable igmp events
192  */
193 autoreply define want_igmp_events
194 {
197 
200 };
201 
203  rpc want_igmp_events returns want_igmp_events_reply
204  events igmp_event;
205 };
206 
207 /**
208  * @brief igmp event details
209  * @param client_index - opaque cookie to identify the sender
210  * @param context - sender context, to match reply w/ request
211  * @param sw_if_index - interface sw index
212  * @param saddr - source address
213  * @param gaddr - group address
214  *@param filter - filter mode
215  */
217 {
219 
221  vl_api_filter_mode_t filter;
222  vl_api_ip4_address_t saddr;
223  vl_api_ip4_address_t gaddr;
224 };
225 
226 /**
227  * @brief enum to specify either ASM or SSM semantics
228  */
230 {
231  ASM = 0,
232  SSM = 1,
233 };
234 
235 /**
236  * @brief Definition of a Group prefix and its type
237  */
238 typedef group_prefix
239 {
240  vl_api_group_prefix_type_t type;
241  vl_api_prefix_t prefix;
242 };
243 
244 /**
245  * @brief Configure a prefix for SSM or ASM semantics
246  * @param address - Prefix address
247  * @param address_length - Prefix length
248  */
249 autoreply define igmp_group_prefix_set
250 {
253 
254  vl_api_group_prefix_t gp;
255 };
256 
257 define igmp_group_prefix_dump
258 {
261 };
262 
263 define igmp_group_prefix_details
264 {
266 
267  vl_api_group_prefix_t gp;
268 };
269 
270 
271 /*
272  * Local Variables:
273  * eval: (c-set-style "gnu")
274  * End:
275  */
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
vl_api_filter_mode_t filter
Definition: igmp.api:66
Definition: igmp.api:232
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_filter_mode_t filter
Definition: igmp.api:221
Definition: igmp.api:27
Definition: igmp.api:26
option version
Definition: igmp.api:19
vl_api_ip4_address_t gaddr
Definition: igmp.api:223
unsigned char u8
Definition: types.h:56
filter_mode
Filter mode.
Definition: igmp.api:25
service
Definition: igmp.api:202
unsigned int u32
Definition: types.h:88
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:421
int igmp_enable_disable(u32 sw_if_index, u8 enable, igmp_mode_t mode)
IGMP interface enable/disable.
Definition: igmp.c:340
vl_api_ip4_address_t saddr
Definition: igmp.api:222
Definition: igmp.api:231
vl_api_igmp_group_t group
Definition: igmp.api:77
vl_api_ip4_address_t gaddr
Definition: igmp.api:170
void igmp_group_prefix_set(const fib_prefix_t *pfx, igmp_group_prefix_type_t type)
Used by a 'host' to enable the reception/listening of packets for a specific multicast group...
Definition: igmp.api:64
typedef group_prefix
Definition of a Group prefix and its type.
Definition: igmp.api:239
vl_api_group_prefix_t gp
Definition: igmp.api:254
vl_api_ip4_address_t gaddr
Definition: igmp.api:69
vl_api_ip4_address_t saddr
Definition: igmp.api:169
vl_api_prefix_t prefix
Definition: igmp.api:241
group_prefix_type
enum to specify either ASM or SSM semantics
Definition: igmp.api:229
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
vl_api_group_prefix_t gp
Definition: igmp.api:267