23 #include <vpp/app/version.h> 73 if (map_domain_index == ~0)
83 len = strlen (tag) + 1;
96 if (map_domain_index == ~0)
121 u8 suffix_len, suffix_shift;
126 if (ip4_prefix_len + ea_bits_len < 32)
129 suffix_shift = 32 - ip4_prefix_len - ea_bits_len;
130 suffix_len = ea_bits_len;
135 suffix_len = 32 - ip4_prefix_len;
139 if (ea_bits_len > 0 && ((ip6_prefix_len + ea_bits_len) > 64 ||
140 ip6_prefix_len + suffix_len + psid_length > 64))
143 (
"Embedded Address bits must be within the first 64 bits of " 151 *map_domain_index = d - mm->
domains;
168 d->
psid_shift = 16 - psid_length - psid_offset;
216 clib_warning (
"MAP domain delete: domain does not exist: %d",
248 clib_warning (
"MAP rule: domain does not exist: %d", map_domain_index);
268 clib_warning (
"MAP rule: PSID outside bounds: %d [%d]", psid,
275 d->
rules[psid] = *tep;
284 #ifdef MAP_SKIP_IP6_LOOKUP 308 return (
format (s,
"%U (%u)",
314 return (
format (s,
"un-set"));
368 return (&pre_resolved[index].node);
424 if (ip6 && (ip6->
as_u64[0] != 0 || ip6->
as_u64[1] != 0))
426 ip46_address_t
addr = {
431 FIB_PROTOCOL_IP6, 128, &addr);
434 FIB_PROTOCOL_IP6, 128, &addr);
436 if (ip4 && (ip4->
as_u32 != 0))
438 ip46_address_t
addr = {
443 FIB_PROTOCOL_IP4, 32, &addr);
446 FIB_PROTOCOL_IP4, 32, &addr);
459 bool check_frag =
false;
460 bool saw_enable =
false;
461 bool saw_frag =
false;
469 if (
unformat (line_input,
"enable"))
474 else if (
unformat (line_input,
"disable"))
479 else if (
unformat (line_input,
"fragments on"))
484 else if (
unformat (line_input,
"fragments off"))
500 "Must specify enable 'enable' or 'disable'");
527 u32 ip6_prefix_len = 0, ip4_prefix_len = 0, map_domain_index, ip6_src_len;
530 u32 ea_bits_len = 0, psid_offset = 0, psid_length = 0;
561 else if (
unformat (line_input,
"ea-bits-len %d", &ea_bits_len))
563 else if (
unformat (line_input,
"psid-offset %d", &psid_offset))
565 else if (
unformat (line_input,
"psid-len %d", &psid_length))
567 else if (
unformat (line_input,
"mtu %d", &mtu))
569 else if (
unformat (line_input,
"tag %s", &tag))
586 &ip6_prefix, ip6_prefix_len, &ip6_src, ip6_src_len,
587 ea_bits_len, psid_offset, psid_length, &map_domain_index,
588 mtu, flags, (
char *) tag);
602 u32 map_domain_index;
611 if (
unformat (line_input,
"index %d", &map_domain_index))
642 u32 psid = 0, map_domain_index;
651 if (
unformat (line_input,
"index %d", &map_domain_index))
653 else if (
unformat (line_input,
"psid %d", &psid))
684 #if MAP_SKIP_IP6_LOOKUP 710 else if (
unformat (line_input,
"del"))
752 p_icmp_addr = &icmp_src_address;
778 bool enabled =
false;
789 else if (
unformat (line_input,
"off"))
819 bool frag_inner =
false;
820 bool frag_ignore_df =
false;
821 bool saw_in_out =
false;
835 else if (
unformat (line_input,
"outer"))
840 else if (
unformat (line_input,
"ignore-df"))
842 frag_ignore_df =
true;
845 else if (
unformat (line_input,
"honor-df"))
847 frag_ignore_df =
false;
886 bool tc_copy =
false;
897 else if (
unformat (line_input,
"%x", &tc))
927 bool counters = va_arg (*args,
int);
941 "[%d] tag {%s} ip4-pfx %U/%d ip6-pfx %U/%d ip6-src %U/%d " 942 "ea-bits-len %d psid-offset %d psid-len %d mtu %d %s",
943 map_domain_index, de->
tag,
955 map_domain_index, &v);
958 map_domain_index, &v);
989 f64 dt = (r->
ts + lifetime > now) ? (r->
ts + lifetime - now) : -1;
991 "ip4-reass src=%U dst=%U protocol=%d identifier=%d port=%d lifetime=%.3lf\n",
993 &k->dst.as_u8, k->protocol,
994 clib_net_to_host_u16 (k->fragment_id),
995 (r->
port >= 0) ? clib_net_to_host_u16 (r->
port) : -1, dt);
1007 f64 dt = (r->
ts + lifetime > now) ? (r->
ts + lifetime - now) : -1;
1009 "ip6-reass src=%U dst=%U protocol=%d identifier=%d lifetime=%.3lf\n",
1011 &k->dst.as_u8, k->protocol,
1012 clib_net_to_host_u32 (k->fragment_id), dt);
1023 bool counters =
false;
1024 u32 map_domain_index = ~0;
1033 if (
unformat (line_input,
"counters"))
1035 else if (
unformat (line_input,
"index %d", &map_domain_index))
1048 if (map_domain_index == ~0)
1052 ({vlib_cli_output(vm,
"%U", format_map_domain, d, counters);}));
1102 ASSERT (ci < n->n_errors);
1114 int domains = 0,
rules = 0, domaincount = 0, rulecount = 0;
1124 rulecount+= 0x1 << d->psid_length;
1125 rules += sizeof(ip6_address_t) * 0x1 << d->psid_length;
1127 domains +=
sizeof(*d);
1137 #if MAP_SKIP_IP6_LOOKUP 1139 "MAP pre-resolve: IP6 next-hop: %U, IP4 next-hop: %U\n",
1154 "MAP IPv6 inbound security check: %s, fragmented packet security check: %s",
1155 mm->sec_check ?
"enabled" :
"disabled",
1156 mm->sec_check_frag ?
"enabled" :
"disabled");
1161 mm->icmp6_enabled ?
"enabled" :
"disabled");
1163 mm->frag_inner ?
"enabled" :
"disabled");
1165 mm->frag_ignore_df ?
"enabled" :
"disabled");
1177 clib_memset (total_bytes, 0,
sizeof (total_bytes));
1182 which = cm - mm->domain_counters;
1187 total_pkts[which] += v.
packets;
1188 total_bytes[which] += v.
bytes;
1214 u64 buffers = ~(0ull);
1215 u8 ip4 = 0, ip6 = 0;
1222 if (
unformat (line_input,
"lifetime %u", &lifetime))
1224 else if (
unformat (line_input,
"ht-ratio %lf", &ht_ratio))
1226 else if (
unformat (line_input,
"pool-size %u", &pool_size))
1228 else if (
unformat (line_input,
"buffers %llu", &buffers))
1230 else if (
unformat (line_input,
"ip4"))
1232 else if (
unformat (line_input,
"ip6"))
1280 u32 reass = 0, packets = 0;
1288 "Note: destroyed-reassembly=%u , dropped-fragments=%u",
1306 "Note: 'ip6-reass buffers' > pool-size * max-fragments-per-reassembly.");
1319 bool is_enable =
true, is_translation =
false;
1332 else if (
unformat (line_input,
"del"))
1334 else if (
unformat (line_input,
"map-t"))
1335 is_translation =
true;
1347 if (sw_if_index == ~0)
1376 format (s,
"MAP domain index: %d L4 port: %u", map_domain_index,
1377 clib_net_to_host_u16 (port));
1401 #define map_ip4_reass_pool_index(r) (r - map_main.ip4_reass_pool) 1453 .dst.data_u32 =
dst,
1454 .fragment_id = fragment_id,
1455 .protocol = protocol
1459 #ifdef clib_crc32c_uses_intrinsics 1460 h = clib_crc32c ((
u8 *) k.
as_u32, 16);
1519 #ifdef MAP_IP4_REASS_COUNT_BYTES 1564 #define map_ip6_reass_pool_index(r) (r - map_main.ip6_reass_pool) 1627 .fragment_id = fragment_id,
1628 .protocol = protocol
1634 #ifdef clib_crc32c_uses_intrinsics 1635 h = clib_crc32c ((
u8 *) k.
as_u32, 40);
1699 #ifdef MAP_IP6_REASS_COUNT_BYTES 1708 u16 data_offset,
u16 next_data_offset,
1709 u8 * data_start,
u16 data_len)
1712 u16 copied_len = (data_len > 20) ? 20 : data_len;
1734 else if (prev_f ==
NULL)
1739 if (!f || f->
pi != ~0)
1748 prev_f->next_data_len = copied_len;
1749 prev_f->next_data_offset = data_offset;
1753 if (((
ip4_header_t *) data_start)->ip_version_and_header_length != 0x45)
1775 if (dropped_packets)
1810 u32 desired_size = (
u32) (pool_size * ht_ratio);
1812 for (i = 1; i < 31; i++)
1813 if ((1 << i) >= desired_size)
1820 u32 * dropped_packets)
1837 u32 * dropped_packets)
1868 if (dropped_packets)
1903 u32 * dropped_packets)
1920 u32 * dropped_packets)
1961 if (
unformat (line_input,
"%u", &tcp_mss))
1971 if (tcp_mss >= (0x1 << 16))
1996 .path =
"map params reassembly",
1997 .short_help =
"map params reassembly [ip4 | ip6] [lifetime <lifetime-ms>] " 1998 "[pool-size <pool-size>] [buffers <buffers>] " 1999 "[ht-ratio <ht-ratio>]",
2016 .path =
"map params traffic-class",
2017 .short_help =
"map params traffic-class {0x0-0xff | copy}",
2032 .path =
"map params tcp-mss",
2033 .short_help =
"map params tcp-mss <value>",
2050 .path =
"map params pre-resolve",
2051 .short_help =
" map params pre-resolve {ip4-nh <address>} " 2052 "| {ip6-nh <address>}",
2074 .path =
"map params security-check",
2075 .short_help =
"map params security-check enable|disable fragments on|off",
2092 .path =
"map params icmp source-address",
2093 .short_help =
"map params icmp source-address <ip4-address>",
2108 .path =
"map params icmp6 unreachables",
2109 .short_help =
"map params icmp6 unreachables {on|off}",
2127 .path =
"map params fragment",
2128 .short_help =
"map params fragment inner|outer ignore-df|honor-df",
2141 .path =
"map add domain",
2142 .short_help =
"map add domain [tag <tag>] ip4-pfx <ip4-pfx> " 2143 "ip6-pfx <ip6-pfx> " 2144 "ip6-src <ip6-pfx> ea-bits-len <n> psid-offset <n> psid-len <n> " 2145 "[map-t] [mtu <mtu>]",
2157 .path =
"map add rule",
2158 .short_help =
"map add rule index <domain> psid <psid> ip6-dst <ip6-addr>",
2170 .path =
"map del domain",
2171 .short_help =
"map del domain index <domain>",
2183 .path =
"show map domain",
2184 .short_help =
"show map domain index <n> [counters]",
2196 .path =
"show map stats",
2197 .short_help =
"show map stats",
2209 .path =
"show map fragments",
2210 .short_help =
"show map fragments",
2219 .path =
"map interface",
2220 .short_help =
"map interface <interface-name> [map-t] [del]",
2225 .version = VPP_BUILD_VER,
2226 .description =
"Mapping of Address and Port (MAP)",
2240 memset (mm, 0,
sizeof (*mm));
2245 #ifdef MAP_SKIP_IP6_LOOKUP 2309 #ifdef MAP_SKIP_IP6_LOOKUP
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
int map_param_set_icmp(ip4_address_t *ip4_err_relay_src)
fib_protocol_t fp_proto
protocol type
#define map_ip4_reass_lock()
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, char *tag)
map_ip4_reass_t * ip4_reass_pool
int map_add_del_psid(u32 map_domain_index, u16 psid, ip6_address_t *tep, bool is_add)
lpm_t * lpm_table_init(enum lpm_type_e lpm_type)
Recursive resolution source.
u32 ip4_reass_conf_buffers
fib_node_t node
Linkage into the FIB graph.
static clib_error_t * map_fragment_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define MAP_IP6_REASS_CONF_BUFFERS_MAX
int map_delete_domain(u32 map_domain_index)
#define MAP_IP6_REASS_BUFFERS_DEFAULT
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
static fib_node_t * map_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
volatile u32 * ip6_reass_lock
u32 fragments[MAP_IP4_REASS_MAX_FRAGMENTS_PER_REASSEMBLY]
vnet_main_t * vnet_get_main(void)
#define MAP_IP6_REASS_LIFETIME_DEFAULT
static_always_inline map_ip6_reass_t * map_ip6_reass_lookup(map_ip6_reass_key_t *k, u32 bucket, f64 now)
#define pool_alloc(P, N)
Allocate N more free elements to pool (unspecified alignment).
int map_if_enable_disable(bool is_enable, u32 sw_if_index, bool is_translation)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
#define clib_memcpy_fast(a, b, c)
dpo_id_t dpo
The Load-balance object index to use to forward.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static u8 * format_map_domain(u8 *s, va_list *args)
static f64 vlib_time_now(vlib_main_t *vm)
static clib_error_t * show_map_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void map_ip4_reass_reinit(u32 *trashed_reass, u32 *dropped_packets)
static clib_error_t * map_security_check_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)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
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_free_extras(u32 map_domain_index)
static clib_error_t * show_map_fragments_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static void map_domain_counter_unlock(map_main_t *mm)
Combined counter to hold both packets and byte differences.
static u64 clib_xxhash(u64 key)
static heap_elt_t * last(heap_header_t *h)
#define STRUCT_OFFSET_OF(t, f)
u32 ip4_reass_buffered_counter
static u8 * format_map_ip4_reass(u8 *s, va_list *args)
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
unformat_function_t unformat_vnet_sw_interface
uword * bm_trans_enabled_by_sw_if
#define MAP_ERR_BAD_HT_RATIO
vlib_error_t * errors
Vector of errors for this node.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
void map_pre_resolve(ip4_address_t *ip4, ip6_address_t *ip6, bool is_del)
int map_ip6_reass_conf_ht_ratio(f32 ht_ratio, u32 *trashed_reass, u32 *dropped_packets)
#define MAP_IP6_REASS_CONF_LIFETIME_MAX
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
map_ip6_reass_t * ip6_reass_pool
map_ip6_fragment_t fragments[MAP_IP6_REASS_MAX_FRAGMENTS_PER_REASSEMBLY]
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
#define map_ip6_reass_unlock()
#define clib_memcpy(d, s, n)
#define MAP_ERR_BAD_BUFFERS_TOO_LARGE
static counter_t vlib_get_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Get the value of a simple counter Scrapes the entire set of per-thread counters.
#define MAP_IP4_REASS_MAX_FRAGMENTS_PER_REASSEMBLY
#define static_always_inline
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
void(* add)(struct lpm_ *lpm, void *addr_v, u8 pfxlen, u32 value)
static clib_error_t * map_pre_resolve_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define MAP_REASS_INDEX_NONE
#define VLIB_INIT_FUNCTION(x)
static void map_save_extras(u32 map_domain_index, char *tag)
static clib_error_t * map_icmp_unreachables_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
vlib_combined_counter_main_t * domain_counters
ip4_address_t icmp4_src_address
static clib_error_t * map_add_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Aggregrate type for a prefix.
#define clib_error_return(e, args...)
vlib_simple_counter_main_t icmp_relayed
int map_ip4_reass_add_fragment(map_ip4_reass_t *r, u32 pi)
u8 map_get_ht_log2len(f32 ht_ratio, u16 pool_size)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
#define MAP_IP4_REASS_CONF_LIFETIME_MAX
static_always_inline map_ip4_reass_t * map_ip4_reass_lookup(map_ip4_reass_key_t *k, u32 bucket, f64 now)
#define MAP_IP6_REASS_CONF_POOL_SIZE_MAX
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
int map_ip6_reass_conf_buffers(u32 buffers)
#define map_ip4_reass_pool_index(r)
counter_t packets
packet counter
static clib_error_t * map_if_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * map_add_rule_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int map_ip4_reass_conf_lifetime(u16 lifetime_ms)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
static clib_error_t * map_tcp_mss_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_error_main_t error_main
static map_main_pre_resolved_t * map_from_fib_node(fib_node_t *node)
#define MAP_IP4_REASS_BUFFERS_DEFAULT
#define MAP_IP4_REASS_CONF_HT_RATIO_MAX
static u8 * format_map_ip6_reass(u8 *s, va_list *args)
volatile u32 * ip4_reass_lock
int map_param_set_traffic_class(bool copy, u8 tc)
u32 vlib_combined_counter_n_counters(const vlib_combined_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
u16 ip4_reass_conf_pool_size
int map_ip4_reass_conf_buffers(u32 buffers)
#define pool_put(P, E)
Free an object E in pool P.
#define FOR_EACH_FIB_PROTOCOL(_item)
int map_ip6_reass_conf_lifetime(u16 lifetime_ms)
map_ip4_reass_t * map_ip4_reass_get(u32 src, u32 dst, u16 fragment_id, u8 protocol, u32 **pi_to_drop)
int map_ip4_reass_conf_pool_size(u16 pool_size, u32 *trashed_reass, u32 *dropped_packets)
u16 * ip6_reass_hash_table
u16 * ip4_reass_hash_table
#define MAP_ERR_BAD_BUFFERS
fib_node_type_t fn_type
The node's type.
An node in the FIB graph.
#define MAP_IP4_REASS_HT_RATIO_DEFAULT
static u32 vlib_error_get_code(vlib_node_main_t *nm, vlib_error_t e)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
void map_ip4_drop_pi(u32 pi)
#define pool_free(p)
Free a pool.
void map_ip4_reass_free(map_ip4_reass_t *r, u32 **pi_to_drop)
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
static clib_error_t * map_params_reass_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lpm_t * ip6_src_prefix_tbl
u16 ip6_reass_conf_pool_size
static_always_inline void map_ip4_reass_get_fragments(map_ip4_reass_t *r, u32 **pi)
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
map_ip6_reass_t * map_ip6_reass_get(ip6_address_t *src, ip6_address_t *dst, u32 fragment_id, u8 protocol, u32 **pi_to_drop)
#define MAP_IP6_REASS_POOL_SIZE_DEFAULT
uword * bm_encap_enabled_by_sw_if
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * map_icmp_relay_source_address_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_warning(format, args...)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
int map_param_set_fragmentation(bool inner, bool ignore_df)
u32 sibling
This object sibling index on the FIB entry's child dependency list.
u32 fib_node_index_t
A typedef of a node index.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static void map_pre_resolve_init(map_main_pre_resolved_t *pr)
int map_ip4_reass_conf_ht_ratio(f32 ht_ratio, u32 *trashed_reass, u32 *dropped_packets)
static clib_error_t * map_del_domain_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void map_domain_counter_lock(map_main_t *mm)
f32 ip4_reass_conf_ht_ratio
Context passed between object during a back walk.
#define VLIB_CLI_COMMAND(x,...)
vl_api_gbp_rule_t rules[n_rules]
void vlib_validate_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
validate a simple counter
int map_ip6_reass_conf_pool_size(u16 pool_size, u32 *trashed_reass, u32 *dropped_packets)
void map_ip6_reass_reinit(u32 *trashed_reass, u32 *dropped_packets)
static void clib_mem_free(void *p)
#define map_ip4_reass_unlock()
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
u8 * format_map_trace(u8 *s, va_list *args)
#define MAP_IP6_REASS_HT_RATIO_DEFAULT
void(* delete)(struct lpm_ *lpm, void *addr_v, u8 pfxlen)
static void * clib_mem_alloc(uword size)
#define MAP_ERR_BAD_POOL_SIZE
static u8 * format_map_pre_resolve(u8 *s, va_list *ap)
static vlib_main_t * vlib_get_main(void)
f32 ip6_reass_conf_ht_ratio
static clib_error_t * map_traffic_class_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
counter_t bytes
byte counter
int map_param_set_security_check(bool enable, bool fragments)
char * stat_segment_name
Name in stat segment directory.
int map_param_set_icmp6(u8 enable_unreachable)
index_t dpoi_index
the index of objects of that type
#define FIB_NODE_INDEX_INVALID
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * map_plugin_api_hookup(vlib_main_t *vm)
u16 ip6_reass_conf_lifetime_ms
fib_node_index_t fei
The FIB entry index of the next-hop.
#define map_ip6_reass_lock()
vlib_node_main_t node_main
map_domain_extra_t * domain_extras
#define MAP_IP4_REASS_POOL_SIZE_DEFAULT
#define MAP_IP6_REASS_CONF_HT_RATIO_MAX
char * name
The counter collection's name.
A collection of combined counters.
#define MAP_IP4_REASS_LIFETIME_DEFAULT
IP4 reassembly logic: One virtually reassembled flow requires a map_ip4_reass_t structure in order to...
#define FIB_PROTOCOL_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements...
#define MAP_IP4_REASS_CONF_POOL_SIZE_MAX
A FIB graph nodes virtual function table.
void map_ip6_reass_free(map_ip6_reass_t *r, u32 **pi_to_drop)
vlib_simple_counter_main_t * simple_domain_counters
static void * clib_mem_alloc_aligned(uword size, uword align)
int map_param_set_tcp(u16 tcp_mss)
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.
#define MAP_IP6_REASS_MAX_FRAGMENTS_PER_REASSEMBLY
static void map_stack(map_main_pre_resolved_t *pr)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static void map_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
u16 ip4_reass_conf_lifetime_ms
#define vec_foreach(var, vec)
Vector iterator.
#define MAP_IP4_REASS_CONF_BUFFERS_MAX
#define MAP_ERR_BAD_LIFETIME
int map_param_set_reassembly(bool is_ipv6, u16 lifetime_ms, u16 pool_size, u32 buffers, f64 ht_ratio, u32 *reass, u32 *packets)
static char * map_flags_to_string(u32 flags)
u32 ip6_reass_buffered_counter
#define CLIB_CACHE_LINE_BYTES
int map_ip6_reass_add_fragment(map_ip6_reass_t *r, u32 pi, u16 data_offset, u16 next_data_offset, u8 *data_start, u16 data_len)
clib_error_t * map_init(vlib_main_t *vm)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void map_fib_unresolve(map_main_pre_resolved_t *pr, fib_protocol_t proto, u8 len, const ip46_address_t *addr)
static clib_error_t * show_map_stats_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void map_ip6_drop_pi(u32 pi)
#define map_ip6_reass_pool_index(r)
u32 ip6_reass_conf_buffers
static uword pool_elts(void *v)
Number of active elements in a pool.