FD.io VPP  v16.06
Vector Packet Processing
lookup.h File Reference
+ 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_adjacency_t
 
struct  ip_multipath_next_hop_t
 
struct  ip_multipath_adjacency_t
 
struct  ip_multicast_rewrite_t
 
struct  ip_multicast_rewrite_string_t
 
struct  ip_multicast_lookup_main_t
 
struct  ip_interface_address_t
 
struct  ip_config_main_t
 
struct  ip_lookup_main_t
 

Macros

#define IP4_LOOKUP_NEXT_NODES
 
#define IP6_LOOKUP_NEXT_NODES
 
#define IP_FLOW_HASH_SRC_ADDR   (1<<0)
 
#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)
 
#define foreach_flow_hash_bit
 
#define IP_LOOKUP_MISS_ADJ_INDEX   0
 
#define ip_prefetch_adjacency(lm, adj_index, type)
 
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
 

Typedefs

typedef u32 ip_adjacency_index_t
 
typedef void(* ip_add_del_adjacency_callback_t) (struct ip_lookup_main_t *lm, u32 adj_index, ip_adjacency_t *adj, u32 is_del)
 
typedef struct ip_lookup_main_t ip_lookup_main_t
 

Enumerations

enum  ip_lookup_next_t {
  IP_LOOKUP_NEXT_MISS, IP_LOOKUP_NEXT_DROP, IP_LOOKUP_NEXT_PUNT, IP_LOOKUP_NEXT_LOCAL,
  IP_LOOKUP_NEXT_ARP, IP_LOOKUP_NEXT_REWRITE, IP_LOOKUP_NEXT_CLASSIFY, IP_LOOKUP_NEXT_MAP,
  IP_LOOKUP_NEXT_MAP_T, IP_LOOKUP_NEXT_SIXRD, IP_LOOKUP_NEXT_INDIRECT, IP_LOOKUP_NEXT_HOP_BY_HOP,
  IP_LOOKUP_NEXT_ADD_HOP_BY_HOP, IP_LOOKUP_NEXT_POP_HOP_BY_HOP, IP_LOOKUP_N_NEXT
}
 
enum  ip_local_next_t {
  IP_LOCAL_NEXT_DROP, IP_LOCAL_NEXT_PUNT, IP_LOCAL_NEXT_UDP_LOOKUP, IP_LOCAL_NEXT_ICMP,
  IP_LOCAL_N_NEXT
}
 

Functions

static uword vnet_ip_adjacency_signature (ip_adjacency_t *adj)
 
static int vnet_ip_adjacency_share_compare (ip_adjacency_t *a1, ip_adjacency_t *a2)
 
always_inline ip_adjacency_tip_get_adjacency (ip_lookup_main_t *lm, u32 adj_index)
 
static void ip_register_add_del_adjacency_callback (ip_lookup_main_t *lm, ip_add_del_adjacency_callback_t cb)
 
always_inline void ip_call_add_del_adjacency_callbacks (ip_lookup_main_t *lm, u32 adj_index, u32 is_del)
 
ip_adjacency_tip_add_adjacency (ip_lookup_main_t *lm, ip_adjacency_t *adj, u32 n_adj, u32 *adj_index_result)
 
void ip_del_adjacency (ip_lookup_main_t *lm, u32 adj_index)
 
void ip_update_adjacency (ip_lookup_main_t *lm, u32 adj_index, ip_adjacency_t *copy_adj)
 
static int ip_adjacency_is_multipath (ip_lookup_main_t *lm, u32 adj_index)
 
void ip_multipath_adjacency_free (ip_lookup_main_t *lm, ip_multipath_adjacency_t *a)
 
u32 ip_multipath_adjacency_add_del_next_hop (ip_lookup_main_t *lm, u32 is_del, u32 old_mp_adj_index, u32 next_hop_adj_index, u32 next_hop_weight, u32 *new_mp_adj_index)
 
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)
 
always_inline ip_interface_address_tip_get_interface_address (ip_lookup_main_t *lm, void *addr_fib)
 
always_inline voidip_interface_address_get_address (ip_lookup_main_t *lm, ip_interface_address_t *a)
 
always_inline ip_interface_address_tip_interface_address_for_packet (ip_lookup_main_t *lm, vlib_buffer_t *b, u32 sw_if_index)
 
void ip_lookup_init (ip_lookup_main_t *lm, u32 ip_lookup_node_index)
 

Macro Definition Documentation

#define foreach_flow_hash_bit
Value:
_(proto, IP_FLOW_HASH_PROTO) \
#define IP_FLOW_HASH_SRC_PORT
Definition: lookup.h:131
#define IP_FLOW_HASH_REVERSE_SRC_DST
Definition: lookup.h:133
#define IP_FLOW_HASH_DST_PORT
Definition: lookup.h:132
#define IP_FLOW_HASH_DST_ADDR
Definition: lookup.h:129
#define IP_FLOW_HASH_SRC_ADDR
Definition: lookup.h:128
#define IP_FLOW_HASH_PROTO
Definition: lookup.h:130

Definition at line 138 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 (loop && _swif->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED) \
_sw_if_index = _swif->unnumbered_sw_if_index; \
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)
#define VNET_SW_INTERFACE_FLAG_UNNUMBERED
Definition: interface.h:380
a
Definition: bitmap.h:393
vnet_main_t * vnet_get_main(void)
Definition: misc.c:45
#define pool_elt_at_index(p, i)
Definition: pool.h:346
unsigned int u32
Definition: types.h:88
#define vec_elt(v, i)
Get vector value at index i.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
always_inline vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
struct vnet_main_t vnet_main_t

