|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
36 #define DEF_MAX_RADV_INTERVAL 200
37 #define DEF_MIN_RADV_INTERVAL .75 * DEF_MAX_RADV_INTERVAL
56 uword is_solicitation)
77 ? ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address
78 : ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address);
79 n_advertisements_sent = 0;
89 icmp6_neighbor_solicitation_or_advertisement_header_t *h0;
90 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
91 u32 bi0, options_len0, sw_if_index0, next0, error0;
92 u32 ip6_sadd_link_local, ip6_sadd_unspecified;
96 bi0 = to_next[0] =
from[0];
109 error0 = ICMP6_ERROR_NONE;
111 ip6_sadd_link_local =
113 ip6_sadd_unspecified =
117 if (!ip6_sadd_unspecified && !ip6_sadd_link_local)
130 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
133 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK
139 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK;
143 o0 = (
void *) (h0 + 1);
144 o0 = ((options_len0 == 8 && o0->header.type == option_type
145 && o0->header.n_data_u64s == 1) ? o0 : 0);
148 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
149 !ip6_sadd_unspecified))
156 .ip.ip6 = (is_solicitation ?
162 memcpy (&learn.
mac, o0->ethernet_address, sizeof (learn.
mac));
166 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
177 error0 = ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
185 &h0->target_address, 128);
198 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
226 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
233 next0 = (error0 != ICMP6_ERROR_NONE
239 error0 = error0 == ICMP6_ERROR_NONE ?
240 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_RX : error0;
243 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
247 n_advertisements_sent++;
253 to_next, n_left_to_next,
262 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_TX,
263 n_advertisements_sent);
265 return frame->n_vectors;
341 .name =
"icmp6-neighbor-solicitation",
343 .vector_size =
sizeof (
u32),
357 .name =
"icmp6-neighbor-advertisement",
359 .vector_size =
sizeof (
u32),
374 u32 indent = va_arg (*args,
u32);
376 s =
format (s,
"%UNeighbor Discovery: enabled\n",
379 s =
format (s,
"%UICMP redirects are disabled\n",
381 s =
format (s,
"%UICMP unreachables are not sent\n",
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
vnet_interface_main_t * im
@ FIB_SOURCE_IP6_ND
IPv6 ND (seen in the link-local tables)
index_t ip6_link_delegate_get(u32 sw_if_index, ip6_link_delegate_id_t id)
@ IP_LOOKUP_NEXT_ARP
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
vnet_sw_interface_type_t type
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static uword icmp6_neighbor_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Virtual function Table for neighbor protocol implementations to register.
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static vlib_node_registration_t ip6_icmp_neighbor_advertisement_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_neighbor_advertisement_node)
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void ip6_nd_delegate_disable(index_t indi)
enum icmp6_neighbor_discovery_option_type icmp6_neighbor_discovery_option_type_t
fib_node_index_t ip6_fib_table_lookup_exact_match(u32 fib_index, const ip6_address_t *addr, u32 len)
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
vlib_main_t vlib_node_runtime_t * node
#define FIB_NODE_INDEX_INVALID
ip6_link_disable_fn_t ildv_disable
bool ip6_link_delegate_update(u32 sw_if_index, ip6_link_delegate_id_t id, index_t ii)
const static ip_neighbor_vft_t ip6_nd_impl_vft
VFT to act as an implementation of a neighbour protocol.
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static uword ip6_address_is_unspecified(const ip6_address_t *a)
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static void * ip6_next_header(ip6_header_t *i)
ip6_link_delegate_id_t ip6_link_delegate_register(const ip6_link_delegate_vft_t *vft)
const static ip6_link_delegate_vft_t ip6_nd_delegate_vft
VFT for registering as a delegate to an IP6 link.
static ip6_nd_t * ip6_nd_pool
ip6_neighbor_proxy_cfg_t inv_proxy6_add
void icmp6_register_type(vlib_main_t *vm, icmp6_type_t type, u32 node_index)
u32 n_solicitations_dropped
int ip6_nd_proxy_add(u32 sw_if_index, const ip6_address_t *addr)
vlib_error_t * errors
Vector of errors for this node.
static vlib_node_registration_t ip6_icmp_neighbor_solicitation_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_neighbor_solicitation_node)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
@ FIB_SOURCE_INTERFACE
Route added as a result of interface configuration.
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
void ip_neighbor_register(ip_address_family_t af, const ip_neighbor_vft_t *vft)
u32 ip6_link_delegate_id_t
static_always_inline uword icmp6_neighbor_solicitation_or_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword is_solicitation)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static u8 * format_ip6_nd(u8 *s, va_list *args)
#define static_always_inline
u32 fib_node_index_t
A typedef of a node index.
@ ICMP6_NEIGHBOR_SOLICITATION_NEXT_REPLY
static clib_error_t * ip6_nd_init(vlib_main_t *vm)
static u32 ip6_src_lookup_for_packet(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
return the DPO that the LB stacks on.
fib_entry_flag_t fib_entry_get_flags_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
u32 ip6_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
struct ip6_nd_t_ ip6_nd_t
struct _vlib_node_registration vlib_node_registration_t
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
static_always_inline void icmp6_send_neighbor_advertisement(vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6_h, icmp6_neighbor_solicitation_or_advertisement_header_t *icmp6_nsa, icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *icmp6_nd_ell_addr, u32 sw_if_index0)
format_function_t format_icmp6_input_trace
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
u32 node_index
Node index.
ethernet_main_t ethernet_main
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
void ip_neighbor_learn_dp(const ip_neighbor_learn_t *l)
APIs invoked by neighbor implementation (i.s.
static ip6_link_delegate_id_t ip6_nd_delegate_id
#define VLIB_INIT_FUNCTION(x)
@ FIB_SOURCE_IP6_ND_PROXY
IPv6 Proxy ND.
@ ICMP6_NEIGHBOR_SOLICITATION_N_NEXT
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
static uword icmp6_neighbor_solicitation(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
u32 ip6_ll_fib_get(u32 sw_if_index)
For use in the data plane.
int ip6_nd_proxy_del(u32 sw_if_index, const ip6_address_t *addr)
static const ethernet_interface_t * ip6_nd_get_eth_itf(u32 sw_if_index)
vlib_node_registration_t ip6_icmp_input_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_input_node)
@ VNET_SW_INTERFACE_TYPE_HARDWARE
static void ip6_nd_link_enable(u32 sw_if_index)
called when IP6 is enabled on a link.
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vl_api_interface_index_t sw_if_index
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
@ ICMP6_NEIGHBOR_SOLICITATION_NEXT_DROP
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)