FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
ip6_reassembly.c File Reference

IPv6 Reassembly. More...

+ Include dependency graph for ip6_reassembly.c:

Go to the source code of this file.

Data Structures

struct  ip6_reass_key_t
 
struct  ip6_reass_t
 
struct  ip6_reass_per_thread_t
 
struct  ip6_reass_main_t
 
struct  ip6_reass_range_trace_t
 
struct  ip6_reass_trace_t
 
struct  ip6_rehash_cb_ctx
 

Macros

#define MSEC_PER_SEC   1000
 
#define IP6_REASS_TIMEOUT_DEFAULT_MS   100
 
#define IP6_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS   10000
 
#define IP6_REASS_MAX_REASSEMBLIES_DEFAULT   1024
 
#define IP6_REASS_HT_LOAD_FACTOR   (0.75)
 

Enumerations

enum  ip6_reass_next_t { IP6_REASSEMBLY_NEXT_INPUT, IP6_REASSEMBLY_NEXT_DROP, IP6_REASSEMBLY_NEXT_ICMP_ERROR, IP6_REASSEMBLY_N_NEXT }
 
enum  ip6_reass_trace_operation_e {
  RANGE_NEW, RANGE_OVERLAP, ICMP_ERROR_RT_EXCEEDED, ICMP_ERROR_FL_TOO_BIG,
  ICMP_ERROR_FL_NOT_MULT_8, FINALIZE
}
 
enum  ip6_reass_event_t { IP6_EVENT_CONFIG_CHANGED = 1 }
 

Functions

static u32 ip6_reass_buffer_get_data_offset_no_check (vlib_buffer_t *b)
 
static u32 ip6_reass_buffer_get_data_offset (vlib_buffer_t *b)
 
static u16 ip6_reass_buffer_get_data_len_no_check (vlib_buffer_t *b)
 
static u16 ip6_reass_buffer_get_data_len (vlib_buffer_t *b)
 
static void ip6_reass_trace_details (vlib_main_t *vm, u32 bi, ip6_reass_range_trace_t *trace)
 
static u8format_ip6_reass_range_trace (u8 *s, va_list *args)
 
static u8format_ip6_reass_trace (u8 *s, va_list *args)
 
static void ip6_reass_add_trace (vlib_main_t *vm, vlib_node_runtime_t *node, ip6_reass_main_t *rm, ip6_reass_t *reass, u32 bi, ip6_reass_trace_operation_e action, u32 size_diff)
 
static void ip6_reass_free (ip6_reass_main_t *rm, ip6_reass_per_thread_t *rt, ip6_reass_t *reass)
 
static void ip6_reass_drop_all (vlib_main_t *vm, ip6_reass_main_t *rm, ip6_reass_t *reass, u32 **vec_drop_bi)
 
static void ip6_reass_on_timeout (vlib_main_t *vm, vlib_node_runtime_t *node, ip6_reass_main_t *rm, ip6_reass_t *reass, u32 *icmp_bi, u32 **vec_timeout)
 
static ip6_reass_tip6_reass_find_or_create (vlib_main_t *vm, vlib_node_runtime_t *node, ip6_reass_main_t *rm, ip6_reass_per_thread_t *rt, ip6_reass_key_t *k, u32 *icmp_bi, u32 **vec_timeout)
 
static void ip6_reass_finalize (vlib_main_t *vm, vlib_node_runtime_t *node, ip6_reass_main_t *rm, ip6_reass_per_thread_t *rt, ip6_reass_t *reass, u32 *bi0, u32 *next0, u32 *error0, u32 **vec_drop_compress, bool is_feature)
 
static u32 ip6_reass_get_buffer_chain_length (vlib_main_t *vm, vlib_buffer_t *b)
 
static void ip6_reass_insert_range_in_chain (vlib_main_t *vm, ip6_reass_main_t *rm, ip6_reass_per_thread_t *rt, ip6_reass_t *reass, u32 prev_range_bi, u32 new_next_bi)
 
static void ip6_reass_update (vlib_main_t *vm, vlib_node_runtime_t *node, ip6_reass_main_t *rm, ip6_reass_per_thread_t *rt, ip6_reass_t *reass, u32 *bi0, u32 *next0, u32 *error0, ip6_frag_hdr_t *frag_hdr, u32 **vec_drop_overlap, u32 **vec_drop_compress, bool is_feature)
 
