66 return VNET_API_ERROR_VALUE_EXIST;
69 if (!found && !is_add)
70 return VNET_API_ERROR_NO_SUCH_ENTRY;
80 det_map->
sharing_ratio = (1 << (32 - in_plen)) / (1 << (32 - out_plen));
85 1, empty_snat_det_session);
97 if (nat_interface_is_inside(i))
100 snat_add_del_addr_to_fib(out_addr, out_plen, i->sw_if_index, is_add);
128 vec_foreach(ses, dm->sessions)
131 if (ses->in_port && (ses->expire < now))
132 snat_det_ses_close (dm, ses);
148 "nat-det-expire-walk",
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
static vlib_node_registration_t snat_det_expire_walk_node
(constructor) VLIB_REGISTER_NODE (snat_det_expire_walk_node)
snat_det_map_t * det_maps
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
#define SNAT_DET_SES_PER_USER
snat_det_session_t * sessions
#define vec_del1(v, i)
Delete the element at index I.
#define VLIB_REGISTER_NODE(x,...)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
deterministic NAT definitions
int snat_det_add_map(snat_main_t *sm, ip4_address_t *in_addr, u8 in_plen, ip4_address_t *out_addr, u8 out_plen, int is_add)
Add/delete deterministic NAT mapping.
struct _vlib_node_registration vlib_node_registration_t
ip4_main_t ip4_main
Global ip4 main structure.
#define vec_foreach(var, vec)
Vector iterator.
static uword snat_det_expire_walk_fn(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
The 'nat-det-expire-walk' process's main loop.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
snat_interface_t * interfaces