FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
igmp.h File Reference
+ Include dependency graph for igmp.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  igmp_key_t
 igmp key More...
 
struct  igmp_src_t
 igmp source More...
 
struct  igmp_group_t_
 igmp group More...
 
struct  igmp_config_t_
 igmp configuration More...
 
struct  igmp_type_info_t
 
struct  igmp_report_type_info_t
 
struct  igmp_main_t_
 igmp main More...
 
struct  igmp_timer_t_
 igmp timer More...
 

Macros

#define IGMP_QUERY_TIMER   (60)
 
#define IGMP_SRC_TIMER   (3 * IGMP_QUERY_TIMER)
 
#define IGMP_DEFAULT_ROBUSTNESS_VARIABLE   (2)
 
#define ENABLE_IGMP_DBG   0
 
#define IGMP_DBG(...)
 
#define IGMP_GENERAL_QUERY_ADDRESS   (0xE0000001)
 General Query address - 224.0.0.1. More...
 
#define IGMP_MEMBERSHIP_REPORT_ADDRESS   (0xE0000016)
 Membership Report address - 224.0.0.22. More...
 
#define group_ptr(p, l)   ((igmp_membership_group_v3_t *)((char*)p + l))
 helper macro to get igmp mebership group from pointer plus offset More...
 
#define IGMP_GROUP_FLAG_QUERY_RESP_RECVED   (1 << 0)
 reponse to query was received More...
 
#define IGMP_CONFIG_FLAG_QUERY_RESP_RECVED   (1 << 0)
 
#define IGMP_CONFIG_FLAG_CAN_SEND_REPORT   (1 << 1)
 

Typedefs

typedef struct igmp_config_t_ igmp_config_t
 igmp configuration More...
 
typedef struct igmp_group_t_ igmp_group_t
 igmp group More...
 
typedef void( create_msg_t) (vlib_buffer_t *b, igmp_config_t *config, igmp_group_t *group)
 create message More...
 
typedef struct igmp_timer_t_ igmp_timer_t
 igmp timer More...
 
typedef struct igmp_main_t_ igmp_main_t
 igmp main More...
 
typedef void( igmp_timer_function_t) (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)
 igmp timer function More...
 

Enumerations

enum  { IGMP_PROCESS_EVENT_UPDATE_TIMER = 1 }
 
enum  igmp_ver_t { IGMP_V1, IGMP_V2, IGMP_V3 }
 
enum  igmp_next_t { IGMP_NEXT_IP4_REWRITE_MCAST_NODE, IGMP_NEXT_IP6_REWRITE_MCAST_NODE, IGMP_N_NEXT }
 

Functions

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...
 
void igmp_clear_config (igmp_config_t *config)
 igmp clear config More...
 
void igmp_clear_group (igmp_config_t *config, igmp_group_t *group)
 igmp clear group 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...
 
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 igmp_type_info_tigmp_get_type_info (igmp_main_t *im, u32 type)
 
static igmp_report_type_info_tigmp_get_report_type_info (igmp_main_t *im, u8 report_type)
 
void igmp_event (igmp_main_t *im, igmp_config_t *config, igmp_group_t *group, igmp_src_t *src)
 igmp event More...
 
static igmp_config_tigmp_config_lookup (igmp_main_t *im, u32 sw_if_index)
 igmp config lookup More...
 
static igmp_group_tigmp_group_lookup (igmp_config_t *config, igmp_key_t *key)
 igmp group lookup More...
 
static igmp_src_tigmp_src_lookup (igmp_group_t *group, igmp_key_t *key)
 igmp group lookup More...
 

Variables

enum { ... }  igmp_process_event_t
 
igmp_main_t igmp_main
 
vlib_node_registration_t igmp_timer_process_node
 (constructor) VLIB_REGISTER_NODE (igmp_timer_process_node) More...
 
vlib_node_registration_t igmp_input_node
 (constructor) VLIB_REGISTER_NODE (igmp_input_node) More...
 
vlib_node_registration_t igmp_parse_query_node
 (constructor) VLIB_REGISTER_NODE (igmp_parse_query_node) More...
 
vlib_node_registration_t igmp_parse_report_node
 (constructor) VLIB_REGISTER_NODE (igmp_parse_report_node) More...
 

Macro Definition Documentation

#define ENABLE_IGMP_DBG   0

Definition at line 32 of file igmp.h.

#define group_ptr (   p,
 
)    ((igmp_membership_group_v3_t *)((char*)p + l))

helper macro to get igmp mebership group from pointer plus offset

Definition at line 46 of file igmp.h.

#define IGMP_CONFIG_FLAG_CAN_SEND_REPORT   (1 << 1)

Definition at line 160 of file igmp.h.

#define IGMP_CONFIG_FLAG_QUERY_RESP_RECVED   (1 << 0)

Definition at line 159 of file igmp.h.

#define IGMP_DBG (   ...)

Definition at line 37 of file igmp.h.

#define IGMP_DEFAULT_ROBUSTNESS_VARIABLE   (2)

Definition at line 30 of file igmp.h.

#define IGMP_GENERAL_QUERY_ADDRESS   (0xE0000001)

General Query address - 224.0.0.1.

Definition at line 41 of file igmp.h.

#define IGMP_GROUP_FLAG_QUERY_RESP_RECVED   (1 << 0)

reponse to query was received

Definition at line 127 of file igmp.h.

