19 #include <sys/ioctl.h> 76 .short_help =
"clear igmp int <interface>",
88 ip46_address_t saddr, gaddr;
97 "'help igmp listen' or 'igmp listen ?' for help");
103 if (
unformat (line_input,
"enable"))
105 else if (
unformat (line_input,
"disable"))
131 rv =
igmp_listen (vm, enable, sw_if_index, saddr, gaddr,
145 "Failed to add configuration, interface is in router mode");
154 .path =
"igmp listen",
155 .short_help =
"igmp listen [<enable|disable>] " 156 "int <interface> saddr <ip4-address> gaddr <ip4-address>",
175 vlib_cli_output (vm,
"interface: %U", format_vnet_sw_if_index_name,
176 vnm, config->sw_if_index);
177 pool_foreach (group, config->groups, (
179 vlib_cli_output (vm,
"\t%U:%U", format_igmp_report_type, group->type, format_ip46_address, &group->addr, ip46_address_is_ip4 (&group->addr));
180 pool_foreach (src, group->srcs, (
182 vlib_cli_output (vm,
"\t\t%U", format_ip46_address, &src->addr, ip46_address_is_ip4 (&src->addr));
193 .path =
"show igmp config",
194 .short_help =
"show igmp config",
vnet_main_t * vnet_get_main(void)
static clib_error_t * igmp_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * igmp_listen_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...)
clib_error_t * igmp_cli_init(vlib_main_t *vm)
#define VLIB_CLI_COMMAND(x,...)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
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
static igmp_config_t * igmp_config_lookup(igmp_main_t *im, 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)
static uword vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)