FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
lookup.h File Reference

Definitions for all things IP (v4|v6) unicast and multicast lookup related. More...

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

Go to the source code of this file.

Data Structures

struct  ip_interface_address_t
 
struct  ip_lookup_main_t
 

Macros

#define IP_FLOW_HASH_SRC_ADDR   (1<<0)
 Flow hash configuration. More...
 
#define IP_FLOW_HASH_DST_ADDR   (1<<1)
 
#define IP_FLOW_HASH_PROTO   (1<<2)
 
#define IP_FLOW_HASH_SRC_PORT   (1<<3)
 
#define IP_FLOW_HASH_DST_PORT   (1<<4)
 
#define IP_FLOW_HASH_REVERSE_SRC_DST   (1<<5)
 
#define IP_FLOW_HASH_SYMMETRIC   (1<<6)
 
#define IP_FLOW_HASH_DEFAULT   (0x1F)
 Default: 5-tuple without the "reverse" bit. More...
 
#define foreach_flow_hash_bit
 
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
 

Typedefs

typedef u32 flow_hash_config_t
 A flow hash configuration is a mask of the flow hash options. More...
 
typedef struct ip_lookup_main_t ip_lookup_main_t
 
typedef struct _vnet_ip_container_proxy_args vnet_ip_container_proxy_args_t
 
typedef int(* ip_container_proxy_cb_t) (const fib_prefix_t *pfx, u32 sw_if_index, void *ctx)
 

Enumerations

enum  ip_local_next_t {
  IP_LOCAL_NEXT_DROP, IP_LOCAL_NEXT_PUNT, IP_LOCAL_NEXT_UDP_LOOKUP, IP_LOCAL_NEXT_ICMP,
  IP_LOCAL_NEXT_REASSEMBLY, IP_LOCAL_N_NEXT
}
 

Functions

clib_error_tip_interface_address_add_del (ip_lookup_main_t *lm, u32 sw_if_index, void *address, u32 address_length, u32 is_del, u32 *result_index)
 
u8format_ip_flow_hash_config (u8 *s, va_list *args)
 
static ip_interface_address_tip_get_interface_address (ip_lookup_main_t *lm, void *addr_fib)
 
static void * ip_interface_address_get_address (ip_lookup_main_t *lm, ip_interface_address_t *a)
 
static void ip_lookup_set_buffer_fib_index (u32 *fib_index_by_sw_if_index, vlib_buffer_t *b)
 
clib_error_tvnet_ip_container_proxy_add_del (vnet_ip_container_proxy_args_t *args)
 
void ip_container_proxy_walk (ip_container_proxy_cb_t cb, void *ctx)
 
void ip_lookup_init (ip_lookup_main_t *lm, u32 ip_lookup_node_index)
 

Variables

const ip46_address_t zero_addr
 

Detailed Description

Definitions for all things IP (v4|v6) unicast and multicast lookup related.

  • Adjacency definitions and registration.
  • Callbacks on route add.
  • Callbacks on interface address change.

Definition in file lookup.h.

Macro Definition Documentation

◆ foreach_flow_hash_bit

#define foreach_flow_hash_bit
Value:
_(proto, IP_FLOW_HASH_PROTO) \
#define IP_FLOW_HASH_SRC_PORT
Definition: lookup.h:64
#define IP_FLOW_HASH_REVERSE_SRC_DST
Definition: lookup.h:66
#define IP_FLOW_HASH_DST_PORT
Definition: lookup.h:65
vl_api_ip4_address_t dst
Definition: ipsec_gre.api:39
#define IP_FLOW_HASH_DST_ADDR
Definition: lookup.h:62
vl_api_ip4_address_t src
Definition: ipsec_gre.api:38
#define IP_FLOW_HASH_SYMMETRIC
Definition: lookup.h:67
#define IP_FLOW_HASH_SRC_ADDR
Flow hash configuration.
Definition: lookup.h:61
#define IP_FLOW_HASH_PROTO
Definition: lookup.h:63

Definition at line 72 of file lookup.h.

◆ foreach_ip_interface_address

#define foreach_ip_interface_address (   lm,
  a,
  sw_if_index,
  loop,
  body 
)
Value:
do { \
vnet_main_t *_vnm = vnet_get_main(); \
u32 _sw_if_index = sw_if_index; \
vnet_sw_interface_t *_swif; \
_swif = vnet_get_sw_interface (_vnm, _sw_if_index); \
\
/* \
* Loop => honor unnumbered interface addressing. \
*/ \
if (_swif->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED) \
{ \
if (loop) \
_sw_if_index = _swif->unnumbered_sw_if_index; \
else \
/* the interface is unnumbered, by the caller does not want \
* unnumbered interfaces considered/honoured */ \
break; \
} \
u32 _ia = ((vec_len((lm)->if_address_pool_index_by_sw_if_index) \
> (_sw_if_index)) ? \
vec_elt ((lm)->if_address_pool_index_by_sw_if_index, \
(_sw_if_index)) : \
(u32)~0); \
ip_interface_address_t * _a; \
while (_ia != ~0) \
{ \
_a = pool_elt_at_index ((lm)->if_address_pool, _ia); \
_ia = _a->next_this_sw_interface; \
(a) = _a; \
body; \
} \
} while (0)
u32 sw_if_index
Definition: ipsec_gre.api:37
a
Definition: bitmap.h:538
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
unsigned int u32
Definition: types.h:88
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:514
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)

