FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
map.c File Reference
+ Include dependency graph for map.c:

Go to the source code of this file.

Functions

static void map_save_extras (u32 map_domain_index, u8 *tag)
 
static void map_free_extras (u32 map_domain_index)
 
int map_create_domain (ip4_address_t *ip4_prefix, u8 ip4_prefix_len, ip6_address_t *ip6_prefix, u8 ip6_prefix_len, ip6_address_t *ip6_src, u8 ip6_src_len, u8 ea_bits_len, u8 psid_offset, u8 psid_length, u32 *map_domain_index, u16 mtu, u8 flags, u8 *tag)
 
int map_delete_domain (u32 map_domain_index)
 
int map_add_del_psid (u32 map_domain_index, u16 psid, ip6_address_t *tep, bool is_add)
 
static void map_pre_resolve_init (map_main_pre_resolved_t *pr)
 
static u8format_map_pre_resolve (u8 *s, va_list *ap)
 
static void map_last_lock_gone (fib_node_t *node)
 Function definition to inform the FIB node that its last lock has gone. More...
 
static map_main_pre_resolved_tmap_from_fib_node (fib_node_t *node)
 
static void map_stack (map_main_pre_resolved_t *pr)
 
static fib_node_back_walk_rc_t map_back_walk (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 Function definition to backwalk a FIB node. More...
 
static fib_node_tmap_fib_node_get (fib_node_index_t index)
 Function definition to get a FIB node from its index. More...
 
static void map_fib_resolve (map_main_pre_resolved_t *pr, fib_protocol_t proto, u8 len, const ip46_address_t *addr)
 
static void map_fib_unresolve (map_main_pre_resolved_t *pr, fib_protocol_t proto, u8 len, const ip46_address_t *addr)
 
void map_pre_resolve (ip4_address_t *ip4, ip6_address_t *ip6, bool is_del)
 
static clib_error_tmap_security_check_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_add_domain_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_del_domain_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_add_rule_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_pre_resolve_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_icmp_relay_source_address_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_icmp_unreachables_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_fragment_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_traffic_class_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static char * map_flags_to_string (u32 flags)
 
static u8format_map_domain (u8 *s, va_list *args)
 
static clib_error_tshow_map_domain_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
u64 map_error_counter_get (u32 node_index, map_error_t map_error)
 
static clib_error_tshow_map_stats_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tmap_if_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
u8format_map_trace (u8 *s, va_list *args)
 
static clib_error_tmap_tcp_mss_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
 VLIB_PLUGIN_REGISTER ()
 
clib_error_tmap_init (vlib_main_t *vm)
 

Variables

map_main_t map_main
 
map_main_pre_resolved_t pre_resolved [FIB_PROTOCOL_MAX]
 Pre-resolved per-protocol global next-hops. More...
 
const static fib_node_vft_t map_vft
 
static vlib_cli_command_t map_traffic_class_command
 (constructor) VLIB_CLI_COMMAND (map_traffic_class_command) More...
 
static vlib_cli_command_t map_tcp_mss_command
 (constructor) VLIB_CLI_COMMAND (map_tcp_mss_command) More...
 
static vlib_cli_command_t map_pre_resolve_command
 (constructor) VLIB_CLI_COMMAND (map_pre_resolve_command) More...
 
static vlib_cli_command_t map_security_check_command
 (constructor) VLIB_CLI_COMMAND (map_security_check_command) More...
 
static vlib_cli_command_t map_icmp_relay_source_address_command
 (constructor) VLIB_CLI_COMMAND (map_icmp_relay_source_address_command) More...
 
static vlib_cli_command_t map_icmp_unreachables_command
 (constructor) VLIB_CLI_COMMAND (map_icmp_unreachables_command) More...
 
static vlib_cli_command_t map_fragment_command
 (constructor) VLIB_CLI_COMMAND (map_fragment_command) More...
 
static vlib_cli_command_t map_add_domain_command
 (constructor) VLIB_CLI_COMMAND (map_add_domain_command) More...
 
static vlib_cli_command_t map_add_rule_command
 (constructor) VLIB_CLI_COMMAND (map_add_rule_command) More...
 
static vlib_cli_command_t map_del_command
 (constructor) VLIB_CLI_COMMAND (map_del_command) More...
 
static vlib_cli_command_t show_map_domain_command
 (constructor) VLIB_CLI_COMMAND (show_map_domain_command) More...
 
static vlib_cli_command_t show_map_stats_command
 (constructor) VLIB_CLI_COMMAND (show_map_stats_command) More...
 
static vlib_cli_command_t map_if_command
 (constructor) VLIB_CLI_COMMAND (map_if_command) More...
 

Function Documentation

◆ format_map_domain()

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

Definition at line 910 of file map.c.

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

◆ format_map_pre_resolve()

static u8* format_map_pre_resolve ( u8 s,
va_list *  ap 
)
static

Definition at line 293 of file map.c.

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

◆ format_map_trace()

u8* format_map_trace ( u8 s,
va_list *  args 
)

Definition at line 1204 of file map.c.

◆ map_add_del_psid()

int map_add_del_psid ( u32  map_domain_index,
u16  psid,
ip6_address_t *  tep,
bool  is_add 
)

Definition at line 235 of file map.c.

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

◆ map_add_domain_command_fn()

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

Definition at line 505 of file map.c.

+ Here is the call graph for this function:

◆ map_add_rule_command_fn()

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

Definition at line 622 of file map.c.

+ Here is the call graph for this function:

◆ map_back_walk()

static fib_node_back_walk_rc_t map_back_walk ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Function definition to backwalk a FIB node.

Definition at line 350 of file map.c.

+ Here is the call graph for this function:

◆ map_create_domain()

int map_create_domain ( ip4_address_t ip4_prefix,
u8  ip4_prefix_len,
ip6_address_t *  ip6_prefix,
u8  ip6_prefix_len,
ip6_address_t *  ip6_src,
u8  ip6_src_len,
u8  ea_bits_len,
u8  psid_offset,
u8  psid_length,
u32 map_domain_index,
u16  mtu,
u8  flags,
u8 tag 
)

Definition at line 105 of file map.c.

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

◆ map_del_domain_command_fn()

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

Definition at line 583 of file map.c.

+ Here is the call graph for this function:

◆ map_delete_domain()

int map_delete_domain ( u32  map_domain_index)

Definition at line 204 of file map.c.

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

◆ map_error_counter_get()

u64 map_error_counter_get ( u32  node_index,
map_error_t  map_error 
)

Definition at line 1036 of file map.c.

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

◆ map_fib_node_get()

static fib_node_t* map_fib_node_get ( fib_node_index_t  index)
static

Function definition to get a FIB node from its index.

Definition at line 361 of file map.c.

◆ map_fib_resolve()

static void map_fib_resolve ( map_main_pre_resolved_t pr,
fib_protocol_t  proto,
u8  len,
const ip46_address_t *  addr 
)
static

Definition at line 377 of file map.c.

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

◆ map_fib_unresolve()

static void map_fib_unresolve ( map_main_pre_resolved_t pr,
fib_protocol_t  proto,
u8  len,
const ip46_address_t *  addr 
)
static

Definition at line 392 of file map.c.

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

◆ map_flags_to_string()

static char* map_flags_to_string ( u32  flags)
static

Definition at line 902 of file map.c.

+ Here is the caller graph for this function:

◆ map_fragment_command_fn()

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

Definition at line 800 of file map.c.

+ Here is the call graph for this function:

◆ map_free_extras()

static void map_free_extras ( u32  map_domain_index)
static

Definition at line 88 of file map.c.

+ Here is the caller graph for this function:

◆ map_from_fib_node()

static map_main_pre_resolved_t* map_from_fib_node ( fib_node_t node)
static

Definition at line 328 of file map.c.

+ Here is the caller graph for this function:

◆ map_icmp_relay_source_address_command_fn()

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

Definition at line 716 of file map.c.

+ Here is the call graph for this function:

◆ map_icmp_unreachables_command_fn()

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

Definition at line 757 of file map.c.

+ Here is the call graph for this function:

◆ map_if_command_fn()

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

Definition at line 1151 of file map.c.

+ Here is the call graph for this function:

◆ map_init()

clib_error_t* map_init ( vlib_main_t vm)

Definition at line 1479 of file map.c.

+ Here is the call graph for this function:

◆ map_last_lock_gone()

static void map_last_lock_gone ( fib_node_t node)
static

Function definition to inform the FIB node that its last lock has gone.

Definition at line 318 of file map.c.

◆ map_pre_resolve()

void map_pre_resolve ( ip4_address_t ip4,
ip6_address_t *  ip6,
bool  is_del 
)

Definition at line 407 of file map.c.

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

◆ map_pre_resolve_command_fn()

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

Definition at line 672 of file map.c.

+ Here is the call graph for this function:

◆ map_pre_resolve_init()

static void map_pre_resolve_init ( map_main_pre_resolved_t pr)
static

Definition at line 286 of file map.c.

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

◆ map_save_extras()

static void map_save_extras ( u32  map_domain_index,
u8 tag 
)
static

Definition at line 68 of file map.c.

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

◆ map_security_check_command_fn()

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

Definition at line 437 of file map.c.

+ Here is the call graph for this function:

◆ map_stack()

static void map_stack ( map_main_pre_resolved_t pr)
static

Definition at line 337 of file map.c.

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

◆ map_tcp_mss_command_fn()

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

Definition at line 1220 of file map.c.

+ Here is the call graph for this function:

◆ map_traffic_class_command_fn()

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

Definition at line 865 of file map.c.

+ Here is the call graph for this function:

◆ show_map_domain_command_fn()

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

Definition at line 969 of file map.c.

+ Here is the call graph for this function:

◆ show_map_stats_command_fn()

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

Definition at line 1053 of file map.c.

+ Here is the call graph for this function:

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

Variable Documentation

◆ map_add_domain_command

vlib_cli_command_t map_add_domain_command
static
Initial value:
= {
.path = "map add domain",
.short_help = "map add domain [tag <tag>] ip4-pfx <ip4-pfx> "
"ip6-pfx <ip6-pfx> "
"ip6-src <ip6-pfx> ea-bits-len <n> psid-offset <n> psid-len <n> "
"[map-t] [mtu <mtu>]",
}

(constructor) VLIB_CLI_COMMAND (map_add_domain_command)

Definition at line 1397 of file map.c.

◆ map_add_rule_command

vlib_cli_command_t map_add_rule_command
static
Initial value:
= {
.path = "map add rule",
.short_help = "map add rule index <domain> psid <psid> ip6-dst <ip6-addr>",
}

(constructor) VLIB_CLI_COMMAND (map_add_rule_command)

Definition at line 1413 of file map.c.

◆ map_del_command

vlib_cli_command_t map_del_command
static
Initial value:
= {
.path = "map del domain",
.short_help = "map del domain index <domain>",
}

(constructor) VLIB_CLI_COMMAND (map_del_command)

Definition at line 1426 of file map.c.

◆ map_fragment_command

vlib_cli_command_t map_fragment_command
static
Initial value:
= {
.path = "map params fragment",
.short_help = "map params fragment inner|outer ignore-df|honor-df",
}

(constructor) VLIB_CLI_COMMAND (map_fragment_command)

Definition at line 1383 of file map.c.

◆ map_icmp_relay_source_address_command

vlib_cli_command_t map_icmp_relay_source_address_command
static
Initial value:
= {
.path = "map params icmp source-address",
.short_help = "map params icmp source-address <ip4-address>",
}

(constructor) VLIB_CLI_COMMAND (map_icmp_relay_source_address_command)

Definition at line 1348 of file map.c.

◆ map_icmp_unreachables_command

vlib_cli_command_t map_icmp_unreachables_command
static
Initial value:
= {
.path = "map params icmp6 unreachables",
.short_help = "map params icmp6 unreachables {on|off}",
}

(constructor) VLIB_CLI_COMMAND (map_icmp_unreachables_command)

Definition at line 1364 of file map.c.

◆ map_if_command

vlib_cli_command_t map_if_command
static
Initial value:
= {
.path = "map interface",
.short_help = "map interface <interface-name> [map-t] [del]",
.function = map_if_command_fn,
}

(constructor) VLIB_CLI_COMMAND (map_if_command)

Definition at line 1462 of file map.c.

◆ map_main

map_main_t map_main

Definition at line 27 of file map.c.

◆ map_pre_resolve_command

vlib_cli_command_t map_pre_resolve_command
static
Initial value:
= {
.path = "map params pre-resolve",
.short_help = " map params pre-resolve {ip4-nh <address>} "
"| {ip6-nh <address>}",
}

(constructor) VLIB_CLI_COMMAND (map_pre_resolve_command)

Definition at line 1306 of file map.c.

◆ map_security_check_command

vlib_cli_command_t map_security_check_command
static
Initial value:
= {
.path = "map params security-check",
.short_help = "map params security-check enable|disable fragments on|off",
}

(constructor) VLIB_CLI_COMMAND (map_security_check_command)

Definition at line 1330 of file map.c.

◆ map_tcp_mss_command

vlib_cli_command_t map_tcp_mss_command
static
Initial value:
= {
.path = "map params tcp-mss",
.short_help = "map params tcp-mss <value>",
}

(constructor) VLIB_CLI_COMMAND (map_tcp_mss_command)

Definition at line 1288 of file map.c.

◆ map_traffic_class_command

vlib_cli_command_t map_traffic_class_command
static
Initial value:
= {
.path = "map params traffic-class",
.short_help = "map params traffic-class {0x0-0xff | copy}",
}

(constructor) VLIB_CLI_COMMAND (map_traffic_class_command)

Definition at line 1272 of file map.c.

◆ map_vft

const static fib_node_vft_t map_vft
static
Initial value:
= {
.fnv_get = map_fib_node_get,
.fnv_last_lock = map_last_lock_gone,
.fnv_back_walk = map_back_walk,
}

Definition at line 370 of file map.c.

◆ pre_resolved

Pre-resolved per-protocol global next-hops.

Pre-resolved next hops for v4 and v6.

Definition at line 283 of file map.c.

◆ show_map_domain_command

vlib_cli_command_t show_map_domain_command
static
Initial value:
= {
.path = "show map domain",
.short_help = "show map domain index <n> [counters]",
}

(constructor) VLIB_CLI_COMMAND (show_map_domain_command)

Definition at line 1439 of file map.c.

◆ show_map_stats_command

vlib_cli_command_t show_map_stats_command
static
Initial value:
= {
.path = "show map stats",
.short_help = "show map stats",
}

(constructor) VLIB_CLI_COMMAND (show_map_stats_command)

Definition at line 1452 of file map.c.

map_fib_node_get
static fib_node_t * map_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: map.c:361
map_if_command_fn
static clib_error_t * map_if_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:1151
map_fragment_command_fn
static clib_error_t * map_fragment_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:800
map_back_walk
static fib_node_back_walk_rc_t map_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node.
Definition: map.c:350
show_map_stats_command_fn
static clib_error_t * show_map_stats_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:1053
map_add_domain_command_fn
static clib_error_t * map_add_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:505
map_security_check_command_fn
static clib_error_t * map_security_check_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:437
map_pre_resolve_command_fn
static clib_error_t * map_pre_resolve_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:672
map_add_rule_command_fn
static clib_error_t * map_add_rule_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:622
show_map_domain_command_fn
static clib_error_t * show_map_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:969
map_icmp_relay_source_address_command_fn
static clib_error_t * map_icmp_relay_source_address_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:716
map_tcp_mss_command_fn
static clib_error_t * map_tcp_mss_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:1220
map_last_lock_gone
static void map_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: map.c:318
map_traffic_class_command_fn
static clib_error_t * map_traffic_class_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:865
map_del_domain_command_fn
static clib_error_t * map_del_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:583
map_icmp_unreachables_command_fn
static clib_error_t * map_icmp_unreachables_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: map.c:757