|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
29 #define _(N, i, n, s) else if (unformat (input, s)) *r = NAT_PROTOCOL_##N;
45 #define _(N, j, n, str) case NAT_PROTOCOL_##N: t = (u8 *) str; break;
64 #define _(v, N, s) case NAT_ADDR_AND_PORT_ALLOC_ALG_##N: t = (u8 *) s; break;
87 s =
format (s,
"%U proto %U port %d fib %d",
90 clib_net_to_host_u16 (
port), fib_index);
102 #define _(v, N, str) case SNAT_SESSION_##N: t = (u8 *) str; break;
106 t =
format (t,
"unknown");
117 snat_session_t *sess = va_arg (*args, snat_session_t *);
121 s =
format (s,
" i2o %U proto %u fib %u\n",
123 sess->in2out.port, sess->in2out.fib_index);
126 &sess->out2in.addr, sess->out2in.port, sess->out2in.fib_index);
130 s =
format (s,
" i2o %U proto %U port %d fib %d\n",
133 clib_net_to_host_u16 (sess->in2out.port),
134 sess->in2out.fib_index);
135 s =
format (s,
" o2i %U proto %U port %d fib %d\n",
137 sess->nat_proto, clib_net_to_host_u16 (sess->out2in.port),
138 sess->out2in.fib_index);
142 s =
format (s,
" external host o2i %U:%d i2o %U:%d\n",
144 clib_net_to_host_u16 (sess->ext_host_port),
146 clib_net_to_host_u16 (sess->ext_host_nat_port));
150 if (sess->ext_host_addr.as_u32)
151 s =
format (s,
" external host %U:%u\n",
153 clib_net_to_host_u16 (sess->ext_host_port));
158 s =
format (s,
" last heard %.2f\n", sess->last_heard);
159 s =
format (s,
" total pkts %d, total bytes %lld\n",
160 sess->total_pkts, sess->total_bytes);
162 s =
format (s,
" static translation\n");
164 s =
format (s,
" dynamic translation\n");
166 s =
format (s,
" forwarding-bypass\n");
168 s =
format (s,
" load-balancing\n");
170 s =
format (s,
" twice-nat\n");
183 s =
format (s,
"identity mapping %U",
186 s =
format (s,
"identity mapping %U %U:%d",
222 s =
format (s,
"\n local %U:%d vrf %d probability %d\%",
224 clib_net_to_host_u16 (local->
port), local->
vrf_id,
229 s =
format (s,
"%U local %U:%d external %U:%d vrf %d %s %s",
249 s =
format (s,
"local %U external %U vrf %d",
253 s =
format (s,
"%U local %U:%d external %U:%d vrf %d",
256 clib_net_to_host_u16 (m->
l_port),
static bool is_sm_lb(u32 f)
static bool snat_is_unk_proto_session(snat_session_t *s)
Check if SNAT session for unknown protocol.
nat44_lb_addr_port_t * locals
@ foreach_snat_session_state
static bool is_sm_out2in_only(u32 f)
vnet_hw_if_output_node_runtime_t * r
static bool is_sm_twice_nat(u32 f)
#define pool_foreach(VAR, POOL)
Iterate through pool.
vnet_main_t * vnet_get_main(void)
static bool nat44_ed_is_lb_session(snat_session_t *s)
Check if NAT session is load-balancing.
static bool is_sm_addr_only(u32 f)
static bool nat44_ed_is_session_static(snat_session_t *s)
Check if SNAT session is created from static mapping.
@ foreach_nat_addr_and_port_alloc_alg
snat_session_t * sessions
static bool nat44_ed_is_twice_nat_session(snat_session_t *s)
Check if NAT session is twice NAT.
format_function_t format_vnet_sw_if_index_name
description fragment has unexpected format
static bool is_sm_self_twice_nat(u32 f)
static bool is_sm_identity_nat(u32 f)
vl_api_ip_proto_t protocol
format_function_t format_nat_6t_flow
static void split_nat_key(u64 key, ip4_address_t *addr, u16 *port, u32 *fib_index, nat_protocol_t *proto)
ip4_address_t external_addr
static bool na44_ed_is_fwd_bypass_session(snat_session_t *s)
Check if NAT session is forwarding bypass.