FD.io VPP  v18.10-34-gcce845e
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_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
 

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_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

#define foreach_flow_hash_bit
Value:
_(proto, IP_FLOW_HASH_PROTO) \
vl_api_address_t src
Definition: vxlan_gbp.api:33
#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
#define IP_FLOW_HASH_DST_ADDR
Definition: lookup.h:62
vl_api_address_t dst
Definition: vxlan_gbp.api:34
#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 71 of file lookup.h.

#define foreach_ip_interface_address (   lm,
  a,
  sw_if_index,
  loop,
  body 
)
Value:
do { \
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)
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)
u32 sw_if_index
Definition: vxlan_gbp.api:39
unsigned int u32
Definition: types.h:88
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:464
#define vec_elt(v, i)
Get vector value at index i.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
struct vnet_main_t vnet_main_t

Definition at line 180 of file lookup.h.

#define IP_FLOW_HASH_DEFAULT   (0x1F)

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

Definition at line 69 of file lookup.h.

#define IP_FLOW_HASH_DST_ADDR   (1<<1)

Definition at line 62 of file lookup.h.

#define IP_FLOW_HASH_DST_PORT   (1<<4)

Definition at line 65 of file lookup.h.

#define IP_FLOW_HASH_PROTO   (1<<2)

Definition at line 63 of file lookup.h.

#define IP_FLOW_HASH_REVERSE_SRC_DST   (1<<5)

Definition at line 66 of file lookup.h.

#define IP_FLOW_HASH_SRC_ADDR   (1<<0)

Flow hash configuration.

Definition at line 61 of file lookup.h.

#define IP_FLOW_HASH_SRC_PORT   (1<<3)

Definition at line 64 of file lookup.h.

Typedef Documentation

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

Definition at line 82 of file lookup.h.

typedef struct _vnet_ip_container_proxy_args vnet_ip_container_proxy_args_t

Enumeration Type Documentation

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 108 of file lookup.h.

Function Documentation

u8* format_ip_flow_hash_config ( u8 s,
va_list *  args 
)

Definition at line 244 of file lookup.c.

+ Here is the caller graph for this function:

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

Definition at line 166 of file lookup.h.

+ Here is the call graph for this function:

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 62 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 173 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip_lookup_init ( ip_lookup_main_t lm,
u32  ip_lookup_node_index 
)

Definition at line 203 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip_lookup_set_buffer_fib_index ( u32 fib_index_by_sw_if_index,
vlib_buffer_t b 
)
inlinestatic

Definition at line 216 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vnet_ip_container_proxy_add_del ( vnet_ip_container_proxy_args_t args)

Definition at line 1267 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const ip46_address_t zero_addr

Definition at line 318 of file lookup.c.