19 #ifndef __included_nat64_db_h__ 20 #define __included_nat64_db_h__ 54 }) nat64_db_bib_entry_t;
61 #define _(N, i, n, s) \ 62 nat64_db_bib_entry_t *_##n##_bib; 100 }) nat64_db_st_entry_t;
107 #define _(N, i, n, s) \ 108 nat64_db_st_entry_t *_##n##_st; 150 u16 in_port,
u16 out_port,
193 ip46_address_t *
addr,
196 u32 fib_index,
u8 is_ip6);
222 nat64_db_bib_entry_t * bibe,
250 ip46_address_t * l_addr,
251 ip46_address_t * r_addr,
254 u32 fib_index,
u8 is_ip6);
nat64_db_bib_entry_t * nat64_db_bib_entry_find(nat64_db_t *db, ip46_address_t *addr, u16 port, snat_protocol_t proto, u32 fib_index, u8 is_ip6)
Find NAT64 BIB entry.
nat64_db_st_entry_t * nat64_db_st_entry_find(nat64_db_t *db, ip46_address_t *l_addr, ip46_address_t *r_addr, u16 l_port, u16 r_port, snat_protocol_t proto, u32 fib_index, u8 is_ip6)
Find NAT64 session table entry.
typedef CLIB_PACKED(struct{ip6_address_t in_addr;u16 in_port;ip4_address_t out_addr;u16 out_port;u32 fib_index;u32 ses_num;u8 proto;u8 is_static;}) nat64_db_bib_entry_t
int(* nat64_db_bib_walk_fn_t)(nat64_db_bib_entry_t *bibe, void *ctx)
Call back function when walking NAT64 BIB, non-zero return value stop walk.
foreach_snat_protocol clib_bihash_48_8_t in2out
void nat64_db_st_walk(nat64_db_t *db, snat_protocol_t proto, nat64_db_st_walk_fn_t fn, void *ctx)
Walk NAT64 session table.
nat64_db_st_entry_t * nat64_db_st_entry_create(nat64_db_t *db, nat64_db_bib_entry_t *bibe, ip6_address_t *in_r_addr, ip4_address_t *out_r_addr, u16 r_port)
Create new NAT64 session table entry.
void nat64_db_st_entry_free(nat64_db_t *db, nat64_db_st_entry_t *ste)
Free NAT64 session table entry.
foreach_snat_protocol clib_bihash_24_8_t in2out
nat64_db_bib_entry_t * nat64_db_bib_entry_create(nat64_db_t *db, ip6_address_t *in_addr, ip4_address_t *out_addr, u16 in_port, u16 out_port, u32 fib_index, snat_protocol_t proto, u8 is_static)
Create new NAT64 BIB entry.
nat64_db_bib_entry_t * nat64_db_bib_entry_by_index(nat64_db_t *db, snat_protocol_t proto, u32 bibe_index)
Get BIB entry by index and protocol.
void nad64_db_st_free_expired(nat64_db_t *db, u32 now)
Free expired session entries in session tables.
void nat64_db_bib_walk(nat64_db_t *db, snat_protocol_t proto, nat64_db_bib_walk_fn_t fn, void *ctx)
Walk NAT64 BIB.
void nat64_db_bib_entry_free(nat64_db_t *db, nat64_db_bib_entry_t *bibe)
Free NAT64 BIB entry.
clib_bihash_24_8_t out2in
int(* nat64_db_st_walk_fn_t)(nat64_db_st_entry_t *ste, void *ctx)
Call back function when walking NAT64 session table, non-zero return value stop walk.
int nat64_db_init(nat64_db_t *db)
Initialize NAT64 DB.
clib_bihash_48_8_t out2in