32 static ip46_address_t *
35 ip46_address_t *srcs = NULL;
51 for (ii = 0; ii < n; ii++)
89 IGMP_MEMBERSHIP_GROUP_mode_is_include);
97 ip46_address_t *intersect;
100 IGMP_FILTER_MODE_INCLUDE,
108 IGMP_MEMBERSHIP_GROUP_mode_is_include);
124 case IGMP_FILTER_MODE_INCLUDE:
125 return (IGMP_MEMBERSHIP_GROUP_mode_is_include);
126 case IGMP_FILTER_MODE_EXCLUDE:
127 return (IGMP_MEMBERSHIP_GROUP_mode_is_exclude);
130 return (IGMP_MEMBERSHIP_GROUP_mode_is_include);
147 ASSERT (config->
timers[IGMP_CONFIG_TIMER_GENERAL_REPORT] !=
152 IGMP_DBG (
"send-general-report: %U",
186 if (IGMP_MODE_ROUTER == config->
mode)
215 config->
timers[IGMP_CONFIG_TIMER_GENERAL_REPORT])
219 IGMP_DBG (
"...general-query-rx: %U schedule for %f",
226 config->
timers[IGMP_CONFIG_TIMER_GENERAL_REPORT] =
244 ip46_address_t *srcs;
259 tid = group->
timers[IGMP_GROUP_TIMER_QUERY_REPLY];
261 IGMP_DBG (
"...group-query-rx: %U for (%U, %U)",
272 ip46_address_t *current, *s;
294 IGMP_DBG (
"...group-query-rx: schedule:%f", delay);
296 group->
timers[IGMP_GROUP_TIMER_QUERY_REPLY] =
#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.
A copy of the query message sent from the worker to the main thread.
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
vnet_main_t * vnet_get_main(void)
ip4_address_t src_addresses[0]
static f64 vlib_time_now(vlib_main_t *vm)
igmp_config_t * configs
pool of configs
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)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
igmp_membership_group_v3_type_t
static igmp_membership_group_v3_type_t igmp_filter_mode_to_report_type(igmp_filter_mode_t mode)
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.
static void igmp_send_general_report_v3(u32 obj, void *data)
Send igmp membership general report.
u32 igmp_config_index(const igmp_config_t *c)
Get the pool index for a config.
void * igmp_timer_get_data(igmp_timer_id_t tid)
static f64 igmp_get_random_resp_delay(const igmp_header_t *header)
#define FOR_EACH_GROUP(_group, _config, _body)
void igmp_pkt_report_v3_send(igmp_pkt_build_report_t *br)
igmp_config_t * igmp_config_lookup(u32 sw_if_index)
igmp config lookup
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 config
The pool index of the config object this group is in.
u32 igmp_timer_id_t
The id of a running timer.
collection of data related to IGMP
vl_api_tunnel_mode_t mode
static u8 ip46_address_is_equal(const ip46_address_t *ip46_1, const ip46_address_t *ip46_2)
static ip46_address_t * igmp_query_mk_source_list(const igmp_membership_query_v3_t *q)
static f64 igmp_header_get_max_resp_time(const igmp_header_t *header)
Calculate the maximum response time allowed from the header.
void igmp_timer_set_data(igmp_timer_id_t tid, void *data)
u32 timers[IGMP_GROUP_N_TIMERS]
A vector of running timers for the group.
#define vec_free(V)
Free vector's memory (no header).
#define vec_search_with_function(v, E, fn)
Search a vector for the index of the entry that matches.
enum igmp_filter_mode_t_ igmp_filter_mode_t
#define IGMP_TIMER_ID_INVALID
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)
static void igmp_send_group_report_v3(u32 obj, void *data)
static f64 random_f64(u32 *seed)
Generate f64 random number in the interval [0,1].
ip46_address_t igmp_key_t
IGMP Key Used to index groups within an interface config and sources within a list.
static vlib_main_t * vlib_get_main(void)
ip46_address_t * igmp_group_new_intersect_present(igmp_group_t *group, igmp_filter_mode_t mode, const ip46_address_t *saddrs)
igmp_filter_mode_t router_filter_mode
The current filter mode of the group (see 6.2.1)
IGMP interface configuration.
void igmp_handle_query(const igmp_query_args_t *args)
Called from the main thread on reception of a Query message.
static int igmp_membership_query_v3_is_general(const igmp_membership_query_v3_t *q)
igmp_group_t * groups
pool of groups
#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.
igmp_membership_query_v3_t query[0]
#define vec_foreach(var, vec)
Vector iterator.
u32 igmp_group_index(const igmp_group_t *g)
ip4_address_t group_address