FD.io VPP  v16.09
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)
 
static 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)
 
int ip_register_adjacency (vlib_main_t *vm, u8 is_ip4, ip_adj_register_t *reg)
 
int ip_init_registered_adjacencies (u8 is_ip4)
 
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)
 
static uword ip_next_hop_hash_key_from_handle (uword handle)
 
static uword ip_next_hop_hash_key_is_heap_handle (uword k)
 
static 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)
 
static 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)
 
u32 vnet_register_special_adjacency_format_function (ip_lookup_main_t *lm, format_function_t *fp)
 
u8format_ip_adjacency (u8 *s, va_list *args)
 Pretty print helper function for formatting specific adjacencies. More...
 
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

static vlib_cli_command_t vlib_cli_ip_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_ip_command) More...
 
static vlib_cli_command_t vlib_cli_show_ip_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip_command) More...
 
static vlib_cli_command_t vlib_cli_show_ip4_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip4_command) More...
 
static vlib_cli_command_t vlib_cli_show_ip6_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip6_command) More...
 
static vlib_cli_command_t ip_route_command
 (constructor) VLIB_CLI_COMMAND (ip_route_command) More...
 
static vlib_cli_command_t ip_probe_neighbor_command
 (constructor) VLIB_CLI_COMMAND (ip_probe_neighbor_command) More...
 
static vlib_cli_command_t ip4_show_fib_command
 (constructor) VLIB_CLI_COMMAND (ip4_show_fib_command) More...
 
static 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 2187 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 1887 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 2209 of file lookup.c.

+ Here is the caller graph for this function:

u8* format_ip_adjacency ( u8 s,
va_list *  args 
)

Pretty print helper function for formatting specific adjacencies.

Parameters
s- input string to format
args- other args passed to format function such as:

Definition at line 1039 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 1105 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 951 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 999 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 962 of file lookup.c.

+ Here is the call 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 1770 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 1906 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 1717 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 2223 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 2233 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 167 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 314 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 283 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ip_init_registered_adjacencies ( u8  is_ip4)

Definition at line 150 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 764 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 870 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 524 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 706 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 448 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 650 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 330 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 751 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_from_handle ( uword  handle)
inlinestatic

Definition at line 433 of file lookup.c.

+ Here is the caller graph for this function:

static uword ip_next_hop_hash_key_get_heap_handle ( uword  k)
inlinestatic

Definition at line 441 of file lookup.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ip_multipath_next_hop_t* ip_next_hop_hash_key_get_next_hops ( ip_lookup_main_t lm,
uword  k,
uword n_next_hops 
)
inlinestatic

Definition at line 719 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_is_heap_handle ( uword  k)
inlinestatic

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip_poison_adjacencies ( ip_adjacency_t adj,
uword  n_adj 
)
inlinestatic

Definition at line 48 of file lookup.c.

+ Here is the caller graph for this function:

int ip_register_adjacency ( vlib_main_t vm,
u8  is_ip4,
ip_adj_register_t reg 
)

Definition at line 137 of file lookup.c.

+ Here is the call graph for this function:

+ 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 263 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 318 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 1825 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 1156 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 1129 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 1226 of file lookup.c.

+ Here is the call graph for this function:

u32 vnet_register_special_adjacency_format_function ( ip_lookup_main_t lm,
format_function_t fp 
)

Definition at line 1013 of file lookup.c.

+ Here is the caller graph for this function:

Variable Documentation

vlib_cli_command_t ip4_show_fib_command
static
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:1906

(constructor) VLIB_CLI_COMMAND (ip4_show_fib_command)

Definition at line 2168 of file lookup.c.

vlib_cli_command_t ip6_show_fib_command
static
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:2233

(constructor) VLIB_CLI_COMMAND (ip6_show_fib_command)

Definition at line 2404 of file lookup.c.

vlib_cli_command_t ip_probe_neighbor_command
static
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:1825

(constructor) VLIB_CLI_COMMAND (ip_probe_neighbor_command)

Definition at line 1880 of file lookup.c.

vlib_cli_command_t ip_route_command
static
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:1226

(constructor) VLIB_CLI_COMMAND (ip_route_command)

Definition at line 1704 of file lookup.c.

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

(constructor) VLIB_CLI_COMMAND (vlib_cli_ip_command)

Definition at line 1657 of file lookup.c.

vlib_cli_command_t vlib_cli_show_ip4_command
static
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 1667 of file lookup.c.

vlib_cli_command_t vlib_cli_show_ip6_command
static
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 1672 of file lookup.c.

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

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip_command)

Definition at line 1662 of file lookup.c.