|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
26 #include <igmp/igmp.api_enum.h>
27 #include <igmp/igmp.api_types.h>
32 #define IGMP_MSG_ID(_id) (_id + igmp_main.msg_id_base)
39 vl_api_igmp_listen_reply_t *rmp;
49 rv = VNET_API_ERROR_UNEXPECTED_INTF_STATE;
66 IGMP_FILTER_MODE_INCLUDE :
67 IGMP_FILTER_MODE_EXCLUDE),
80 vl_api_igmp_enable_disable_reply_t *rmp;
87 (mp->
mode ? IGMP_MODE_HOST : IGMP_MODE_ROUTER));
98 vl_api_igmp_proxy_device_add_del_reply_t *rmp;
116 vl_api_igmp_proxy_device_add_del_interface_reply_t *rmp;
128 (VL_API_IGMP_PROXY_DEVICE_ADD_DEL_INTERFACE_REPLY));
141 mp->_vl_msg_id = htons (
IGMP_MSG_ID (VL_API_IGMP_DETAILS));
204 vl_api_igmp_clear_interface_reply_t *rmp;
215 static vl_api_group_prefix_type_t
220 case IGMP_GROUP_PREFIX_TYPE_ASM:
221 return (htonl (
ASM));
222 case IGMP_GROUP_PREFIX_TYPE_SSM:
223 return (htonl (
SSM));
235 return (IGMP_GROUP_PREFIX_TYPE_ASM);
237 return (IGMP_GROUP_PREFIX_TYPE_SSM);
240 return (IGMP_GROUP_PREFIX_TYPE_SSM);
246 vl_api_igmp_group_prefix_set_reply_t *rmp;
272 mp->_vl_msg_id = htons (
IGMP_MSG_ID (VL_API_IGMP_DETAILS));
305 p =
hash_get (
im->igmp_api_client_by_client_index, client_index);
317 vl_api_want_igmp_events_reply_t *rmp;
325 rv = VNET_API_ERROR_INVALID_REGISTRATION;
339 hash_set (
im->igmp_api_client_by_client_index,
343 rv = VNET_API_ERROR_INVALID_REGISTRATION;
346 REPLY_MACRO (VL_API_WANT_IGMP_EVENTS_REPLY +
im->msg_id_base);
356 p =
hash_get (
im->igmp_api_client_by_client_index, client_index);
362 hash_unset (
im->igmp_api_client_by_client_index, client_index);
373 const ip46_address_t * saddr,
const ip46_address_t *
gaddr)
380 mp->
filter = htonl (filter);
390 const ip46_address_t * saddr,
const ip46_address_t *
gaddr)
416 #include <igmp/igmp.api.c>
static vl_api_group_prefix_type_t igmp_group_type_int_to_api(igmp_group_prefix_type_t t)
#define FOR_EACH_GROUP(_group, _config, _body)
static void vl_api_igmp_group_prefix_dump_t_handler(vl_api_igmp_dump_t *mp)
vnet_interface_main_t * im
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
IGMP source The representation of a specified source address with in multicast group.
vl_api_interface_index_t sw_if_index
vl_api_ip4_address_t saddr
void send_igmp_event(vl_api_registration_t *rp, igmp_filter_mode_t filter, u32 sw_if_index, const ip46_address_t *saddr, const ip46_address_t *gaddr)
#define clib_memcpy(d, s, n)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
IGMP interface configuration.
static void vl_api_igmp_proxy_device_add_del_t_handler(vl_api_igmp_proxy_device_add_del_t *mp)
Add/del downstream interface to/from proxy device.
vl_api_interface_index_t sw_if_index
IGMP group A multicast group address for which reception has been requested.
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
igmp_config_t * igmp_config_lookup(u32 sw_if_index)
igmp config lookup
enum igmp_group_prefix_type_t_ igmp_group_prefix_type_t
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
#define hash_set(h, key, value)
static void setup_message_id_table(api_main_t *am)
#define pool_foreach(VAR, POOL)
Iterate through pool.
vl_api_interface_index_t sw_if_index
#define FOR_EACH_SRC(_src, _group, _filter, _body)
Configure a prefix for SSM or ASM semantics.
vl_api_filter_mode_t filter
static vnet_sw_interface_flags_t vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
VLIB_API_INIT_FUNCTION(igmp_plugin_api_hookup)
An API client registration, only in vpp/vlib.
VL_MSG_API_REAPER_FUNCTION(want_igmp_events_reaper)
static clib_error_t * want_igmp_events_reaper(u32 client_index)
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
#define vec_foreach_index(var, v)
Iterate over vector indices.
static clib_error_t * igmp_plugin_api_hookup(vlib_main_t *vm)
dump (S,G)s from interface
vl_api_interface_index_t sw_if_index
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
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.
vl_api_interface_index_t sw_if_index
Used by a 'router' and 'host' to enable the reception of IGMP packets.
Add/del proxy device on specified VRF.
#define BAD_SW_IF_INDEX_LABEL
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
static void vl_api_igmp_enable_disable_t_handler(vl_api_igmp_enable_disable_t *mp)
static void igmp_config_dump(igmp_main_t *im, vl_api_registration_t *rp, u32 context, igmp_config_t *config)
int igmp_proxy_device_add_del(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del.
#define vec_free(V)
Free vector's memory (no header).
int igmp_proxy_device_add_del_interface(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del interface.
static igmp_group_prefix_type_t igmp_group_type_api_to_int(vl_api_group_prefix_type_t t)
static void vl_api_want_igmp_events_t_handler(vl_api_want_igmp_events_t *mp)
igmp_key_t * key
The group's key within the per-interface config.
format_function_t format_vnet_sw_if_index_name
format_function_t format_ip46_address
vl_api_ip4_address_t saddrs[n_srcs]
void igmp_group_prefix_set(const fib_prefix_t *pfx, igmp_group_prefix_type_t type)
vl_api_ip4_address_t gaddr
static walk_rc_t igmp_ssm_range_walk_dump(const fib_prefix_t *pfx, igmp_group_prefix_type_t type, void *args)
static void vl_api_igmp_dump_t_handler(vl_api_igmp_dump_t *mp)
vl_api_ip4_address_t gaddr
vl_api_ip4_address_t gaddr
#define hash_unset(h, key)
static void vl_api_igmp_clear_interface_t_handler(vl_api_igmp_clear_interface_t *mp)
void igmp_ssm_range_walk(igmp_ssm_range_walk_t fn, void *ctx)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_igmp_proxy_device_add_del_interface_t_handler(vl_api_igmp_proxy_device_add_del_interface_t *mp)
static vlib_main_t * vlib_get_main(void)
int igmp_enable_disable(u32 sw_if_index, u8 enable, igmp_mode_t mode)
IGMP interface enable/disable.
struct igmp_ssm_range_walk_ctx_t_ igmp_ssm_range_walk_ctx_t
enum igmp_filter_mode_t_ igmp_filter_mode_t
remove all (S,G)s from an interface
vl_api_igmp_group_t group
static void vl_api_igmp_group_prefix_set_t_handler(vl_api_igmp_group_prefix_set_t *mp)
static void vl_api_igmp_listen_t_handler(vl_api_igmp_listen_t *mp)
void igmp_clear_config(igmp_config_t *config)
igmp clear config
vl_api_ip4_address_t saddr
vl_api_interface_index_t sw_if_index
enum walk_rc_t_ walk_rc_t
Walk return code.
Aggregate type for a prefix.
vl_api_fib_path_type_t type
static vpe_client_registration_t * igmp_api_client_lookup(igmp_main_t *im, u32 client_index)
collection of data related to IGMP
static void send_igmp_details(vl_api_registration_t *rp, igmp_main_t *im, igmp_config_t *config, igmp_group_t *group, igmp_src_t *src, u32 context)
u16 msg_id_base
API base message ID.
vl_api_registration_t * rp
void * vl_msg_api_alloc(int nbytes)