Definition at line 182 of file lookup.h.

◆ IP_FLOW_HASH_DEFAULT

#define IP_FLOW_HASH_DEFAULT   (0x1F)

Default: 5-tuple without the "reverse" bit.

Definition at line 70 of file lookup.h.

◆ IP_FLOW_HASH_DST_ADDR

#define IP_FLOW_HASH_DST_ADDR   (1<<1)

Definition at line 62 of file lookup.h.

◆ IP_FLOW_HASH_DST_PORT

#define IP_FLOW_HASH_DST_PORT   (1<<4)

Definition at line 65 of file lookup.h.

◆ IP_FLOW_HASH_PROTO

#define IP_FLOW_HASH_PROTO   (1<<2)

Definition at line 63 of file lookup.h.

◆ IP_FLOW_HASH_REVERSE_SRC_DST

#define IP_FLOW_HASH_REVERSE_SRC_DST   (1<<5)

Definition at line 66 of file lookup.h.

◆ IP_FLOW_HASH_SRC_ADDR

#define IP_FLOW_HASH_SRC_ADDR   (1<<0)

Flow hash configuration.

Definition at line 61 of file lookup.h.

◆ IP_FLOW_HASH_SRC_PORT

#define IP_FLOW_HASH_SRC_PORT   (1<<3)

Definition at line 64 of file lookup.h.

◆ IP_FLOW_HASH_SYMMETRIC

#define IP_FLOW_HASH_SYMMETRIC   (1<<6)

Definition at line 67 of file lookup.h.

Typedef Documentation

◆ flow_hash_config_t

A flow hash configuration is a mask of the flow hash options.

Definition at line 84 of file lookup.h.

◆ ip_container_proxy_cb_t

typedef int(* ip_container_proxy_cb_t) (const fib_prefix_t *pfx, u32 sw_if_index, void *ctx)

Definition at line 241 of file lookup.h.

◆ ip_lookup_main_t

◆ vnet_ip_container_proxy_args_t

typedef struct _vnet_ip_container_proxy_args vnet_ip_container_proxy_args_t

Enumeration Type Documentation

◆ ip_local_next_t

Enumerator
IP_LOCAL_NEXT_DROP 
IP_LOCAL_NEXT_PUNT 
IP_LOCAL_NEXT_UDP_LOOKUP 
IP_LOCAL_NEXT_ICMP 
IP_LOCAL_NEXT_REASSEMBLY 
IP_LOCAL_N_NEXT 

Definition at line 110 of file lookup.h.

Function Documentation

◆ format_ip_flow_hash_config()

u8* format_ip_flow_hash_config ( u8 s,
va_list *  args 
)

Definition at line 245 of file lookup.c.

+ Here is the caller graph for this function:

◆ ip_container_proxy_walk()

void ip_container_proxy_walk ( ip_container_proxy_cb_t  cb,
void *  ctx 
)

Definition at line 1380 of file lookup.c.

+ Here is the caller graph for this function:

◆ ip_get_interface_address()

static ip_interface_address_t* ip_get_interface_address ( ip_lookup_main_t lm,
void *  addr_fib 
)
inlinestatic

Definition at line 168 of file lookup.h.

+ Here is the call graph for this function:

◆ ip_interface_address_add_del()

clib_error_t* ip_interface_address_add_del ( ip_lookup_main_t lm,
u32  sw_if_index,
void *  address,
u32  address_length,
u32  is_del,
u32 result_index 
)

Definition at line 63 of file lookup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_get_address()

static void* ip_interface_address_get_address ( ip_lookup_main_t lm,
ip_interface_address_t a 
)
inlinestatic

Definition at line 175 of file lookup.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_lookup_init()

void ip_lookup_init ( ip_lookup_main_t lm,
u32  ip_lookup_node_index 
)

Definition at line 204 of file lookup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_lookup_set_buffer_fib_index()

static void ip_lookup_set_buffer_fib_index ( u32 fib_index_by_sw_if_index,
vlib_buffer_t b 
)
inlinestatic

Definition at line 218 of file lookup.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_ip_container_proxy_add_del()

clib_error_t* vnet_ip_container_proxy_add_del ( vnet_ip_container_proxy_args_t args)

Definition at line 1294 of file lookup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ zero_addr

const ip46_address_t zero_addr

Definition at line 319 of file lookup.c.