static bool ip6_reass_verify_upper_layer_present (vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
 
static bool ip6_reass_verify_fragment_multiple_8 (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
 
static bool ip6_reass_verify_packet_size_lt_64k (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
 
static uword ip6_reassembly_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature)
 
static uword ip6_reassembly (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip6_reass_node, ip6_reassembly)
 
static uword ip6_reassembly_feature (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip6_reass_node_feature, ip6_reassembly_feature)
 
 VNET_FEATURE_INIT (ip6_reassembly_feature, static)
 
static u32 ip6_reass_get_nbuckets ()
 
static void ip6_rehash_cb (clib_bihash_kv_48_8_t *kv, void *_ctx)
 
static void ip6_reass_set_params (u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms)
 
vnet_api_error_t ip6_reass_set (u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms)
 set ip6 reassembly configuration More...
 
vnet_api_error_t ip6_reass_get (u32 *timeout_ms, u32 *max_reassemblies, u32 *expire_walk_interval_ms)
 get ip6 reassembly configuration More...
 
static clib_error_tip6_reass_init_function (vlib_main_t *vm)
 
static uword ip6_reass_walk_expired (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static u8format_ip6_reass_key (u8 *s, va_list *args)
 
static u8format_ip6_reass (u8 *s, va_list *args)
 
static clib_error_tshow_ip6_reass (vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
 
vnet_api_error_t ip6_reass_enable_disable (u32 sw_if_index, u8 enable_disable)
 

Variables

static vlib_node_registration_t ip6_reass_node
 (constructor) VLIB_REGISTER_NODE (ip6_reass_node) More...
 
ip6_reass_main_t ip6_reass_main
 
static char * ip6_reassembly_error_strings []
 
static vlib_node_registration_t ip6_reass_node_feature
 (constructor) VLIB_REGISTER_NODE (ip6_reass_node_feature) More...
 
static vlib_node_registration_t ip6_reass_expire_node
 (constructor) VLIB_REGISTER_NODE (ip6_reass_expire_node) More...
 
static vlib_cli_command_t show_ip6_reassembly_cmd
 (constructor) VLIB_CLI_COMMAND (show_ip6_reassembly_cmd) More...
 

Detailed Description

IPv6 Reassembly.

This file contains the source code for IPv6 reassembly.

Definition in file ip6_reassembly.c.

Macro Definition Documentation

#define IP6_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS   10000

Definition at line 31 of file ip6_reassembly.c.

#define IP6_REASS_HT_LOAD_FACTOR   (0.75)

Definition at line 33 of file ip6_reassembly.c.

#define IP6_REASS_MAX_REASSEMBLIES_DEFAULT   1024

Definition at line 32 of file ip6_reassembly.c.

#define IP6_REASS_TIMEOUT_DEFAULT_MS   100

Definition at line 30 of file ip6_reassembly.c.

#define MSEC_PER_SEC   1000

Definition at line 29 of file ip6_reassembly.c.

Enumeration Type Documentation

Enumerator
IP6_EVENT_CONFIG_CHANGED 

Definition at line 1109 of file ip6_reassembly.c.

Enumerator
IP6_REASSEMBLY_NEXT_INPUT 
IP6_REASSEMBLY_NEXT_DROP 
IP6_REASSEMBLY_NEXT_ICMP_ERROR 
IP6_REASSEMBLY_N_NEXT 

Definition at line 146 of file ip6_reassembly.c.

Enumerator
RANGE_NEW 
RANGE_OVERLAP 
ICMP_ERROR_RT_EXCEEDED 
ICMP_ERROR_FL_TOO_BIG 
ICMP_ERROR_FL_NOT_MULT_8 
FINALIZE 

Definition at line 154 of file ip6_reassembly.c.

Function Documentation

static u8* format_ip6_reass ( u8 s,
va_list *  args 
)
static

Definition at line 1423 of file ip6_reassembly.c.

+ Here is the call graph for this function:

static u8* format_ip6_reass_key ( u8 s,
va_list *  args 
)
static

Definition at line 1413 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ip6_reass_range_trace ( u8 s,
va_list *  args 
)
static

Definition at line 200 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ip6_reass_trace ( u8 s,
va_list *  args 
)
static

Definition at line 210 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_reass_add_trace ( vlib_main_t vm,
vlib_node_runtime_t node,
ip6_reass_main_t rm,
ip6_reass_t reass,
u32  bi,
ip6_reass_trace_operation_e  action,
u32  size_diff 
)
static

Definition at line 252 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u16 ip6_reass_buffer_get_data_len ( vlib_buffer_t b)
inlinestatic

Definition at line 81 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u16 ip6_reass_buffer_get_data_len_no_check ( vlib_buffer_t b)
inlinestatic

Definition at line 73 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip6_reass_buffer_get_data_offset ( vlib_buffer_t b)
inlinestatic

Definition at line 65 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip6_reass_buffer_get_data_offset_no_check ( vlib_buffer_t b)
inlinestatic

Definition at line 58 of file ip6_reassembly.c.

+ Here is the caller graph for this function:

static void ip6_reass_drop_all ( vlib_main_t vm,
ip6_reass_main_t rm,
ip6_reass_t reass,
u32 **  vec_drop_bi 
)
inlinestatic

Definition at line 302 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vnet_api_error_t ip6_reass_enable_disable ( u32  sw_if_index,
u8  enable_disable 
)

Definition at line 1513 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_reass_finalize ( vlib_main_t vm,
vlib_node_runtime_t node,
ip6_reass_main_t rm,
ip6_reass_per_thread_t rt,
ip6_reass_t reass,
u32 bi0,
u32 next0,
u32 error0,
u32 **  vec_drop_compress,
bool  is_feature 
)
inlinestatic

Definition at line 437 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ip6_reass_t* ip6_reass_find_or_create ( vlib_main_t vm,
vlib_node_runtime_t node,
ip6_reass_main_t rm,
ip6_reass_per_thread_t rt,
ip6_reass_key_t k,
u32 icmp_bi,
u32 **  vec_timeout 
)
inlinestatic

Definition at line 368 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_reass_free ( ip6_reass_main_t rm,
ip6_reass_per_thread_t rt,
ip6_reass_t reass 
)
inlinestatic

Definition at line 286 of file ip6_reassembly.c.

+ Here is the caller graph for this function:

vnet_api_error_t ip6_reass_get ( u32 timeout_ms,
u32 max_reassemblies,
u32 expire_walk_interval_ms 
)

get ip6 reassembly configuration

Definition at line 1178 of file ip6_reassembly.c.

+ Here is the caller graph for this function:

static u32 ip6_reass_get_buffer_chain_length ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 612 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip6_reass_get_nbuckets ( )
static

Definition at line 1093 of file ip6_reassembly.c.

+ Here is the caller graph for this function:

static clib_error_t* ip6_reass_init_function ( vlib_main_t vm)
static

Definition at line 1188 of file ip6_reassembly.c.

+ Here is the call graph for this function:

static void ip6_reass_insert_range_in_chain ( vlib_main_t vm,
ip6_reass_main_t rm,
ip6_reass_per_thread_t rt,
ip6_reass_t reass,
u32  prev_range_bi,
u32  new_next_bi 
)
inlinestatic

Definition at line 631 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_reass_on_timeout ( vlib_main_t vm,
vlib_node_runtime_t node,
ip6_reass_main_t rm,
ip6_reass_t reass,
u32 icmp_bi,
u32 **  vec_timeout 
)
inlinestatic

Definition at line 332 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vnet_api_error_t ip6_reass_set ( u32  timeout_ms,
u32  max_reassemblies,
u32  expire_walk_interval_ms 
)

set ip6 reassembly configuration

Definition at line 1141 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_reass_set_params ( u32  timeout_ms,
u32  max_reassemblies,
u32  expire_walk_interval_ms 
)
static

Definition at line 1131 of file ip6_reassembly.c.

+ Here is the caller graph for this function:

static void ip6_reass_trace_details ( vlib_main_t vm,
u32  bi,
ip6_reass_range_trace_t trace 
)
static

Definition at line 187 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_reass_update ( vlib_main_t vm,
vlib_node_runtime_t node,
ip6_reass_main_t rm,
ip6_reass_per_thread_t rt,
ip6_reass_t reass,
u32 bi0,
u32 next0,
u32 error0,
ip6_frag_hdr_t *  frag_hdr,
u32 **  vec_drop_overlap,
u32 **  vec_drop_compress,
bool  is_feature 
)
inlinestatic

Definition at line 659 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ip6_reass_verify_fragment_multiple_8 ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_buffer_t b,
ip6_frag_hdr_t *  frag_hdr 
)
inlinestatic

Definition at line 806 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ip6_reass_verify_packet_size_lt_64k ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_buffer_t b,
ip6_frag_hdr_t *  frag_hdr 
)
inlinestatic

Definition at line 828 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ip6_reass_verify_upper_layer_present ( vlib_node_runtime_t node,
vlib_buffer_t b,
ip6_frag_hdr_t *  frag_hdr 
)
inlinestatic

Definition at line 784 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ip6_reass_walk_expired ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 1235 of file ip6_reassembly.c.

+ Here is the call graph for this function:

static uword ip6_reassembly ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1030 of file ip6_reassembly.c.

+ Here is the call graph for this function:

static uword ip6_reassembly_feature ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1057 of file ip6_reassembly.c.

+ Here is the call graph for this function:

static uword ip6_reassembly_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
bool  is_feature 
)
inlinestatic

Definition at line 851 of file ip6_reassembly.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip6_rehash_cb ( clib_bihash_kv_48_8_t kv,
void *  _ctx 
)
static

Definition at line 1121 of file ip6_reassembly.c.

+ Here is the caller graph for this function:

static clib_error_t* show_ip6_reass ( vlib_main_t vm,
unformat_input_t input,
CLIB_UNUSED(vlib_cli_command_t *lmd)   
)
static

Definition at line 1459 of file ip6_reassembly.c.

+ Here is the call graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( ip6_reass_node  ,
ip6_reassembly   
)

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( ip6_reass_node_feature  ,
ip6_reassembly_feature   
)
VNET_FEATURE_INIT ( ip6_reassembly_feature  ,
static   
)

Variable Documentation

static vlib_node_registration_t ip6_reass_expire_node
static
Initial value:
= {
.format_trace = format_ip6_reass_trace,
.name = "ip6-reassembly-expire-walk",
.error_strings = ip6_reassembly_error_strings,
}
static char * ip6_reassembly_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:59
static u8 * format_ip6_reass_trace(u8 *s, va_list *args)
static uword ip6_reass_walk_expired(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)

(constructor) VLIB_REGISTER_NODE (ip6_reass_expire_node)

Definition at line 1397 of file ip6_reassembly.c.

ip6_reass_main_t ip6_reass_main

Definition at line 144 of file ip6_reassembly.c.

static vlib_node_registration_t ip6_reass_node
static
Initial value:
= {
.function = ip6_reassembly,
.name = "ip6-reassembly",
.vector_size = sizeof (u32),
.format_trace = format_ip6_reass_trace,
.error_strings = ip6_reassembly_error_strings,
.n_next_nodes = IP6_REASSEMBLY_N_NEXT,
.next_nodes =
{
[IP6_REASSEMBLY_NEXT_INPUT] = "ip6-input",
[IP6_REASSEMBLY_NEXT_DROP] = "ip6-drop",
[IP6_REASSEMBLY_NEXT_ICMP_ERROR] = "ip6-icmp-error",
},
}
static uword ip6_reassembly(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
unsigned int u32
Definition: types.h:88
static char * ip6_reassembly_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:59
static u8 * format_ip6_reass_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (ip6_reass_node)

Definition at line 35 of file ip6_reassembly.c.

vlib_node_registration_t ip6_reass_node_feature
static
Initial value:
= {
.name = "ip6-reassembly-feature",
.vector_size = sizeof (u32),
.format_trace = format_ip6_reass_trace,
.error_strings = ip6_reassembly_error_strings,
.n_next_nodes = IP6_REASSEMBLY_N_NEXT,
.next_nodes =
{
[IP6_REASSEMBLY_NEXT_INPUT] = "ip6-input",
[IP6_REASSEMBLY_NEXT_DROP] = "ip6-drop",
[IP6_REASSEMBLY_NEXT_ICMP_ERROR] = "ip6-icmp-error",
},
}
unsigned int u32
Definition: types.h:88
static char * ip6_reassembly_error_strings[]
#define ARRAY_LEN(x)
Definition: clib.h:59
static u8 * format_ip6_reass_trace(u8 *s, va_list *args)
static uword ip6_reassembly_feature(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

(constructor) VLIB_REGISTER_NODE (ip6_reass_node_feature)

Definition at line 1064 of file ip6_reassembly.c.

char* ip6_reassembly_error_strings[]
static
Initial value:
= {
#define _(sym, string)
}
#define foreach_ip6_error
Definition: ip6_error.h:43

Definition at line 1023 of file ip6_reassembly.c.

vlib_cli_command_t show_ip6_reassembly_cmd
static
Initial value:
= {
.path = "show ip6-reassembly",
.short_help = "show ip6-reassembly [details]",
.function = show_ip6_reass,
}
static clib_error_t * show_ip6_reass(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))

(constructor) VLIB_CLI_COMMAND (show_ip6_reassembly_cmd)

Definition at line 1505 of file ip6_reassembly.c.