19 #include <sys/ioctl.h> 75 .short_help =
"clear igmp int <interface>",
87 ip46_address_t saddr, *saddrs =
NULL, gaddr;
96 "'help igmp listen' or 'igmp listen ?' for help");
102 if (
unformat (line_input,
"enable"))
104 else if (
unformat (line_input,
"disable"))
131 rv =
igmp_listen (vm, enable, sw_if_index, saddrs, &gaddr);
145 "Failed to add configuration, interface is in router mode");
155 .path =
"igmp listen",
156 .short_help =
"igmp listen [<enable|disable>] " 157 "int <interface> saddr <ip4-address> gaddr <ip4-address>",
176 vlib_cli_output (vm,
"interface: %U", format_vnet_sw_if_index_name,
177 vnm, config->sw_if_index);
179 FOR_EACH_GROUP (group, config,
181 vlib_cli_output (vm,
"\t%U", format_igmp_key, group->key);
182 FOR_EACH_SRC (src, group, IGMP_FILTER_MODE_INCLUDE,
184 vlib_cli_output (vm,
"\t\t%U", format_igmp_key, src->key);
195 .path =
"show igmp config",
196 .short_help =
"show igmp config",
206 #define _(n,f) vlib_cli_output (vm, "%s: %d", #f, igmp_timer_type_get(n)); 214 .path =
"show igmp timers",
215 .short_help =
"show igmp timers",
229 if (
unformat (input,
"query %d", &value))
231 else if (
unformat (input,
"src %d", &value))
233 else if (
unformat (input,
"leave %d", &value))
244 .path =
"test igmp timers",
245 .short_help =
"Change the default values for IGMP timers - only sensible during unit tests",
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
vnet_main_t * vnet_get_main(void)
igmp_config_t * configs
pool of configs
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * igmp_show_timers_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void igmp_clear_config(igmp_config_t *config)
igmp clear config
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
static clib_error_t * test_igmp_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
igmp_config_t * igmp_config_lookup(u32 sw_if_index)
igmp config lookup
static clib_error_t * igmp_clear_interface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void igmp_timer_type_set(igmp_timer_type_t t, u32 v)
static clib_error_t * igmp_listen_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
collection of data related to IGMP
#define vec_free(V)
Free vector's memory (no header).
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * igmp_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
IGMP interface configuration.
IGMP group A multicast group address for which reception has been requested.
clib_error_t * igmp_cli_init(vlib_main_t *vm)
static uword vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)
IGMP source The representation of a specified source address with in multicast group.