FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
lookup.c File Reference

IPv4 and IPv6 adjacency and lookup table management. More...

+ Include dependency graph for lookup.c:

Go to the source code of this file.

Data Structures

struct  ip_container_proxy_walk_ctx_t_
 

Typedefs

typedef struct ip_container_proxy_walk_ctx_t_ ip_container_proxy_walk_ctx_t
 

Functions

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)
 
static clib_error_tip_sw_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (ip_sw_interface_add_del)
 
void ip_lookup_init (ip_lookup_main_t *lm, u32 is_ip6)
 
u8format_ip_flow_hash_config (u8 *s, va_list *args)
 
u8format_ip_adjacency_packet_data (u8 *s, va_list *args)
 
static uword unformat_dpo (unformat_input_t *input, va_list *args)
 
static clib_error_tvnet_ip_route_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
clib_error_tvnet_ip_table_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd, fib_protocol_t fproto)
 
clib_error_tvnet_ip4_table_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
clib_error_tvnet_ip6_table_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
static clib_error_tip_table_bind_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, fib_protocol_t fproto)
 
static clib_error_tip4_table_bind_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tip6_table_bind_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tvnet_ip_mroute_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
clib_error_tvnet_ip_container_proxy_add_del (vnet_ip_container_proxy_args_t *args)
 
u8 ip_container_proxy_is_set (fib_prefix_t *pfx, u32 sw_if_index)
 
static fib_table_walk_rc_t ip_container_proxy_fib_table_walk (fib_node_index_t fei, void *arg)
 
void ip_container_proxy_walk (ip_container_proxy_cb_t cb, void *ctx)
 
clib_error_tip_container_cmd (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
clib_error_tshow_ip_container_cmd_fn (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 

Variables

const ip46_address_t zero_addr
 
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_ip6_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_ip6_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_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 ip4_table_command
 (constructor) VLIB_CLI_COMMAND (ip4_table_command) More...
 
static vlib_cli_command_t ip6_table_command
 (constructor) VLIB_CLI_COMMAND (ip6_table_command) More...
 
static vlib_cli_command_t set_interface_ip_table_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip_table_command) More...
 
static vlib_cli_command_t set_interface_ip6_table_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip6_table_command) More...
 
static vlib_cli_command_t ip_mroute_command
 (constructor) VLIB_CLI_COMMAND (ip_mroute_command) More...
 
static vlib_cli_command_t ip_container_command_node
 (constructor) VLIB_CLI_COMMAND (ip_container_command_node) More...
 
static vlib_cli_command_t show_ip_container_command
 (constructor) VLIB_CLI_COMMAND (show_ip_container_command) More...
 

Detailed Description

IPv4 and IPv6 adjacency and lookup table management.

Definition in file lookup.c.

Typedef Documentation

◆ ip_container_proxy_walk_ctx_t

Function Documentation

◆ format_ip_adjacency_packet_data()

u8* format_ip_adjacency_packet_data ( u8 s,
va_list *  args 
)

Definition at line 257 of file lookup.c.

+ Here is the call graph for this function:

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

◆ ip4_table_bind_cmd()

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

Definition at line 712 of file lookup.c.

+ Here is the call graph for this function:

◆ ip6_table_bind_cmd()

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

Definition at line 720 of file lookup.c.

+ Here is the call graph for this function:

◆ ip_container_cmd()

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

Definition at line 1142 of file lookup.c.

+ Here is the call graph for this function:

◆ ip_container_proxy_fib_table_walk()

static fib_table_walk_rc_t ip_container_proxy_fib_table_walk ( fib_node_index_t  fei,
void *  arg 
)
static

Definition at line 1093 of file lookup.c.

+ Here is the call graph for this function:

◆ ip_container_proxy_is_set()

u8 ip_container_proxy_is_set ( fib_prefix_t pfx,
u32  sw_if_index 
)

Definition at line 1059 of file lookup.c.

+ Here is the call graph for this function:
+ 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 1115 of file lookup.c.

+ Here is the caller 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 *  addr_fib,
u32  address_length,
u32  is_del,
u32 result_if_address_index 
)

Definition at line 61 of file lookup.c.

+ 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  is_ip6 
)

Definition at line 202 of file lookup.c.

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

◆ ip_sw_interface_add_del()

static clib_error_t* ip_sw_interface_add_del ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_add 
)
static

Definition at line 187 of file lookup.c.

+ Here is the call graph for this function:

◆ ip_table_bind_cmd()

static clib_error_t* ip_table_bind_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd,
fib_protocol_t  fproto 
)
static

Definition at line 661 of file lookup.c.

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

◆ show_ip_container_cmd_fn()

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

Definition at line 1215 of file lookup.c.

+ Here is the call graph for this function:

◆ unformat_dpo()

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

Definition at line 268 of file lookup.c.

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

◆ vnet_ip4_table_cmd()

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

Definition at line 555 of file lookup.c.

+ Here is the call graph for this function:

◆ vnet_ip6_table_cmd()

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

