FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
igmp.c File Reference
+ Include dependency graph for igmp.c:

Go to the source code of this file.

Macros

#define igmp_type(n, s)
 
#define igmp_report_type(n, s)
 

Functions

void igmp_clear_group (igmp_config_t *config, igmp_group_t *group)
 igmp clear group More...
 
void igmp_clear_config (igmp_config_t *config)
 igmp clear config More...
 
int igmp_timer_compare (const void *_a, const void *_b)
 igmp timer compare More...
 
void igmp_sort_timers (igmp_timer_t *timers)
 igmp sort timers More...
 
void igmp_create_int_timer (f64 time, u32 sw_if_index, igmp_timer_function_t *func)
 igmp create int timer More...
 
void igmp_create_group_timer (f64 time, u32 sw_if_index, igmp_key_t *gkey, igmp_timer_function_t *func)
 igmp create group timer More...
 
void igmp_create_src_timer (f64 time, u32 sw_if_index, igmp_key_t *gkey, igmp_key_t *skey, igmp_timer_function_t *func)
 igmp create group timer More...
 
static igmp_timer_tigmp_get_next_timer (igmp_main_t *im)
 igmp get next timer More...
 
static void igmp_create_report_v3 (vlib_buffer_t *b, igmp_config_t *config, igmp_group_t *group)
 igmp create report all (v3) More...
 
static void igmp_create_query_v3 (vlib_buffer_t *b, igmp_config_t *config, igmp_group_t *group)
 igmp create query (v3) More...
 
static void igmp_create_ip4 (vlib_buffer_t *b, igmp_config_t *config, igmp_group_t *group, u8 is_report)
 igmp create ip4 More...
 
static void igmp_send_msg (vlib_main_t *vm, vlib_node_runtime_t *node, igmp_main_t *im, igmp_config_t *config, igmp_group_t *group, u8 is_report)
 igmp send message More...
 
void igmp_send_query (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)
 igmp send query (igmp_timer_function_t) More...
 
void igmp_query_resp_exp (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)
 igmp query response expiration (igmp_timer_function_t) More...
 
void igmp_send_report (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)
 igmp send report (igmp_timer_function_t) More...
 
void igmp_send_state_changed (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)
 igmp send state changed (igmp_timer_function_t) More...
 
void igmp_src_exp (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)
 igmp source expiration (igmp_timer_function_t) More...
 
static uword igmp_timer_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 igmp timer process More...
 
int igmp_listen (vlib_main_t *vm, u8 enable, u32 sw_if_index, ip46_address_t saddr, ip46_address_t gaddr, u8 cli_api_configured)
 igmp listen More...
 
static clib_error_tigmp_hw_interface_link_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 igmp hardware interface link up down More...
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (igmp_hw_interface_link_up_down)
 
static clib_error_tigmp_init (vlib_main_t *vm)
 igmp initialization More...
 
 VLIB_PLUGIN_REGISTER ()
 

Variables

igmp_main_t igmp_main
 
vlib_node_registration_t igmp_timer_process_node
 (constructor) VLIB_REGISTER_NODE (igmp_timer_process_node) More...
 

Macro Definition Documentation

#define igmp_report_type (   n,
 
)
Value:
do { \
vec_add2 (im->report_type_infos, rti, 1); \
rti->type = n; \
rti->name = (u8 *) #s; \
} while (0);
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
Definition: vec.h:562
unsigned char u8
Definition: types.h:56
#define igmp_type (   n,
 
)
Value:
do { \
vec_add2 (im->type_infos, ti, 1); \
ti->type = n; \
ti->name = (u8 *) #s; \
} while (0);
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
Definition: vec.h:562
unsigned char u8
Definition: types.h:56

Function Documentation

void igmp_clear_config ( igmp_config_t config)

igmp clear config

Parameters
config- igmp configuration

Clear all (S,G)s on specified config and remove this config from pool.

Definition at line 62 of file igmp.c.

+ Here is the caller graph for this function:

void igmp_clear_group ( igmp_config_t config,
igmp_group_t group 
)

igmp clear group

Parameters
config- igmp configuration
group- the group to be removed

Remove this group from interface (specified by configuration).

Definition at line 37 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_create_group_timer ( f64  time,
u32  sw_if_index,
igmp_key_t gkey,
igmp_timer_function_t func 
)

igmp create group timer

Parameters
time- expiration time (at this time the timer will expire)
sw_if_index- interface sw_if_index
gkey- key to find the group by
func- function to all after timer expiration

Creates new group timer.

Definition at line 124 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_create_int_timer ( f64  time,
u32  sw_if_index,
igmp_timer_function_t func 
)

igmp create int timer

Parameters
time- expiration time (at this time the timer will expire)
sw_if_index- interface sw_if_index
func- function to all after timer expiration

Creates new interface timer. Delayed reports, query msg, query resp.

Definition at line 108 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void igmp_create_ip4 ( vlib_buffer_t b,
igmp_config_t config,
igmp_group_t group,
u8  is_report 
)
static

igmp create ip4

Parameters
b- vlib buffer
config- igmp configuration
group- igmp membership group
is_report- if zero create query, else create report

Create ip4 header in vlib buffer b.

Definition at line 345 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void igmp_create_query_v3 ( vlib_buffer_t b,
igmp_config_t config,
igmp_group_t group 
)
static

igmp create query (v3)

Parameters
b- vlib buffer
config- configuration that sends the query
group- if not NULL, create Group-specific query

Create igmp v3 qeury inside vlib buffer b. If group == NULL create general query, else, create group specific query.

