FD.io VPP  v16.06
Vector Packet Processing
lookup.c File Reference
+ Include dependency graph for lookup.c:

Go to the source code of this file.

Data Structures

struct  ip6_route_t
 
struct  add_routes_in_fib_arg_t
 
struct  count_routes_in_fib_at_prefix_length_arg_t
 

Functions

static void ip_multipath_del_adjacency (ip_lookup_main_t *lm, u32 del_adj_index)
 
always_inline void ip_poison_adjacencies (ip_adjacency_t *adj, uword n_adj)
 
static void ip_share_adjacency (ip_lookup_main_t *lm, u32 adj_index)
 
static void ip_unshare_adjacency (ip_lookup_main_t *lm, u32 adj_index)
 
ip_adjacency_tip_add_adjacency (ip_lookup_main_t *lm, ip_adjacency_t *copy_adj, u32 n_adj, u32 *adj_index_return)
 
void ip_update_adjacency (ip_lookup_main_t *lm, u32 adj_index, ip_adjacency_t *copy_adj)
 
static void ip_del_adjacency2 (ip_lookup_main_t *lm, u32 adj_index, u32 delete_multipath_adjacency)
 
void ip_del_adjacency (ip_lookup_main_t *lm, u32 adj_index)
 
static int next_hop_sort_by_weight (ip_multipath_next_hop_t *n1, ip_multipath_next_hop_t *n2)
 
static u32 ip_multipath_normalize_next_hops (ip_lookup_main_t *lm, ip_multipath_next_hop_t *raw_next_hops, ip_multipath_next_hop_t **normalized_next_hops)
 
always_inline uword ip_next_hop_hash_key_from_handle (uword handle)
 
always_inline uword ip_next_hop_hash_key_is_heap_handle (uword k)
 
always_inline uword ip_next_hop_hash_key_get_heap_handle (uword k)
 
static u32 ip_multipath_adjacency_get (ip_lookup_main_t *lm, ip_multipath_next_hop_t *raw_next_hops, uword create_if_non_existent)
 
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)
 
void ip_multipath_adjacency_free (ip_lookup_main_t *lm, ip_multipath_adjacency_t *a)
 
always_inline ip_multipath_next_hop_tip_next_hop_hash_key_get_next_hops (ip_lookup_main_t *lm, uword k, uword *n_next_hops)
 
static uword ip_next_hop_hash_key_sum (hash_t *h, uword key0)
 
static uword ip_next_hop_hash_key_equal (hash_t *h, uword key0, uword key1)
 
clib_error_tip_interface_address_add_del (ip_lookup_main_t *lm, u32 sw_if_index, void *addr_fib, u32 address_length, u32 is_del, u32 *result_if_address_index)
 
void ip_lookup_init (ip_lookup_main_t *lm, u32 is_ip6)
 
u8format_ip_flow_hash_config (u8 *s, va_list *args)
 
u8format_ip_lookup_next (u8 *s, va_list *args)
 
static u8format_ip_interface_address (u8 *s, va_list *args)
 
u8format_ip_adjacency (u8 *s, va_list *args)
 
u8format_ip_adjacency_packet_data (u8 *s, va_list *args)
 
static uword unformat_ip_lookup_next (unformat_input_t *input, va_list *args)
 
static uword unformat_ip_adjacency (unformat_input_t *input, va_list *args)
 
clib_error_tvnet_ip_route_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
static clib_error_tip6_probe_neighbor_wait (vlib_main_t *vm, ip6_address_t *a, u32 sw_if_index, int retry_count)
 
static clib_error_tip4_probe_neighbor_wait (vlib_main_t *vm, ip4_address_t *a, u32 sw_if_index, int retry_count)
 
static clib_error_tprobe_neighbor_address (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
typedef CLIB_PACKED (struct{ip4_address_t address;u32 address_length:6;u32 index:26;})
 
static clib_error_tip4_show_fib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void add_routes_in_fib (BVT(clib_bihash_kv)*kvp, void *arg)
 
static void count_routes_in_fib_at_prefix_length (BVT(clib_bihash_kv)*kvp, void *arg)
 
static int ip6_route_cmp (void *a1, void *a2)
 
static clib_error_tip6_show_fib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

vlib_cli_command_t vlib_cli_ip_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_ip_command) More...
 