#define IGMP_MEMBERSHIP_REPORT_ADDRESS   (0xE0000016)

Membership Report address - 224.0.0.22.

Definition at line 43 of file igmp.h.

#define IGMP_QUERY_TIMER   (60)

Definition at line 28 of file igmp.h.

#define IGMP_SRC_TIMER   (3 * IGMP_QUERY_TIMER)

Definition at line 29 of file igmp.h.

Typedef Documentation

typedef void( create_msg_t) (vlib_buffer_t *b, igmp_config_t *config, igmp_group_t *group)

create message

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

Populate supplied bufefr with IGMP message.

Definition at line 76 of file igmp.h.

typedef struct igmp_config_t_ igmp_config_t

igmp configuration

Parameters
sw_if_index- interface sw_if_index
adj_index- adjacency index
cli_api_configured- if zero, an igmp report was received
next_create_msg- specify next igmp message
igmp_ver- igmp version
robustness_var- robustness variable
flags- igmp configuration falgs
igmp_group_by_key- group by key hash
groups- pool of groups

Definition at line 63 of file igmp.h.

typedef struct igmp_group_t_ igmp_group_t

igmp group

Parameters
addr- ip4/6 group address
exp_time- expiration time
key- pointer to key
type- membership group type
n_srcs- number of sources
flags- igmp group flags
igmp_src_by_key- source by key hash
srcs- pool of sources

Definition at line 67 of file igmp.h.

typedef struct igmp_main_t_ igmp_main_t

igmp main

Parameters
msg_id_base- API message ID base
igmp_api_client_by_client_index- get api client by client_index
api_clients- pool of api clients registered for join/leave notifications
igmp_config_by_sw_if_index- get config index by config key
configs- pool of igmp configurations
buffers- buffer cache
timers- pool of igmp timers
type_infos- igmp type info
report_type_infos- igmp report type info
type_info_by_type-
report_type_info_by_report_type-
general_query_address- 224.0.0.1
membership_report_address- 224.0.0.22
typedef void( igmp_timer_function_t) (vlib_main_t *vm, vlib_node_runtime_t *rt, igmp_main_t *im, igmp_timer_t *timer)

igmp timer function

Parameters
vm- vlib main
rt- vlib runtime node
im- igmp main
timer- igmp timer

Definition at line 229 of file igmp.h.

typedef struct igmp_timer_t_ igmp_timer_t

igmp timer

Parameters
exp_time- expiration time
func- function to call on timer expiration
sw_if_index- interface sw_if_index
data- custom data

Definition at line 169 of file igmp.h.

Enumeration Type Documentation

anonymous enum
Enumerator
IGMP_PROCESS_EVENT_UPDATE_TIMER 

Definition at line 48 of file igmp.h.

Enumerator
IGMP_NEXT_IP4_REWRITE_MCAST_NODE 
IGMP_NEXT_IP6_REWRITE_MCAST_NODE 
IGMP_N_NEXT 

Definition at line 391 of file igmp.h.

enum igmp_ver_t

Igmp versions

Enumerator
IGMP_V1 
IGMP_V2 
IGMP_V3 

Definition at line 54 of file igmp.h.

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:

static igmp_config_t* igmp_config_lookup ( igmp_main_t im,
u32  sw_if_index 
)
inlinestatic

igmp config lookup

Parameters
im- igmp main
sw_if_index- interface sw_if_index

Definition at line 403 of file igmp.h.

+ 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:

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:

void igmp_event ( igmp_main_t im,
igmp_config_t config,
igmp_group_t group,
igmp_src_t src 
)

igmp event

Parameters
im- igmp main
config- igmp configuration
group- igmp group
src- source

Notify registered api clients of (S,G) filter update.

Definition at line 301 of file igmp_api.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static igmp_report_type_info_t* igmp_get_report_type_info ( igmp_main_t im,
u8  report_type 
)
inlinestatic

Definition at line 372 of file igmp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static igmp_type_info_t* igmp_get_type_info ( igmp_main_t im,
u32  type 
)
inlinestatic

Definition at line 363 of file igmp.h.

+ Here is the caller graph for this function:

static igmp_group_t* igmp_group_lookup ( igmp_config_t config,
igmp_key_t key 
)
inlinestatic

igmp group lookup

Parameters
config- igmp configuration
key- igmp key

Definition at line 420 of file igmp.h.

+ Here is the caller 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:

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:

static igmp_src_t* igmp_src_lookup ( igmp_group_t group,
igmp_key_t key 
)
inlinestatic

igmp group lookup

Parameters
group- igmp group
key- igmp key

Definition at line 439 of file igmp.h.

+ Here is the caller graph for this function:

Variable Documentation

vlib_node_registration_t igmp_input_node

(constructor) VLIB_REGISTER_NODE (igmp_input_node)

Definition at line 221 of file input.c.

igmp_main_t igmp_main

Definition at line 34 of file igmp.c.

vlib_node_registration_t igmp_parse_query_node

(constructor) VLIB_REGISTER_NODE (igmp_parse_query_node)

Definition at line 328 of file input.c.

vlib_node_registration_t igmp_parse_report_node

(constructor) VLIB_REGISTER_NODE (igmp_parse_report_node)

Definition at line 549 of file input.c.

enum { ... } igmp_process_event_t
vlib_node_registration_t igmp_timer_process_node

(constructor) VLIB_REGISTER_NODE (igmp_timer_process_node)

Definition at line 724 of file igmp.c.