Definition at line 306 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void igmp_create_report_v3 ( vlib_buffer_t b,
igmp_config_t config,
igmp_group_t group 
)
static

igmp create report all (v3)

Parameters
b- vlib buffer
config- igmp configuration
group- igmp group

Create IGMPv3 report. If group is NULL, send all groups on interface.

Definition at line 223 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_create_src_timer ( f64  time,
u32  sw_if_index,
igmp_key_t gkey,
igmp_key_t skey,
igmp_timer_function_t func 
)

igmp create group timer

Parameters
time- expiration time (at this time the timer will expire)
sw_if_index- interface sw_if_index
gkey- key to find the group by
skey- key to find the source by
func- function to all after timer expiration

Creates new source timer.

Definition at line 146 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static igmp_timer_t* igmp_get_next_timer ( igmp_main_t im)
inlinestatic

igmp get next timer

Parameters
im- igmp main

Get next timer.

Definition at line 174 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* igmp_hw_interface_link_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

igmp hardware interface link up down

Parameters
vnm- vnet main
hw_if_index- interface hw_if_index
flags- hw interface flags

If an interface goes down, remove its (S,G)s.

Definition at line 948 of file igmp.c.

+ Here is the call graph for this function:

static clib_error_t* igmp_init ( vlib_main_t vm)
static

igmp initialization

Parameters
vm- vlib main

initialize igmp plugin. Initialize igmp_main, set mfib to allow igmp traffic.

Definition at line 974 of file igmp.c.

+ Here is the call graph for this function:

int igmp_listen ( vlib_main_t vm,
u8  enable,
u32  sw_if_index,
ip46_address_t  saddr,
ip46_address_t  gaddr,
u8  cli_api_configured 
)

igmp listen

Parameters
vm- vlib main
enable- 0 == remove (S,G), else add (S,G)
sw_if_index- interface sw_if_index
saddr- source address
gaddr- group address
cli_api_configured- if zero, an igmp report has been received on interface

Add/del (S,G) on an interface. If user configured, send a status change report from the interface. If a report was received on interface notify registered api clients.

Definition at line 738 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_query_resp_exp ( vlib_main_t vm,
vlib_node_runtime_t rt,
igmp_main_t im,
igmp_timer_t timer 
)

igmp query response expiration (igmp_timer_function_t)

If a response to a query didn't come in time, remove (S,G)s.

Definition at line 493 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void igmp_send_msg ( vlib_main_t vm,
vlib_node_runtime_t node,
igmp_main_t im,
igmp_config_t config,
igmp_group_t group,
u8  is_report 
)
static

igmp send message

Parameters
vm- vlib main
node- vlib runtime node
im- igmp main
config- igmp configuration
group- igmp mebership group
is_report- 0 == qeury, else report

Send an igmp message. Get free vlib buffer fill it with igmp packet and transmit.

Definition at line 401 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_send_query ( vlib_main_t vm,
vlib_node_runtime_t rt,
igmp_main_t im,
igmp_timer_t timer 
)

igmp send query (igmp_timer_function_t)

Send an igmp query. If the timer holds group key, send Group-Specific query, else send General query.

Definition at line 467 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_send_report ( vlib_main_t vm,
vlib_node_runtime_t rt,
igmp_main_t im,
igmp_timer_t timer 
)

igmp send report (igmp_timer_function_t)

Send igmp membership report.

Definition at line 525 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_send_state_changed ( vlib_main_t vm,
vlib_node_runtime_t rt,
igmp_main_t im,
igmp_timer_t timer 
)

igmp send state changed (igmp_timer_function_t)

Send report if an (S,G) filter has changed.

Definition at line 550 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_sort_timers ( igmp_timer_t timers)

igmp sort timers

Parameters
timers- pool of igmp timers

Sort igmp timers, so that the first to expire is at end.

Definition at line 97 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void igmp_src_exp ( vlib_main_t vm,
vlib_node_runtime_t rt,
igmp_main_t im,
igmp_timer_t timer 
)

igmp source expiration (igmp_timer_function_t)

Remove expired (S,G) from group.

Definition at line 644 of file igmp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int igmp_timer_compare ( const void *  _a,
const void *  _b 
)

igmp timer compare

Parameters
_a- igmp timer
_b- igmp timer

Compare function for igmp_timer_t sorting.

Definition at line 88 of file igmp.c.

+ Here is the caller graph for this function:

static uword igmp_timer_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

igmp timer process

Parameters
vm- vlib main
rt- vlib runtime node
f- vlib frame

Handle igmp timers.

Definition at line 693 of file igmp.c.

+ Here is the call graph for this function:

VLIB_PLUGIN_REGISTER ( )

+ Here is the caller graph for this function:

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( igmp_hw_interface_link_up_down  )

+ Here is the caller graph for this function:

Variable Documentation

igmp_main_t igmp_main

Definition at line 34 of file igmp.c.

vlib_node_registration_t igmp_timer_process_node
Initial value:
=
{
.function = igmp_timer_process,
.name = "igmp-timer-process",
.n_next_nodes = IGMP_N_NEXT,
.next_nodes = {
[IGMP_NEXT_IP4_REWRITE_MCAST_NODE] = "ip4-rewrite-mcast",
[IGMP_NEXT_IP6_REWRITE_MCAST_NODE] = "ip6-rewrite-mcast",
}
}
static uword igmp_timer_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
igmp timer process
Definition: igmp.c:693

(constructor) VLIB_REGISTER_NODE (igmp_timer_process_node)

Definition at line 724 of file igmp.c.