vlib_cli_command_t vlib_cli_show_ip_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip_command) More...
 
vlib_cli_command_t vlib_cli_show_ip4_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip4_command) More...
 
vlib_cli_command_t vlib_cli_show_ip6_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip6_command) More...
 
vlib_cli_command_t ip_route_command
 (constructor) VLIB_CLI_COMMAND (ip_route_command) More...
 
vlib_cli_command_t ip_probe_neighbor_command
 (constructor) VLIB_CLI_COMMAND (ip_probe_neighbor_command) More...
 
vlib_cli_command_t ip4_show_fib_command
 (constructor) VLIB_CLI_COMMAND (ip4_show_fib_command) More...
 
vlib_cli_command_t ip6_show_fib_command
 (constructor) VLIB_CLI_COMMAND (ip6_show_fib_command) More...
 

Function Documentation

static void add_routes_in_fib ( BVT(clib_bihash_kv)*  kvp,
void arg 
)
static

Definition at line 2061 of file lookup.c.

+ Here is the caller graph for this function:

typedef CLIB_PACKED ( struct{ip4_address_t address;u32 address_length:6;u32 index:26;}  )

Definition at line 1785 of file lookup.c.

+ Here is the call graph for this function:

static void count_routes_in_fib_at_prefix_length ( BVT(clib_bihash_kv)*  kvp,
void arg 
)
static

Definition at line 2083 of file lookup.c.

+ Here is the caller graph for this function:

u8* format_ip_adjacency ( u8 s,
va_list *  args 
)

Definition at line 975 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip_adjacency_packet_data ( u8 s,
va_list *  args 
)

Definition at line 1030 of file lookup.c.

+ Here is the call graph for this function:

u8* format_ip_flow_hash_config ( u8 s,
va_list *  args 
)

Definition at line 920 of file lookup.c.

+ Here is the caller graph for this function:

static u8* format_ip_interface_address ( u8 s,
va_list *  args 
)
static

Definition at line 962 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip_lookup_next ( u8 s,
va_list *  args 
)

Definition at line 931 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ip4_probe_neighbor_wait ( vlib_main_t vm,
ip4_address_t a,
u32  sw_if_index,
int  retry_count 
)
static

Definition at line 1668 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ip4_show_fib ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1804 of file lookup.c.

+ Here is the call graph for this function:

static clib_error_t* ip6_probe_neighbor_wait ( vlib_main_t vm,
ip6_address_t a,
u32  sw_if_index,
int  retry_count 
)
static

Definition at line 1615 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ip6_route_cmp ( void a1,
void a2 
)
static

Definition at line 2097 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ip6_show_fib ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 2107 of file lookup.c.

+ Here is the call graph for this function:

ip_adjacency_t* ip_add_adjacency ( ip_lookup_main_t lm,
ip_adjacency_t copy_adj,
u32  n_adj,
u32 adj_index_return 
)

Definition at line 139 of file lookup.c.

+ 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:

static void ip_del_adjacency2 ( ip_lookup_main_t lm,
u32  adj_index,
u32  delete_multipath_adjacency 
)
static

Definition at line 254 of file lookup.c.

+ 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 addr_fib,
u32  address_length,
u32  is_del,
u32 result_if_address_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:

void ip_lookup_init ( ip_lookup_main_t lm,
u32  is_ip6 
)

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 u32 ip_multipath_adjacency_get ( ip_lookup_main_t lm,
ip_multipath_next_hop_t raw_next_hops,
uword  create_if_non_existent 
)
static

Definition at line 419 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip_multipath_del_adjacency ( ip_lookup_main_t lm,
u32  del_adj_index 
)
static

Definition at line 621 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ip_multipath_normalize_next_hops ( ip_lookup_main_t lm,
ip_multipath_next_hop_t raw_next_hops,
ip_multipath_next_hop_t **  normalized_next_hops 
)
static

Definition at line 301 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ip_next_hop_hash_key_equal ( hash_t h,
uword  key0,
uword  key1 
)
static

Definition at line 722 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword ip_next_hop_hash_key_from_handle ( uword  handle)

Definition at line 404 of file lookup.c.

+ Here is the caller graph for this function:

always_inline uword ip_next_hop_hash_key_get_heap_handle ( uword  k)

