40 ip6_hop_by_hop_ext_t ext_hdr;
41 ip6_router_alert_option_t alert;
42 ip6_padN_option_t
pad;
46 icmp6_multicast_address_record_t records[0];
47 }) icmp6_multicast_listener_report_header_t;
52 icmp6_multicast_listener_report_header_t report_hdr;
112 if (!mcast_group_info)
122 mcast_group_info->
type = 4;
126 sizeof (ip6_address_t));
142 if (mcast_group_info)
194 ip6_mld_delegate_id));
201 sizeof (ip6_address_t));
205 IP6_MULTICAST_SCOPE_link_local,
206 IP6_MULTICAST_GROUP_ID_all_hosts);
208 IP6_MULTICAST_SCOPE_link_local,
209 IP6_MULTICAST_GROUP_ID_all_routers);
211 IP6_MULTICAST_SCOPE_link_local,
212 IP6_MULTICAST_GROUP_ID_mldv2_routers);
230 mhash_unset (&imd->address_to_mldp_index, &m->mcast_address, 0);
258 icmp6_multicast_listener_report_header_t *rh0;
282 payload_length =
sizeof (icmp6_multicast_listener_report_header_t);
284 b0->
error = ICMP6_ERROR_NONE;
288 rh0 = (icmp6_multicast_listener_report_header_t *) & rp0->report_hdr;
293 clib_host_to_net_u32 (0x6 << 28);
295 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
300 rh0->icmp.type = ICMP6_multicast_listener_report_v2;
308 IP6_MULTICAST_SCOPE_link_local,
309 IP6_MULTICAST_GROUP_ID_mldv2_routers);
313 int num_addr_records = 0;
314 icmp6_multicast_address_record_t rr;
317 rh0->ext_hdr.next_hdr = IP_PROTOCOL_ICMP6;
318 rh0->ext_hdr.n_data_u64s = 0;
322 rh0->alert.value = 0;
327 rh0->icmp.checksum = 0;
333 rr.aux_data_len_u32s = 0;
334 rr.num_sources = clib_host_to_net_u16 (m->
num_sources);
340 sizeof(icmp6_multicast_address_record_t)))
346 payload_length +=
sizeof( icmp6_multicast_address_record_t);
351 rh0->num_addr_records = clib_host_to_net_u16 (num_addr_records);
358 ASSERT (bogus_length == 0);
369 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
439 .name =
"ip6-mld-process",
448 u32 indent = va_arg (*args,
u32);
474 const ip6_address_t *
address,
u8 address_oength)
484 a.as_u8[0xd] = address->as_u8[0xd];
485 a.as_u8[0xe] = address->as_u8[0xe];
486 a.as_u8[0xf] = address->as_u8[0xf];
493 const ip6_address_t *
address,
u8 address_oength)
503 a.as_u8[0xd] = address->as_u8[0xd];
504 a.as_u8[0xe] = address->as_u8[0xe];
505 a.as_u8[0xf] = address->as_u8[0xf];
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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 vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
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.
#define pool_foreach(VAR, POOL)
Iterate through pool.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
struct ip6_nd_t_ ip6_mld_t
int vlib_buffer_add_data(vlib_main_t *vm, u32 *buffer_index, void *data, u32 n_data_bytes)
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 VLIB_INIT_FUNCTION(x)
u32 local_interface_sw_if_index
description fragment has unexpected format
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
__clib_export void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
#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,...)
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
__clib_export uword mhash_unset(mhash_t *h, void *key, uword *old_value)
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.