39 ip6_hop_by_hop_ext_t ext_hdr;
40 ip6_router_alert_option_t alert;
41 ip6_padN_option_t
pad;
45 icmp6_multicast_address_record_t records[0];
46 }) icmp6_multicast_listener_report_header_t;
51 icmp6_multicast_listener_report_header_t report_hdr;
111 if (!mcast_group_info)
121 mcast_group_info->
type = 4;
125 sizeof (ip6_address_t));
141 if (mcast_group_info)
193 ip6_mld_delegate_id));
200 sizeof (ip6_address_t));
204 IP6_MULTICAST_SCOPE_link_local,
205 IP6_MULTICAST_GROUP_ID_all_hosts);
207 IP6_MULTICAST_SCOPE_link_local,
208 IP6_MULTICAST_GROUP_ID_all_routers);
210 IP6_MULTICAST_SCOPE_link_local,
211 IP6_MULTICAST_GROUP_ID_mldv2_routers);
229 mhash_unset (&imd->address_to_mldp_index, &m->mcast_address, 0);
257 icmp6_multicast_listener_report_header_t *rh0;
281 payload_length =
sizeof (icmp6_multicast_listener_report_header_t);
283 b0->
error = ICMP6_ERROR_NONE;
287 rh0 = (icmp6_multicast_listener_report_header_t *) & rp0->report_hdr;
292 clib_host_to_net_u32 (0x6 << 28);
294 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
299 rh0->icmp.type = ICMP6_multicast_listener_report_v2;
307 IP6_MULTICAST_SCOPE_link_local,
308 IP6_MULTICAST_GROUP_ID_mldv2_routers);
312 int num_addr_records = 0;
313 icmp6_multicast_address_record_t rr;
316 rh0->ext_hdr.next_hdr = IP_PROTOCOL_ICMP6;
317 rh0->ext_hdr.n_data_u64s = 0;
321 rh0->alert.value = 0;
326 rh0->icmp.checksum = 0;
332 rr.aux_data_len_u32s = 0;
333 rr.num_sources = clib_host_to_net_u16 (m->num_sources);
334 clib_memcpy(&rr.mcast_addr, &m->mcast_address, sizeof(ip6_address_t));
338 if(vlib_buffer_add_data (vm, &bo0, (void *)&rr,
339 sizeof(icmp6_multicast_address_record_t)))
341 vlib_buffer_free (vm, &bo0, 1);
345 payload_length +=
sizeof( icmp6_multicast_address_record_t);
350 rh0->num_addr_records = clib_host_to_net_u16 (num_addr_records);
353 ip0->payload_length = clib_host_to_net_u16 (payload_length);
357 ASSERT (bogus_length == 0);
368 b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
395 imd->all_routers_mcast = 0;
403 ip6_neighbor_send_mldpv2_report(imd->sw_if_index);
404 imd->all_routers_mcast = 1;
438 .name =
"ip6-mld-process",
447 u32 indent = va_arg (*args,
u32);
458 s = format (s,
"%U%U\n",
459 format_white_space, indent+2,
473 const ip6_address_t *
address,
u8 address_oength)
483 a.as_u8[0xd] = address->as_u8[0xd];
484 a.as_u8[0xe] = address->as_u8[0xe];
485 a.as_u8[0xf] = address->as_u8[0xf];
492 const ip6_address_t *
address,
u8 address_oength)
502 a.as_u8[0xd] = address->as_u8[0xd];
503 a.as_u8[0xe] = address->as_u8[0xe];
504 a.as_u8[0xf] = address->as_u8[0xf];
u8 pad[3]
log2 (size of the packing page block)
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
static void ip6_neighbor_del_mld_prefix(ip6_mld_t *imd, ip6_address_t *addr)
Delete a multicast Address from the advertised MLD set.
vnet_main_t * vnet_get_main(void)
ip6_multicast_address_scope_t
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
uword mhash_unset(mhash_t *h, void *key, uword *old_value)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
struct ip6_nd_t_ ip6_mld_t
u16 current_length
Nbytes between current data and the end of this buffer.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
adj_index_t ip6_link_get_mcast_adj(u32 sw_if_index)
#define clib_memcpy(d, s, n)
ethernet_main_t ethernet_main
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
u32 local_interface_sw_if_index
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static uword ip6_mld_timer_event(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
mhash_t address_to_mldp_index
static const ethernet_interface_t * ip6_mld_get_eth_itf(u32 sw_if_index)
static uword ip6_mld_event_process(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define pool_flush(VAR, POOL, BODY)
Remove all elements from a pool in a safe way.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
ip6_mldp_group_t * mldp_group_pool
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define IP6_MLDP_ALERT_TYPE
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
typedef CLIB_PACKED(struct { ip6_hop_by_hop_ext_t ext_hdr;ip6_router_alert_option_t alert;ip6_padN_option_t pad;icmp46_header_t icmp;u16 rsvd;u16 num_addr_records;icmp6_multicast_address_record_t records[0];})
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
ip6_link_delegate_id_t ip6_link_delegate_register(const ip6_link_delegate_vft_t *vft)
static ip6_link_delegate_id_t ip6_mld_delegate_id
#define pool_free(p)
Free a pool.
static void ip6_mld_link_enable(u32 sw_if_index)
create and initialize router advertisement parameters with default values for this intfc ...
static void ip6_mld_address_add(u32 imi, const ip6_address_t *address, u8 address_oength)
callback when an interface address is added or deleted
#define VLIB_REGISTER_NODE(x,...)
void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
ip6_address_t mcast_address
#define clib_warning(format, args...)
ip6_address_t * mcast_source_address_pool
index_t ip6_link_delegate_get(u32 sw_if_index, ip6_link_delegate_id_t id)
static void ip6_neighbor_send_mldpv2_report(u32 sw_if_index)
vlib_main_t vlib_node_runtime_t * node
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
static void ip6_mld_delegate_disable(index_t imdi)
u32 ip6_link_delegate_id_t
manual_print typedef address
static uword * mhash_get(mhash_t *h, const void *key)
static void mhash_free(mhash_t *h)
ip6_multicast_link_local_group_id_t
static void ip6_neighbor_add_mld_prefix(ip6_mld_t *imd, ip6_address_t *addr)
Add a multicast Address to the advertised MLD set.
static clib_error_t * ip6_mld_init(vlib_main_t *vm)
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
static u8 * format_ip6_mld(u8 *s, va_list *args)
ip6_link_disable_fn_t ildv_disable
vlib_node_registration_t ip6_mld_event_process_node
(constructor) VLIB_REGISTER_NODE (ip6_mld_event_process_node)
icmp6_multicast_listener_report_packet_t
static void * vlib_process_get_event_data(vlib_main_t *vm, uword *return_event_type_opaque)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
static void ip6_set_solicited_node_multicast_address(ip6_address_t *a, u32 id)
const ip6_address_t * ip6_get_link_local_address(u32 sw_if_index)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void ip6_address_copy(ip6_address_t *dst, const ip6_address_t *src)
static ip6_mld_t * ip6_mld_pool
vnet_sw_interface_type_t type
static ip6_mld_t * ip6_mld_get_itf(u32 sw_if_index)
static void ip6_mld_address_del(u32 imi, const ip6_address_t *address, u8 address_oength)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
bool ip6_link_delegate_update(u32 sw_if_index, ip6_link_delegate_id_t id, index_t ii)
static void ip6_set_reserved_multicast_address(ip6_address_t *a, ip6_multicast_address_scope_t scope, u16 id)
static void ip6_neighbor_add_mld_grp(ip6_mld_t *a, ip6_multicast_address_scope_t scope, ip6_multicast_link_local_group_id_t group)
Add a multicast Address to the advertised MLD set.