29 __asm__
volatile (
"crc32l %[data], %[value];":[value]
"+r" (value):[data]
39 u64 tmp = ((
u64) data << 32) | (
u64) value;
93 else if (ip->
protocol == IP_PROTOCOL_ICMP)
95 icmp46_header_t *icmp = (
void *) (ip + 1);
96 if (icmp->type == ICMP4_echo_request || icmp->type == ICMP4_echo_reply)
98 return *((
u16 *) (icmp + 1));
100 else if (clib_net_to_host_u16 (ip->
length) >= 64)
109 else if (ip->
protocol == IP_PROTOCOL_ICMP)
111 icmp46_header_t *icmp = (
void *) (ip + 1);
112 if (icmp->type == ICMP4_echo_request ||
113 icmp->type == ICMP4_echo_reply)
115 return *((
u16 *) (icmp + 1));
131 if (
ip6_parse (ip6, buffer_len, &l4_protocol, &l4_offset, &frag_offset))
142 if (l4_protocol == IP_PROTOCOL_TCP || l4_protocol == IP_PROTOCOL_UDP)
149 else if (l4_protocol == IP_PROTOCOL_ICMP6)
151 icmp46_header_t *icmp = (icmp46_header_t *) (l4);
152 if (icmp->type == ICMP6_echo_request)
156 else if (icmp->type == ICMP6_echo_reply)
176 u8 suffix_len, suffix_shift;
186 if (ip6_src_len != 96)
188 clib_warning (
"MAP-T only supports ip6_src_len = 96 for now.");
194 if (ip6_src_len != 128)
197 (
"MAP-E requires a BR address, not a prefix (ip6_src_len should " 204 if (ip4_prefix_len + ea_bits_len < 32)
207 suffix_shift = 32 - ip4_prefix_len - ea_bits_len;
208 suffix_len = ea_bits_len;
213 suffix_len = 32 - ip4_prefix_len;
217 if (ea_bits_len > 0 && ((ip6_prefix_len + ea_bits_len) > 64 ||
218 ip6_prefix_len + suffix_len + psid_length > 64))
221 (
"Embedded Address bits must be within the first 64 bits of " 228 memset (d, 0,
sizeof (*d));
229 *map_domain_index = d - mm->
domains;
246 d->
psid_shift = 16 - psid_length - psid_offset;
251 if (d->
flags & MAP_DOMAIN_TRANSLATION)
311 if (d->
flags & MAP_DOMAIN_TRANSLATION)
359 clib_warning (
"MAP domain delete: domain does not exist: %d",
404 clib_warning (
"MAP rule: domain does not exist: %d", map_domain_index);
419 memset (d->
rules, 0, l);
424 clib_warning (
"MAP rule: PSID outside bounds: %d [%d]", psid,
431 d->
rules[psid] = *tep;
440 #ifdef MAP_SKIP_IP6_LOOKUP 464 return (
format (s,
"%U (%u)",
470 return (
format (s,
"un-set"));
526 return (&pre_resolved[index].node);
579 if (ip6 && (ip6->
as_u64[0] != 0 || ip6->
as_u64[1] != 0))
581 ip46_address_t
addr = {
586 FIB_PROTOCOL_IP6, 128, &addr);
589 FIB_PROTOCOL_IP6, 128, &addr);
591 if (ip4 && (ip4->
as_u32 != 0))
593 ip46_address_t
addr = {
598 FIB_PROTOCOL_IP4, 32, &addr);
601 FIB_PROTOCOL_IP4, 32, &addr);
623 else if (
unformat (line_input,
"on"))
656 else if (
unformat (line_input,
"on"))
680 u32 ip6_prefix_len = 0, ip4_prefix_len = 0, map_domain_index, ip6_src_len;
683 u32 ea_bits_len = 0, psid_offset = 0, psid_length = 0;
713 else if (
unformat (line_input,
"ea-bits-len %d", &ea_bits_len))
715 else if (
unformat (line_input,
"psid-offset %d", &psid_offset))
717 else if (
unformat (line_input,
"psid-len %d", &psid_length))
719 else if (
unformat (line_input,
"mtu %d", &mtu))
721 else if (
unformat (line_input,
"map-t"))
738 &ip6_prefix, ip6_prefix_len, &ip6_src, ip6_src_len,
739 ea_bits_len, psid_offset, psid_length, &map_domain_index,
754 u32 map_domain_index;
763 if (
unformat (line_input,
"index %d", &map_domain_index))
794 u32 psid = 0, map_domain_index;
803 if (
unformat (line_input,
"index %d", &map_domain_index))
805 else if (
unformat (line_input,
"psid %d", &psid))
836 #if MAP_SKIP_IP6_LOOKUP 848 memset (&ip4nh, 0,
sizeof (ip4nh));
849 memset (&ip6nh, 0,
sizeof (ip6nh));
862 else if (
unformat (line_input,
"del"))
935 else if (
unformat (line_input,
"off"))
971 else if (
unformat (line_input,
"outer"))
1004 else if (
unformat (line_input,
"off"))
1040 else if (
unformat (line_input,
"%x", &tc))
1060 bool counters = va_arg (*args,
int);
1065 memset (&ip6_prefix, 0,
sizeof (ip6_prefix));
1070 "[%d] ip4-pfx %U/%d ip6-pfx %U/%d ip6-src %U/%d ea_bits_len %d psid-offset %d psid-len %d mtu %d %s",
1117 f64 dt = (r->
ts + lifetime > now) ? (r->
ts + lifetime - now) : -1;
1119 "ip4-reass src=%U dst=%U protocol=%d identifier=%d port=%d lifetime=%.3lf\n",
1121 &k->dst.as_u8, k->protocol,
1122 clib_net_to_host_u16 (k->fragment_id),
1123 (r->
port >= 0) ? clib_net_to_host_u16 (r->
port) : -1, dt);
1135 f64 dt = (r->
ts + lifetime > now) ? (r->
ts + lifetime - now) : -1;
1137 "ip6-reass src=%U dst=%U protocol=%d identifier=%d lifetime=%.3lf\n",
1139 &k->dst.as_u8, k->protocol,
1140 clib_net_to_host_u32 (k->fragment_id), dt);
1151 bool counters =
false;
1152 u32 map_domain_index = ~0;
1161 if (
unformat (line_input,
"counters"))
1163 else if (
unformat (line_input,
"index %d", &map_domain_index))
1176 if (map_domain_index == ~0)
1179 pool_foreach(d, mm->
domains, ({vlib_cli_output(vm,
"%U", format_map_domain, d, counters);}));
1229 ASSERT (ci < n->n_errors);
1241 int domains = 0, rules = 0, domaincount = 0, rulecount = 0;
1248 rulecount+= 0x1 << d->psid_length;
1249 rules += sizeof(ip6_address_t) * 0x1 << d->psid_length;
1251 domains +=
sizeof(*d);
1261 #if MAP_SKIP_IP6_LOOKUP 1263 "MAP pre-resolve: IP6 next-hop: %U, IP4 next-hop: %U\n",
1275 "MAP IPv6 inbound security check: %s, fragmented packet security check: %s",
1276 mm->sec_check ?
"enabled" :
"disabled",
1277 mm->sec_check_frag ?
"enabled" :
"disabled");
1282 mm->icmp6_enabled ?
"enabled" :
"disabled");
1284 mm->frag_inner ?
"enabled" :
"disabled");
1286 mm->frag_ignore_df ?
"enabled" :
"disabled");
1297 memset (total_pkts, 0,
sizeof (total_pkts));
1298 memset (total_bytes, 0,
sizeof (total_bytes));
1303 which = cm - mm->domain_counters;
1308 total_pkts[which] += v.
packets;
1309 total_bytes[which] += v.
bytes;
1316 total_bytes[MAP_DOMAIN_COUNTER_TX]);
1319 total_bytes[MAP_DOMAIN_COUNTER_RX]);
1335 u64 buffers = ~(0ull);
1336 u8 ip4 = 0, ip6 = 0;
1343 if (
unformat (line_input,
"lifetime %u", &lifetime))
1345 else if (
unformat (line_input,
"ht-ratio %lf", &ht_ratio))
1347 else if (
unformat (line_input,
"pool-size %u", &pool_size))
1349 else if (
unformat (line_input,
"buffers %llu", &buffers))
1351 else if (
unformat (line_input,
"ip4"))
1353 else if (
unformat (line_input,
"ip6"))
1402 u32 reass = 0, packets = 0;
1403 if (pool_size != ~0)
1412 "Setting ip4-reass pool-size (destroyed-reassembly=%u , dropped-fragments=%u)",
1425 "Setting ip4-reass ht-log2len (destroyed-reassembly=%u , dropped-fragments=%u)",
1436 if (buffers != ~(0ull))
1449 "Note: 'ip4-reass buffers' > pool-size * max-fragments-per-reassembly.");
1455 u32 reass = 0, packets = 0;
1456 if (pool_size != ~0)
1465 "Setting ip6-reass pool-size (destroyed-reassembly=%u , dropped-fragments=%u)",
1478 "Setting ip6-reass ht-log2len (destroyed-reassembly=%u , dropped-fragments=%u)",
1489 if (buffers != ~(0ull))
1502 "Note: 'ip6-reass buffers' > pool-size * max-fragments-per-reassembly.");
1523 format (s,
"MAP domain index: %d L4 port: %u", map_domain_index,
1524 clib_net_to_host_u16 (port));
1548 #define map_ip4_reass_pool_index(r) (r - map_main.ip4_reass_pool) 1595 u8 protocol,
u32 ** pi_to_drop)
1600 .dst.data_u32 = dst,
1601 .fragment_id = fragment_id,
1602 .protocol = protocol
1664 #ifdef MAP_IP4_REASS_COUNT_BYTES 1709 #define map_ip6_reass_pool_index(r) (r - map_main.ip6_reass_pool) 1765 u8 protocol,
u32 ** pi_to_drop)
1772 .fragment_id = fragment_id,
1773 .protocol = protocol
1778 for (i = 0; i < 10; i++)
1837 #ifdef MAP_IP6_REASS_COUNT_BYTES 1846 u16 data_offset,
u16 next_data_offset,
1847 u8 * data_start,
u16 data_len)
1850 u16 copied_len = (data_len > 20) ? 20 : data_len;
1872 else if (prev_f ==
NULL)
1877 if (!f || f->
pi != ~0)
1885 clib_memcpy (prev_f->next_data, data_start, copied_len);
1886 prev_f->next_data_len = copied_len;
1887 prev_f->next_data_offset = data_offset;
1891 if (((
ip4_header_t *) data_start)->ip_version_and_header_length != 0x45)
1913 if (dropped_packets)
1948 u32 desired_size = (
u32) (pool_size * ht_ratio);
1950 for (i = 1; i < 31; i++)
1951 if ((1 << i) >= desired_size)
1958 u32 * dropped_packets)
1975 u32 * dropped_packets)
2006 if (dropped_packets)
2041 u32 * dropped_packets)
2058 u32 * dropped_packets)
2095 .path =
"map params reassembly",
2096 .short_help =
"map params reassembly [ip4 | ip6] [lifetime <lifetime-ms>] " 2097 "[pool-size <pool-size>] [buffers <buffers>] " 2098 "[ht-ratio <ht-ratio>]",
2115 .path =
"map params traffic-class",
2116 .short_help =
"map params traffic-class {0x0-0xff | copy}",
2133 .path =
"map params pre-resolve",
2134 .short_help =
" map params pre-resolve {ip4-nh <address>} " 2135 "| {ip6-nh <address>}",
2151 .path =
"map params security-check",
2152 .short_help =
"map params security-check on|off",
2168 .path =
"map params icmp source-address",
2169 .short_help =
"map params icmp source-address <ip4-address>",
2184 .path =
"map params icmp6 unreachables",
2185 .short_help =
"map params icmp6 unreachables {on|off}",
2197 .path =
"map params fragment",
2198 .short_help =
"map params fragment inner|outer",
2216 .path =
"map params fragment ignore-df",
2217 .short_help =
"map params fragment ignore-df on|off",
2234 .path =
"map params security-check fragments",
2235 .short_help =
"map params security-check fragments on|off",
2247 .path =
"map add domain",
2248 .short_help =
"map add domain ip4-pfx <ip4-pfx> ip6-pfx <ip6-pfx> " 2249 "ip6-src <ip6-pfx> ea-bits-len <n> psid-offset <n> psid-len <n> " 2250 "[map-t] [mtu <mtu>]",
2262 .path =
"map add rule",
2263 .short_help =
"map add rule index <domain> psid <psid> ip6-dst <ip6-addr>",
2275 .path =
"map del domain",
2276 .short_help =
"map del domain index <domain>",
2288 .path =
"show map domain",
2289 .short_help =
"show map domain index <n> [counters]",
2301 .path =
"show map stats",
2302 .short_help =
"show map stats",
2314 .path =
"show map fragments",
2315 .short_help =
"show map fragments",
2330 #ifdef MAP_SKIP_IP6_LOOKUP 2391 #ifdef MAP_SKIP_IP6_LOOKUP static map_dpo_t * map_dpo_get(index_t index)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
fib_protocol_t fp_proto
protocol type
#define map_ip4_reass_lock()
map_ip4_reass_t * ip4_reass_pool
Recursive resolution source.
u32 ip4_reass_conf_buffers
fib_node_t node
Linkage into the FIB graph.
sll srl srl sll sra u16x4 i
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
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
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)
static u8 * format_map_pre_resolve(u8 *s, va_list ap)
#define pool_alloc(P, N)
Allocate N more free elements to pool (unspecified alignment).
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)
static const fib_node_vft_t map_vft
void fib_entry_get_prefix(fib_node_index_t fib_entry_index, fib_prefix_t *pfx)
dpo_id_t dpo
The Load-balance object index to use to forward.
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.
static_always_inline int ip6_parse(const ip6_header_t *ip6, u32 buff_len, u8 *l4_protocol, u16 *l4_offset, u16 *frag_hdr_offset)
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
static clib_error_t * map_fragment_df_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void map_fib_resolve(map_main_pre_resolved_t *pr, fib_protocol_t proto, u8 len, const ip46_address_t *addr)
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)
i32 ip6_get_port(ip6_header_t *ip6, map_dir_e dir, u16 buffer_len)
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)
static u32 crc_u32(u32 data, u32 value)
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).
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()
static void map_pre_resolve(ip4_address_t *ip4, ip6_address_t *ip6, int is_del)
void map_dpo_create(dpo_proto_t dproto, u32 domain_index, dpo_id_t *dpo)
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.
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 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
static int ip4_get_fragment_offset(ip4_header_t *i)
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)
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)
int map_add_del_psid(u32 map_domain_index, u16 psid, ip6_address_t *tep, u8 is_add)
const int fib_entry_get_dpo_for_source(fib_node_index_t fib_entry_index, fib_source_t source, dpo_id_t *dpo)
#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_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.
vlib_error_main_t error_main
static map_main_pre_resolved_t * map_from_fib_node(fib_node_t *node)
dpo_type_t dpoi_type
the type
#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
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
load-balancing over a choice of [un]equal cost paths
int map_ip4_reass_conf_buffers(u32 buffers)
#define pool_put(P, E)
Free an object E in pool P.
void map_t_dpo_create(dpo_proto_t dproto, u32 domain_index, dpo_id_t *dpo)
#define FOR_EACH_FIB_PROTOCOL(_item)
void map_dpo_module_init(void)
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
i32 ip4_get_port(ip4_header_t *ip, map_dir_e dir, u16 buffer_len)
fib_node_type_t fn_type
The node's type.
An node in the FIB graph.
#define MAP_IP4_REASS_HT_RATIO_DEFAULT
const dpo_id_t * load_balance_get_bucket(index_t lbi, u32 bucket)
static u32 vlib_error_get_code(vlib_error_t e)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
void map_ip4_drop_pi(u32 pi)
map_main_pre_resolved_t pre_resolved[FIB_PROTOCOL_MAX]
Pre-resolvd per-protocol global next-hops.
#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)
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
#define vec_free(V)
Free vector's memory (no header).
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)
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.
#define clib_memcpy(a, b, c)
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,...)
A representation of a MAP DPO.
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
void vlib_validate_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
validate a simple counter
#define ip6_frag_hdr_offset(hdr)
int map_ip6_reass_conf_pool_size(u16 pool_size, u32 *trashed_reass, u32 *dropped_packets)
#define u8_ptr_add(ptr, index)
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
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
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)
u16 ip6_reass_conf_lifetime_ms
fib_node_index_t fei
The FIB entry index of the next-hop.
#define map_ip6_reass_lock()
#define MAP_IP4_REASS_POOL_SIZE_DEFAULT
#define MAP_IP6_REASS_CONF_HT_RATIO_MAX
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
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)
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.
static clib_error_t * map_security_check_frag_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define MAP_IP4_REASS_CONF_BUFFERS_MAX
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
u32 md_domain
the MAP domain index
static uword pool_elts(void *v)
Number of active elements in a pool.