20 #include <vpp/app/version.h> 90 config->
timers[IGMP_CONFIG_TIMER_GENERAL_QUERY] =
107 IGMP_MEMBERSHIP_GROUP_allow_new_sources);
125 group->
timers[IGMP_GROUP_TIMER_RESEND_REPORT] =
136 const ip46_address_t * saddrs,
const ip46_address_t * gaddr)
138 const ip46_address_t *saddr;
166 rv = VNET_API_ERROR_INVALID_INTERFACE;
169 if (config->
mode != IGMP_MODE_HOST)
171 rv = VNET_API_ERROR_INVALID_INTERFACE;
202 group->
timers[IGMP_GROUP_TIMER_RESEND_REPORT] =
209 IGMP_DBG (
"... update (%U, %U) %U %U",
230 if (IGMP_FILTER_MODE_INCLUDE == mode)
232 ip46_address_t *added, *removed;
257 IGMP_MEMBERSHIP_GROUP_allow_new_sources);
265 IGMP_MEMBERSHIP_GROUP_block_old_sources);
345 IGMP_DBG (
"%s: %U", (enable ?
"Enabled" :
"Disabled"),
353 .frp_sw_if_index = 0xffffffff,
371 if (!config && enable)
389 if (IGMP_MODE_ROUTER == mode)
391 config->
timers[IGMP_CONFIG_TIMER_GENERAL_QUERY] =
428 else if (config && !enable)
454 if (config->
mode == IGMP_MODE_ROUTER)
457 else if (config->
mode == IGMP_MODE_HOST)
500 .version = VPP_BUILD_VER,
501 .description =
"Internet Group Management Protocol (IGMP)",
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
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
igmp_timer_id_t timers[IGMP_CONFIG_N_TIMERS]
A vector of scheduled query-response timers.
void igmp_pkt_query_v3_send(igmp_pkt_build_query_t *bq)
static void igmp_send_state_change_group_report_v3(u32 sw_if_index, const igmp_group_t *group)
void igmp_timer_retire(igmp_timer_id_t *tid)
igmp_group_t * igmp_group_lookup(igmp_config_t *config, const igmp_key_t *key)
igmp group lookup
A representation of a path as described by a route producer.
int igmp_proxy_device_add_del_interface(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del interface.
vnet_main_t * vnet_get_main(void)
static clib_error_t * ip4_lookup_init(vlib_main_t *vm)
void vnet_hw_interface_walk_sw(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_sw_interface_walk_t fn, void *ctx)
Walk the SW interfaces on a HW interface - this is the super interface and any sub-interfaces.
void igmp_group_free_all_srcs(igmp_group_t *group)
igmp_config_t * configs
pool of configs
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(igmp_hw_interface_link_up_down)
void igmp_pkt_report_v3_add_group(igmp_pkt_build_report_t *br, const igmp_group_t *group, igmp_membership_group_v3_type_t type)
igmp_src_t * igmp_group_src_update(igmp_group_t *group, const igmp_key_t *skey, igmp_mode_t mode)
static clib_error_t * igmp_hw_interface_link_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
dpo_proto_t frp_proto
The protocol of the address below.
#define IGMP_GENERAL_QUERY_ADDRESS
General Query address - 224.0.0.1 Membership Report address - 224.0.0.22 SSM default range 232/8...
static clib_error_t * igmp_init(vlib_main_t *vm)
igmp initialization
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
format_function_t format_vnet_sw_if_index_name
void igmp_pkt_build_report_init(igmp_pkt_build_report_t *br, u32 sw_if_index)
igmp_timer_id_t igmp_timer_schedule(f64 when, u32 obj, igmp_timer_function_t fn, void *data)
Schedule a timer to expire in 'when' seconds.
void igmp_clear_config(igmp_config_t *config)
igmp clear config
u32 igmp_timer_type_get(igmp_timer_type_t t)
enum walk_rc_t_ walk_rc_t
Walk return code.
u32 n_reports_sent
The number of times the last report has been sent.
#define VLIB_INIT_FUNCTION(x)
u32 mfib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
ip46_address_t * igmp_group_present_minus_new(igmp_group_t *group, igmp_filter_mode_t mode, const ip46_address_t *saddrs)
the set of present sources minus the new set
u32 igmp_config_index(const igmp_config_t *c)
Get the pool index for a config.
fib_node_index_t mfib_table_entry_path_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpath, mfib_itf_flags_t itf_flags)
Add n paths to an entry (aka route) in the FIB.
igmp_config_t * igmp_config_get(u32 index)
Get the config from the pool index.
#define vlib_call_init_function(vm, x)
void igmp_pkt_report_v3_send(igmp_pkt_build_report_t *br)
uword * igmp_group_by_key
Database of groups joined on the link.
igmp_config_t * igmp_config_lookup(u32 sw_if_index)
igmp config lookup
#define IGMP_CONFIG_N_TIMERS
#define hash_create_mem(elts, key_bytes, value_bytes)
int igmp_enable_disable(u32 sw_if_index, u8 enable, igmp_mode_t mode)
IGMP interface enable/disable.
#define IGMP_DEFAULT_ROBUSTNESS_VARIABLE
RFC 3376 Section 8.1.
vlib_log_class_t logger
logger - VLIB log class
u32 config
The pool index of the config object this group is in.
#define IGMP_MEMBERSHIP_REPORT_ADDRESS
#define pool_put(P, E)
Free an object E in pool P.
collection of data related to IGMP
igmp_group_t * igmp_group_alloc(igmp_config_t *config, const igmp_key_t *gkey, igmp_filter_mode_t mode)
u32 timers[IGMP_GROUP_N_TIMERS]
A vector of running timers for the group.
#define vec_free(V)
Free vector's memory (no header).
u32 * igmp_config_by_sw_if_index
per-interface DB of configs
void igmp_pkt_query_v3_add_group(igmp_pkt_build_query_t *bq, const igmp_group_t *group, const ip46_address_t *srcs)
enum igmp_filter_mode_t_ igmp_filter_mode_t
Aggregrate type for a prefix.
#define IGMP_TIMER_ID_INVALID
#define hash_create(elts, value_bytes)
void igmp_pkt_report_v3_add_report(igmp_pkt_build_report_t *br, const ip46_address_t *grp, const ip46_address_t *srcs, igmp_membership_group_v3_type_t type)
igmp_group_t * igmp_group_get(u32 index)
u32 * n_configs_per_mfib_index
the number of igmp configs for each mfib_index (VRF)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
ip46_address_t igmp_key_t
IGMP Key Used to index groups within an interface config and sources within a list.
u8 robustness_var
Robustness variable (section 5.1)
IGMP interface configuration.
u32 proxy_device_id
ID of a proxy device this configuration is on.
fib_protocol_t fp_proto
protocol type
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
igmp_key_t * key
The group's key within the per-interface config.
IGMP group A multicast group address for which reception has been requested.
static void igmp_send_general_query(u32 obj, void *dat)
igmp send query (igmp_timer_function_t)
void igmp_pkt_build_query_init(igmp_pkt_build_query_t *bq, u32 sw_if_index)
enum igmp_mode_t_ igmp_mode_t
vl_api_gbp_vxlan_tunnel_mode_t mode
adj_index_t adj_mcast_add_or_lock(fib_protocol_t proto, vnet_link_t link_type, u32 sw_if_index)
Mcast Adjacency.
static void igmp_resend_state_change_group_report_v3(u32 gi, void *data)
#define vec_foreach(var, vec)
Vector iterator.
uword * igmp_api_client_by_client_index
ip46_address_t * igmp_group_new_minus_present(igmp_group_t *group, igmp_filter_mode_t mode, const ip46_address_t *saddrs)
the set of new sources minus the present set
u32 igmp_group_n_srcs(const igmp_group_t *group, igmp_filter_mode_t mode)
void igmp_group_clear(igmp_group_t *group)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
void mfib_table_entry_path_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpath)
Remove n paths to an entry (aka route) in the FIB.
int igmp_proxy_device_add_del(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del.
u32 igmp_group_index(const igmp_group_t *g)
const ip46_address_t zero_addr
static walk_rc_t igmp_sw_if_down(vnet_main_t *vnm, u32 sw_if_index, void *ctx)
igmp hardware interface link up down