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>",
174 vlib_cli_output (vm,
"interface: %U", format_vnet_sw_if_index_name,
175 vnm, config->sw_if_index);
176 pool_foreach (sg, config->sg, (
178 vlib_cli_output (vm,
"\t(S,G): %U:%U:%U", format_ip46_address,
179 &sg->saddr, ip46_address_is_ip4 (&sg->saddr),
180 format_ip46_address, &sg->gaddr, ip46_address_is_ip4
181 (&sg->gaddr), format_igmp_report_type, sg->group_type);
191 .path =
"show igmp config",
192 .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)
igmp_config_t * configs
pool of igmp configurations
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)
#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)
static igmp_config_t * igmp_config_lookup(igmp_main_t *im, u32 sw_if_index)
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)