19 #include <sys/ioctl.h> 75 .short_help =
"clear igmp int <interface>",
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>",
179 if (
unformat (line_input,
"enable"))
181 else if (
unformat (line_input,
"disable"))
184 mode = IGMP_MODE_HOST;
185 else if (
unformat (line_input,
"router"))
186 mode = IGMP_MODE_ROUTER;
187 else if (
unformat (line_input,
"%U",
198 if (~0 == sw_if_index)
217 .short_help =
"igmp <enable|disable> <host|router> <interface>",
242 else if (
unformat (line_input,
"del"))
244 else if (
unformat (line_input,
"vrf-id %u", &vrf_id))
246 else if (
unformat (line_input,
"%U",
257 if (~0 == sw_if_index)
280 .path =
"igmp proxy-dev",
281 .short_help =
"igmp proxy-dev <add|del> vrf-id <table-id> <interface>",
306 else if (
unformat (line_input,
"del"))
308 else if (
unformat (line_input,
"vrf-id %u", &vrf_id))
310 else if (
unformat (line_input,
"%U",
321 if (~0 == sw_if_index)
344 .path =
"igmp proxy-dev itf",
345 .short_help =
"igmp proxy-dev itf <add|del> vrf-id <table-id> <interface>",
361 vlib_cli_output (vm,
"%U", format_igmp_config, config);
370 .path =
"show igmp config",
371 .short_help =
"show igmp config",
381 #define _(n,f) vlib_cli_output (vm, "%s: %d", #f, igmp_timer_type_get(n)); 389 .path =
"show igmp timers",
390 .short_help =
"show igmp timers",
404 if (
unformat (input,
"query %d", &value))
406 else if (
unformat (input,
"src %d", &value))
408 else if (
unformat (input,
"leave %d", &value))
419 .path =
"test igmp timers",
420 .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
int igmp_proxy_device_add_del_interface(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del interface.
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)
static clib_error_t * igmp_proxy_device_add_del_interface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#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
int igmp_enable_disable(u32 sw_if_index, u8 enable, igmp_mode_t mode)
IGMP interface enable/disable.
vl_api_ip4_address_t saddrs[n_srcs]
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)
static clib_error_t * igmp_proxy_device_add_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
collection of data related to IGMP
vl_api_tunnel_mode_t mode
vl_api_ip4_address_t gaddr
#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)
IGMP interface configuration.
clib_error_t * igmp_cli_init(vlib_main_t *vm)
enum igmp_mode_t_ igmp_mode_t
static vnet_sw_interface_flags_t vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * igmp_enable_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int igmp_proxy_device_add_del(u32 vrf_id, u32 sw_if_index, u8 add)
IGMP proxy device add/del.
vl_api_interface_index_t sw_if_index