19 #ifndef __included_nat_reass_h__ 20 #define __included_nat_reass_h__ 28 #define NAT_REASS_TIMEOUT_DEFAULT 2 29 #define NAT_MAX_REASS_DEAFULT 1024 30 #define NAT_MAX_FRAG_DEFAULT 5 31 #define NAT_REASS_HT_LOAD_FACTOR (0.75) 33 #define NAT_REASS_FLAG_MAX_FRAG_DROP 1 34 #define NAT_REASS_FLAG_CLASSIFY_ED_CONTINUE 2 35 #define NAT_REASS_FLAG_ED_DONT_TRANSLATE 4 69 u32 frags_per_reass_list_head_index;
100 u32 frags_per_reass_list_head_index;
214 u16 frag_id,
u8 proto);
230 u16 frag_id,
u8 proto,
282 u32 frag_id,
u8 proto,
int nat_ip4_reass_add_fragment(nat_reass_ip4_t *reass, u32 bi, u32 **bi_to_drop)
Cache fragment.
typedef CLIB_PACKED(struct { nat_reass_ip4_key_t key;u32 lru_list_index;u32 sess_index;u32 thread_index;f64 last_heard;u32 frags_per_reass_list_head_index;u8 frag_n;u8 flags;u8 classify_next;}) nat_reass_ip4_t
u16 nat_reass_get_max_reass(u8 is_ip6)
Get maximum number of concurrent reassemblies.
clib_error_t * nat_reass_init(vlib_main_t *vm)
Initialize NAT virtual fragmentation reassembly.
void nat_ip6_reass_get_frags(nat_reass_ip6_t *reass, u32 **bi)
Get cached fragments.
void nat_ip4_reass_walk(nat_ip4_reass_walk_fn_t fn, void *ctx)
Walk IPv4 reassemblies.
int(* nat_ip6_reass_walk_fn_t)(nat_reass_ip6_t *reass, void *ctx)
Call back function when walking IPv6 reassemblies, non-zero return value stop walk.
int nat_reass_set(u32 timeout, u16 max_reass, u8 max_frag, u8 drop_frag, u8 is_ip6)
Set NAT virtual fragmentation reassembly configuration.
dlist_elt_t * ip4_frags_list_pool
dlist_elt_t * ip6_reass_lru_list_pool
nat_reass_ip6_t * ip6_reass_pool
dlist_elt_t * ip4_reass_lru_list_pool
u8 nat_reass_is_drop_frag(u8 is_ip6)
Get status of virtual fragmentation reassembly.
nat_reass_ip4_t * nat_ip4_reass_find_or_create(ip4_address_t src, ip4_address_t dst, u16 frag_id, u8 proto, u8 reset_timeout, u32 **bi_to_drop)
Find or create reassembly.
int nat_ip6_reass_add_fragment(nat_reass_ip6_t *reass, u32 bi, u32 **bi_to_drop)
Cache fragment.
int(* nat_ip4_reass_walk_fn_t)(nat_reass_ip4_t *reass, void *ctx)
Call back function when walking IPv4 reassemblies, non-zero return value stop walk.
nat_reass_ip4_t * ip4_reass_pool
dlist_elt_t * ip6_frags_list_pool
clib_bihash_16_8_t ip4_reass_hash
nat_reass_ip4_t * nat_ip4_reass_find(ip4_address_t src, ip4_address_t dst, u16 frag_id, u8 proto)
Find reassembly.
nat_reass_ip6_t * nat_ip6_reass_find_or_create(ip6_address_t src, ip6_address_t dst, u32 frag_id, u8 proto, u8 reset_timeout, u32 **bi_to_drop)
Find or create reassembly.
u32 nat_reass_get_timeout(u8 is_ip6)
Get reassembly timeout.
void nat_ip4_reass_get_frags(nat_reass_ip4_t *reass, u32 **bi)
Get cached fragments.
u8 nat_reass_get_max_frag(u8 is_ip6)
Get maximum number of fragmets per reassembly.
clib_bihash_48_8_t ip6_reass_hash
clib_spinlock_t ip6_reass_lock
void nat_ip6_reass_walk(nat_ip6_reass_walk_fn_t fn, void *ctx)
Walk IPv6 reassemblies.
clib_spinlock_t ip4_reass_lock