Definition at line 534 of file lookup.h.

#define IP4_LOOKUP_NEXT_NODES
Value:

Definition at line 93 of file lookup.h.

#define IP6_LOOKUP_NEXT_NODES
Value:

Definition at line 110 of file lookup.h.

#define IP_FLOW_HASH_DEFAULT   (0x1F)

Definition at line 136 of file lookup.h.

#define IP_FLOW_HASH_DST_ADDR   (1<<1)

Definition at line 129 of file lookup.h.

#define IP_FLOW_HASH_DST_PORT   (1<<4)

Definition at line 132 of file lookup.h.

#define IP_FLOW_HASH_PROTO   (1<<2)

Definition at line 130 of file lookup.h.

#define IP_FLOW_HASH_REVERSE_SRC_DST   (1<<5)

Definition at line 133 of file lookup.h.

#define IP_FLOW_HASH_SRC_ADDR   (1<<0)

Definition at line 128 of file lookup.h.

#define IP_FLOW_HASH_SRC_PORT   (1<<3)

Definition at line 131 of file lookup.h.

#define IP_LOOKUP_MISS_ADJ_INDEX   0

Definition at line 383 of file lookup.h.

#define ip_prefetch_adjacency (   lm,
  adj_index,
  type 
)
Value:
do { \
ip_adjacency_t * _adj = (lm)->adjacency_heap + (adj_index); \
CLIB_PREFETCH (_adj, sizeof (_adj[0]), type); \
} while (0)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
#define CLIB_PREFETCH(addr, size, type)
Definition: cache.h:82

Definition at line 435 of file lookup.h.

Typedef Documentation

typedef void(* ip_add_del_adjacency_callback_t) (struct ip_lookup_main_t *lm, u32 adj_index, ip_adjacency_t *adj, u32 is_del)

Definition at line 337 of file lookup.h.

Definition at line 235 of file lookup.h.

Enumeration Type Documentation

Enumerator
IP_LOCAL_NEXT_DROP 
IP_LOCAL_NEXT_PUNT 
IP_LOCAL_NEXT_UDP_LOOKUP 
IP_LOCAL_NEXT_ICMP 
IP_LOCAL_N_NEXT 

Definition at line 327 of file lookup.h.

Enumerator
IP_LOOKUP_NEXT_MISS 
IP_LOOKUP_NEXT_DROP 
IP_LOOKUP_NEXT_PUNT 
IP_LOOKUP_NEXT_LOCAL 
IP_LOOKUP_NEXT_ARP 
IP_LOOKUP_NEXT_REWRITE 
IP_LOOKUP_NEXT_CLASSIFY 
IP_LOOKUP_NEXT_MAP 
IP_LOOKUP_NEXT_MAP_T 
IP_LOOKUP_NEXT_SIXRD 
IP_LOOKUP_NEXT_INDIRECT 
IP_LOOKUP_NEXT_HOP_BY_HOP 
IP_LOOKUP_NEXT_ADD_HOP_BY_HOP 
IP_LOOKUP_NEXT_POP_HOP_BY_HOP 
IP_LOOKUP_N_NEXT 

Definition at line 49 of file lookup.h.

Function Documentation

ip_adjacency_t* ip_add_adjacency ( ip_lookup_main_t lm,
ip_adjacency_t adj,
u32  n_adj,
u32 adj_index_result 
)

Definition at line 139 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ip_adjacency_is_multipath ( ip_lookup_main_t lm,
u32  adj_index 
)
inlinestatic

Definition at line 472 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void ip_call_add_del_adjacency_callbacks ( ip_lookup_main_t lm,
u32  adj_index,
u32  is_del 
)

Definition at line 449 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip_del_adjacency ( ip_lookup_main_t lm,
u32  adj_index 
)

Definition at line 285 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline ip_adjacency_t* ip_get_adjacency ( ip_lookup_main_t lm,
u32  adj_index 
)

Definition at line 423 of file lookup.h.

always_inline ip_interface_address_t* ip_get_interface_address ( ip_lookup_main_t lm,
void addr_fib 
)

Definition at line 506 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller 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 735 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline ip_interface_address_t* ip_interface_address_for_packet ( ip_lookup_main_t lm,
vlib_buffer_t b,
u32  sw_if_index 
)

Definition at line 517 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* ip_interface_address_get_address ( ip_lookup_main_t lm,
ip_interface_address_t a 
)

Definition at line 513 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 841 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ip_multipath_adjacency_add_del_next_hop ( ip_lookup_main_t lm,
u32  is_del,
u32  old_mp_adj_index,
u32  next_hop_adj_index,
u32  next_hop_weight,
u32 new_mp_adj_index 
)

Definition at line 495 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip_multipath_adjacency_free ( ip_lookup_main_t lm,
ip_multipath_adjacency_t a 
)

Definition at line 677 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip_register_add_del_adjacency_callback ( ip_lookup_main_t lm,
ip_add_del_adjacency_callback_t  cb 
)
inlinestatic

Definition at line 442 of file lookup.h.

+ Here is the caller graph for this function:

void ip_update_adjacency ( ip_lookup_main_t lm,
u32  adj_index,
ip_adjacency_t copy_adj 
)

Definition at line 234 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vnet_ip_adjacency_share_compare ( ip_adjacency_t a1,
ip_adjacency_t a2 
)
inlinestatic

Definition at line 221 of file lookup.h.

+ Here is the caller graph for this function:

static uword vnet_ip_adjacency_signature ( ip_adjacency_t adj)
inlinestatic

Definition at line 203 of file lookup.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: