71 u32 no_default_route : 1;
86 u32 n_left_from, * from, * to_next;
99 while (n_left_from > 0)
104 to_next, n_left_to_next);
106 while (n_left_from >= 4 && n_left_to_next >= 2)
114 u32 pi0, next0, pass0, adj_index0;
115 u32 pi1, next1, pass1, adj_index1;
131 pi0 = to_next[0] = from[0];
132 pi1 = to_next[1] = from[1];
197 p0->
error = error_node->
errors[IP4_ERROR_UNICAST_SOURCE_CHECK_FAILS];
198 p1->
error = error_node->
errors[IP4_ERROR_UNICAST_SOURCE_CHECK_FAILS];
201 to_next, n_left_to_next,
202 pi0, pi1, next0, next1);
205 while (n_left_from > 0 && n_left_to_next > 0)
213 u32 pi0, next0, pass0, adj_index0;
257 p0->
error = error_node->
errors[IP4_ERROR_UNICAST_SOURCE_CHECK_FAILS];
260 to_next, n_left_to_next,
288 .name =
"ip4-source-check-via-any",
289 .vector_size =
sizeof (
u32),
302 .name =
"ip4-source-check-via-rx",
303 .vector_size =
sizeof (
u32),
324 u32 sw_if_index, is_del, ci;
360 .path =
"set interface ip source-check",
362 .short_help =
"Set IP4/IP6 interface unicast source check",
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
always_inline ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step(ip4_fib_mtrie_t *m, ip4_fib_mtrie_leaf_t current_leaf, ip4_address_t *dst_address, u32 dst_address_byte_index)
always_inline uword ip4_address_is_multicast(ip4_address_t *a)
u32 * config_index_by_sw_if_index
always_inline uword ip4_source_check_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip4_source_check_type_t source_check_type)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
ip_lookup_next_t lookup_next_index
always_inline u32 ip4_fib_mtrie_leaf_get_adj_index(ip4_fib_mtrie_leaf_t n)
u32 vnet_config_del_feature(vlib_main_t *vm, vnet_config_main_t *cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes)
ip_config_main_t rx_config_mains[VNET_N_CAST]
ip_lookup_main_t lookup_main
u32 * fib_index_by_sw_if_index
unformat_function_t unformat_vnet_sw_interface
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_main_t * vnet_get_main(void)
static clib_error_t * set_ip_source_check(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
u32 ip4_fib_lookup_with_table(ip4_main_t *im, u32 fib_index, ip4_address_t *dst, u32 disable_default_route)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
static uword ip4_source_check_reachable_via_rx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_node_registration_t ip4_input_node
(constructor) VLIB_REGISTER_NODE (ip4_input_node)
vlib_node_registration_t ip4_check_source_reachable_via_rx
(constructor) VLIB_REGISTER_NODE (ip4_check_source_reachable_via_rx)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define CLIB_PREFETCH(addr, size, type)
clib_error_t * ip4_source_check_init(vlib_main_t *vm)
#define VLIB_CLI_COMMAND(x,...)
#define IP4_FIB_MTRIE_LEAF_ROOT
#define VLIB_NODE_FLAG_TRACE
u32 vnet_config_add_feature(vlib_main_t *vm, vnet_config_main_t *cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes)
always_inline ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)
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)
static uword ip4_source_check_reachable_via_any(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
always_inline vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
vlib_node_registration_t ip4_check_source_reachable_via_any
(constructor) VLIB_REGISTER_NODE (ip4_check_source_reachable_via_any)
#define clib_error_return(e, args...)
always_inline void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
static u8 * format_ip4_source_check_trace(u8 *s, va_list *va)
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vnet_config_main_t config_main