Definition at line 412 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline ip_multipath_next_hop_t* ip_next_hop_hash_key_get_next_hops ( ip_lookup_main_t lm,
uword  k,
uword n_next_hops 
)

Definition at line 690 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword ip_next_hop_hash_key_is_heap_handle ( uword  k)

Definition at line 408 of file lookup.c.

+ Here is the caller graph for this function:

static uword ip_next_hop_hash_key_sum ( hash_t h,
uword  key0 
)
static

Definition at line 711 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void ip_poison_adjacencies ( ip_adjacency_t adj,
uword  n_adj 
)

Definition at line 48 of file lookup.c.

+ Here is the caller graph for this function:

static void ip_share_adjacency ( ip_lookup_main_t lm,
u32  adj_index 
)
static

Definition at line 63 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip_unshare_adjacency ( ip_lookup_main_t lm,
u32  adj_index 
)
static

Definition at line 88 of file lookup.c.

+ Here is the call graph for this function:

+ 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 next_hop_sort_by_weight ( ip_multipath_next_hop_t n1,
ip_multipath_next_hop_t n2 
)
static

Definition at line 289 of file lookup.c.

+ Here is the caller graph for this function:

static clib_error_t* probe_neighbor_address ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1723 of file lookup.c.

+ Here is the call graph for this function:

static uword unformat_ip_adjacency ( unformat_input_t input,
va_list *  args 
)
static

Definition at line 1081 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword unformat_ip_lookup_next ( unformat_input_t input,
va_list *  args 
)
static

Definition at line 1054 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vnet_ip_route_cmd ( vlib_main_t vm,
unformat_input_t main_input,
vlib_cli_command_t cmd 
)

Definition at line 1151 of file lookup.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_cli_command_t ip4_show_fib_command
Initial value:
= {
.path = "show ip fib",
.short_help = "show ip fib [mtrie] [summary] [table <n>] [<ip4-addr>] [clear] [include-empty]",
.function = ip4_show_fib,
}
static clib_error_t * ip4_show_fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: lookup.c:1804

(constructor) VLIB_CLI_COMMAND (ip4_show_fib_command)

Definition at line 2042 of file lookup.c.

vlib_cli_command_t ip6_show_fib_command
Initial value:
= {
.path = "show ip6 fib",
.short_help = "show ip6 fib [summary] [clear]",
.function = ip6_show_fib,
}
static clib_error_t * ip6_show_fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: lookup.c:2107

(constructor) VLIB_CLI_COMMAND (ip6_show_fib_command)

Definition at line 2268 of file lookup.c.

vlib_cli_command_t ip_probe_neighbor_command
Initial value:
= {
.path = "ip probe-neighbor",
.short_help = "ip probe-neighbor <intfc> <ip4-addr> | <ip6-addr> [retry nn]",
.is_mp_safe = 1,
}
static clib_error_t * probe_neighbor_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: lookup.c:1723

(constructor) VLIB_CLI_COMMAND (ip_probe_neighbor_command)

Definition at line 1778 of file lookup.c.

vlib_cli_command_t ip_route_command
Initial value:
= {
.path = "ip route",
.short_help = "Add/delete IP routes",
.function = vnet_ip_route_cmd,
.is_mp_safe = 1,
}
clib_error_t * vnet_ip_route_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:1151

(constructor) VLIB_CLI_COMMAND (ip_route_command)

Definition at line 1602 of file lookup.c.

vlib_cli_command_t vlib_cli_ip_command
Initial value:
= {
.path = "ip",
.short_help = "Internet protocol (IP) commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_ip_command)

Definition at line 1582 of file lookup.c.

vlib_cli_command_t vlib_cli_show_ip4_command
Initial value:
= {
.path = "show ip4",
.short_help = "Internet protocol version 4 (IP4) show commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip4_command)

Definition at line 1592 of file lookup.c.

vlib_cli_command_t vlib_cli_show_ip6_command
Initial value:
= {
.path = "show ip6",
.short_help = "Internet protocol version 6 (IP6) show commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip6_command)

Definition at line 1597 of file lookup.c.

vlib_cli_command_t vlib_cli_show_ip_command
Initial value:
= {
.path = "show ip",
.short_help = "Internet protocol (IP) show commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip_command)

Definition at line 1587 of file lookup.c.