|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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"),
361 .frp_sw_if_index = 0xffffffff,
373 if (!config && enable)
391 if (IGMP_MODE_ROUTER ==
mode)
393 config->
timers[IGMP_CONFIG_TIMER_GENERAL_QUERY] =
403 (config -
im->configs);
406 im->n_configs_per_mfib_index[mfib_index]++;
407 if (1 ==
im->n_configs_per_mfib_index[mfib_index])
425 else if (config && !enable)
428 im->n_configs_per_mfib_index[mfib_index]--;
429 if (0 ==
im->n_configs_per_mfib_index[mfib_index])
452 if (config->
mode == IGMP_MODE_ROUTER)
455 else if (config->
mode == IGMP_MODE_HOST)
497 .version = VPP_BUILD_VER,
498 .description =
"Internet Group Management Protocol (IGMP)",
enum igmp_mode_t_ igmp_mode_t
vnet_interface_main_t * im
static void igmp_send_general_query(u32 obj, void *dat)
igmp send query (igmp_timer_function_t)
u32 igmp_group_n_srcs(const igmp_group_t *group, igmp_filter_mode_t mode)
u32 igmp_group_index(const igmp_group_t *g)
#define IGMP_MEMBERSHIP_REPORT_ADDRESS
const ip46_address_t zero_addr
#include <vnet/feature/feature.h>
igmp_config_t * igmp_config_get(u32 index)
Get the config from the pool index.
void igmp_pkt_query_v3_add_group(igmp_pkt_build_query_t *bq, const igmp_group_t *group, const ip46_address_t *srcs)
const static mfib_prefix_t mpfx_report
void igmp_timer_retire(igmp_timer_id_t *tid)
IGMP interface configuration.
#define IGMP_TIMER_ID_INVALID
Aggregate type for a prefix.
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)
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
adj_index_t adj_mcast_add_or_lock(fib_protocol_t proto, vnet_link_t link_type, u32 sw_if_index)
Mcast Adjacency.
void igmp_group_clear(igmp_group_t **group)
void igmp_pkt_query_v3_send(igmp_pkt_build_query_t *bq)
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
IGMP group A multicast group address for which reception has been requested.
vl_api_tunnel_mode_t mode
#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.
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
@ VNET_HW_INTERFACE_FLAG_LINK_UP
u32 n_reports_sent
The number of times the last report has been sent.
dpo_proto_t frp_proto
The protocol of the address below.
igmp_config_t * igmp_config_lookup(u32 sw_if_index)
igmp config lookup
#define hash_create(elts, value_bytes)
igmp_src_t * igmp_group_src_update(igmp_group_t *group, const igmp_key_t *skey, igmp_mode_t mode)
u32 config
The pool index of the config object this group is in.
u32 igmp_timer_type_get(igmp_timer_type_t t)
void igmp_pkt_build_query_init(igmp_pkt_build_query_t *bq, u32 sw_if_index)
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(igmp_hw_interface_link_up_down)
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
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.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
igmp_group_t * igmp_group_get(u32 index)
static void igmp_resend_state_change_group_report_v3(u32 gi, void *data)
#define IGMP_CONFIG_N_TIMERS
#define IGMP_GENERAL_QUERY_ADDRESS
General Query address - 224.0.0.1 Membership Report address - 224.0.0.22 SSM default range 232/8.
vnet_main_t * vnet_get_main(void)
u32 timers[IGMP_GROUP_N_TIMERS]
A vector of running timers for the group.
igmp_timer_id_t timers[IGMP_CONFIG_N_TIMERS]
A vector of scheduled query-response timers.
u32 igmp_config_index(const igmp_config_t *c)
Get the pool index for a config.
u8 robustness_var
Robustness variable (section 5.1)
igmp_group_t * igmp_group_lookup(igmp_config_t *config, const igmp_key_t *key)
igmp group lookup
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)
u32 proxy_device_id
ID of a proxy device this configuration is on.
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
static clib_error_t * igmp_init(vlib_main_t *vm)
igmp initialization
#define hash_create_mem(elts, key_bytes, value_bytes)
static clib_error_t * igmp_hw_interface_link_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
igmp hardware interface link up down
#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)
fib_protocol_t fp_proto
protocol type
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
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
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.
igmp_key_t * key
The group's key within the per-interface config.
format_function_t format_vnet_sw_if_index_name
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
vl_api_ip4_address_t saddrs[n_srcs]
void igmp_pkt_report_v3_send(igmp_pkt_build_report_t *br)
#define VLIB_INIT_FUNCTION(x)
vl_api_ip4_address_t gaddr
A representation of a path as described by a route producer.
#define IGMP_DEFAULT_ROBUSTNESS_VARIABLE
RFC 3376 Section 8.1.
#define vec_foreach(var, vec)
Vector iterator.
void igmp_pkt_build_report_init(igmp_pkt_build_report_t *br, u32 sw_if_index)
uword * igmp_group_by_key
Database of groups joined on the link.
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.
static walk_rc_t igmp_sw_if_down(vnet_main_t *vnm, u32 sw_if_index, void *ctx)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void igmp_group_free_all_srcs(igmp_group_t *group)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
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)
Add n paths to an entry (aka route) in the FIB.
int igmp_enable_disable(u32 sw_if_index, u8 enable, igmp_mode_t mode)
IGMP interface enable/disable.
enum igmp_filter_mode_t_ igmp_filter_mode_t
igmp_group_t * igmp_group_alloc(igmp_config_t *config, const igmp_key_t *gkey, igmp_filter_mode_t mode)
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.
static void igmp_send_state_change_group_report_v3(u32 sw_if_index, const igmp_group_t *group)
void igmp_clear_config(igmp_config_t *config)
igmp clear config
vl_api_interface_index_t sw_if_index
const static mfib_prefix_t mpfx_general_query
enum walk_rc_t_ walk_rc_t
Walk return code.
@ FIB_ROUTE_PATH_LOCAL
A for-us/local path.
collection of data related to IGMP
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.
vl_api_wireguard_peer_flags_t flags
ip46_address_t igmp_key_t
IGMP Key Used to index groups within an interface config and sources within a list.