Definition at line 562 of file lookup.c.

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

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

◆ vnet_ip_mroute_cmd()

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

Definition at line 784 of file lookup.c.

+ Here is the call graph for this function:

◆ vnet_ip_route_cmd()

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

Definition at line 313 of file lookup.c.

+ Here is the call graph for this function:

◆ vnet_ip_table_cmd()

clib_error_t* vnet_ip_table_cmd ( vlib_main_t vm,
unformat_input_t main_input,
vlib_cli_command_t cmd,
fib_protocol_t  fproto 
)

Definition at line 494 of file lookup.c.

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

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( ip_sw_interface_add_del  )
+ Here is the caller graph for this function:

Variable Documentation

◆ ip4_table_command

vlib_cli_command_t ip4_table_command
static
Initial value:
= {
.path = "ip table",
.short_help = "ip table [add|del] <table-id>",
.function = vnet_ip4_table_cmd,
}
clib_error_t * vnet_ip4_table_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:555

(constructor) VLIB_CLI_COMMAND (ip4_table_command)

Definition at line 639 of file lookup.c.

◆ ip6_table_command

vlib_cli_command_t ip6_table_command
static
Initial value:
= {
.path = "ip6 table",
.short_help = "ip6 table [add|del] <table-id>",
.function = vnet_ip6_table_cmd,
}
clib_error_t * vnet_ip6_table_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:562

(constructor) VLIB_CLI_COMMAND (ip6_table_command)

Definition at line 654 of file lookup.c.

◆ ip_container_command_node

vlib_cli_command_t ip_container_command_node
static
Initial value:
= {
.path = "ip container",
.function = ip_container_cmd,
.short_help = "ip container <address> <interface>",
.is_mp_safe = 1,
}
clib_error_t * ip_container_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:1142

(constructor) VLIB_CLI_COMMAND (ip_container_command_node)

Definition at line 1206 of file lookup.c.

◆ ip_mroute_command

vlib_cli_command_t ip_mroute_command
static
Initial value:
=
{
.path = "ip mroute",
.short_help = "ip mroute [add|del] <dst-ip-addr>/<width> [table <table-id>] [rpf-id <ID>] [via <next-hop-ip-addr> [<interface>],",
.function = vnet_ip_mroute_cmd,
.is_mp_safe = 1,
}
clib_error_t * vnet_ip_mroute_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:784

(constructor) VLIB_CLI_COMMAND (ip_mroute_command)

Definition at line 1019 of file lookup.c.

◆ ip_route_command

vlib_cli_command_t ip_route_command
static
Initial value:
= {
.path = "ip route",
.short_help = "ip route [add|del] [count <n>] <dst-ip-addr>/<width> [table <table-id>] via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <interface>] [out-labels <value value value>]",
.function = vnet_ip_route_cmd,
.is_mp_safe = 1,
}
static clib_error_t * vnet_ip_route_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:313

(constructor) VLIB_CLI_COMMAND (ip_route_command)

Definition at line 624 of file lookup.c.

◆ set_interface_ip6_table_command

vlib_cli_command_t set_interface_ip6_table_command
static
Initial value:
=
{
.path = "set interface ip6 table",
.function = ip6_table_bind_cmd,
.short_help = "set interface ip6 table <interface> <table-id>"
}
static clib_error_t * ip6_table_bind_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: lookup.c:720

(constructor) VLIB_CLI_COMMAND (set_interface_ip6_table_command)

Definition at line 775 of file lookup.c.

◆ set_interface_ip_table_command

vlib_cli_command_t set_interface_ip_table_command
static
Initial value:
=
{
.path = "set interface ip table",
.function = ip4_table_bind_cmd,
.short_help = "set interface ip table <interface> <table-id>",
}
static clib_error_t * ip4_table_bind_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: lookup.c:712

(constructor) VLIB_CLI_COMMAND (set_interface_ip_table_command)

Definition at line 747 of file lookup.c.

◆ show_ip_container_command

vlib_cli_command_t show_ip_container_command
static
Initial value:
= {
.path = "show ip container",
.short_help = "show ip container <address> <interface>",
.is_mp_safe = 1,
}
clib_error_t * show_ip_container_cmd_fn(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: lookup.c:1215

(constructor) VLIB_CLI_COMMAND (show_ip_container_command)

Definition at line 1265 of file lookup.c.

◆ vlib_cli_ip6_command

vlib_cli_command_t vlib_cli_ip6_command
static
Initial value:
= {
.path = "ip6",
.short_help = "Internet protocol version 6 (IPv6) commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_ip6_command)

Definition at line 576 of file lookup.c.

◆ vlib_cli_ip_command

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

◆ vlib_cli_show_ip6_command

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

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_ip6_command)

Definition at line 590 of file lookup.c.

◆ vlib_cli_show_ip_command

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

◆ zero_addr

const ip46_address_t zero_addr
Initial value:
= {
.as_u64 = {
0, 0},
}

Definition at line 307 of file lookup.c.