FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
lib.h File Reference

NAT port/address allocation lib. More...

+ Include dependency graph for lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nat_timeouts_t
 

Macros

#define foreach_nat_config_flag
 
#define foreach_nat_counter   _ (tcp) _ (udp) _ (icmp) _ (other) _ (drops)
 
#define foreach_nat_error
 
#define foreach_nat_protocol
 
#define NAT_UDP_TIMEOUT   300
 
#define NAT_TCP_TRANSITORY_TIMEOUT   240
 
#define NAT_TCP_ESTABLISHED_TIMEOUT   7440
 
#define NAT_ICMP_TIMEOUT   60
 

Typedefs

typedef enum nat_config_flags_t_ nat_config_flags_t
 

Enumerations

enum  nat_config_flags_t_ { foreach_nat_config_flag }
 
enum  nat_error_t { foreach_nat_error }
 
enum  nat_protocol_t { foreach_nat_protocol }
 

Functions

static_always_inline void nat_reset_timeouts (nat_timeouts_t *timeouts)
 
static_always_inline u32 nat_session_get_timeout (nat_timeouts_t *timeouts, nat_protocol_t proto, u8 state)
 
static_always_inline u32 nat_calc_bihash_buckets (u32 n_elts)
 
u8format_nat_protocol (u8 *s, va_list *args)
 
uword unformat_nat_protocol (unformat_input_t *input, va_list *args)
 

Detailed Description

NAT port/address allocation lib.

Definition in file lib.h.

Macro Definition Documentation

◆ foreach_nat_config_flag

#define foreach_nat_config_flag
Value:
_(0x01, IS_TWICE_NAT) \
_(0x02, IS_SELF_TWICE_NAT) \
_(0x04, IS_OUT2IN_ONLY) \
_(0x08, IS_ADDR_ONLY) \
_(0x10, IS_OUTSIDE) \
_(0x20, IS_INSIDE) \
_(0x40, IS_STATIC) \
_(0x80, IS_EXT_HOST_VALID)

Definition at line 25 of file lib.h.

◆ foreach_nat_counter

#define foreach_nat_counter   _ (tcp) _ (udp) _ (icmp) _ (other) _ (drops)

Definition at line 42 of file lib.h.

◆ foreach_nat_error

#define foreach_nat_error
Value:
_ (VALUE_EXIST, -1, "Value already exists") \
_ (NO_SUCH_ENTRY, -2, "No such entry") \
_ (UNKNOWN_PROTOCOL, -3, "Unknown protocol") \
_ (OUT_OF_TRANSLATIONS, -4, "Out of translations")

Definition at line 44 of file lib.h.

◆ foreach_nat_protocol

#define foreach_nat_protocol
Value:
_ (OTHER, 0, other, "other") \
_ (UDP, 1, udp, "udp") \
_ (TCP, 2, tcp, "tcp") \
_ (ICMP, 3, icmp, "icmp")

Definition at line 57 of file lib.h.

◆ NAT_ICMP_TIMEOUT

#define NAT_ICMP_TIMEOUT   60

Definition at line 74 of file lib.h.

◆ NAT_TCP_ESTABLISHED_TIMEOUT

#define NAT_TCP_ESTABLISHED_TIMEOUT   7440

Definition at line 73 of file lib.h.

◆ NAT_TCP_TRANSITORY_TIMEOUT

#define NAT_TCP_TRANSITORY_TIMEOUT   240

Definition at line 72 of file lib.h.

◆ NAT_UDP_TIMEOUT

#define NAT_UDP_TIMEOUT   300

Definition at line 71 of file lib.h.

Typedef Documentation

◆ nat_config_flags_t

Enumeration Type Documentation

◆ nat_config_flags_t_

Enumerator
foreach_nat_config_flag 

Definition at line 35 of file lib.h.

◆ nat_error_t

Enumerator
foreach_nat_error 

Definition at line 50 of file lib.h.

◆ nat_protocol_t

Enumerator
foreach_nat_protocol 

Definition at line 63 of file lib.h.

Function Documentation

◆ format_nat_protocol()

u8* format_nat_protocol ( u8 s,
va_list *  args 
)

Definition at line 1627 of file nat64.c.

+ Here is the caller graph for this function:

◆ nat_calc_bihash_buckets()

static_always_inline u32 nat_calc_bihash_buckets ( u32  n_elts)

Definition at line 122 of file lib.h.

+ Here is the caller graph for this function:

◆ nat_reset_timeouts()

static_always_inline void nat_reset_timeouts ( nat_timeouts_t timeouts)

Definition at line 90 of file lib.h.

+ Here is the caller graph for this function:

◆ nat_session_get_timeout()

static_always_inline u32 nat_session_get_timeout ( nat_timeouts_t timeouts,
nat_protocol_t  proto,
u8  state 
)

Definition at line 99 of file lib.h.

+ Here is the caller graph for this function:

◆ unformat_nat_protocol()

uword unformat_nat_protocol ( unformat_input_t input,
va_list *  args 
)

Definition at line 1613 of file nat64.c.

TCP
TCP(sport=80, dport=6872)
icmp
icmp
Definition: map.api:387
ICMP
description unable to translate ICMP
Definition: map.api:391