25 #include <vpp/app/version.h> 36 #include <acl/acl.api_enum.h> 37 #include <acl/acl.api_types.h> 39 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define REPLY_MSG_ID_BASE am->msg_id_base 58 .version = VPP_BUILD_VER,
59 .description =
"Access Control Lists (ACL)",
70 u16 *v = va_arg (*va,
u16 *);
71 char *
fmt = va_arg (*va,
char *);
73 for (i = 0; i <
vec_len (v); i++)
87 int msg_size =
sizeof (*rmp);
116 rmp->
vpe_pid = ntohl (getpid ());
149 s =
format (s,
"permit+reflect");
152 s =
format (s,
"action %d", action);
163 u8 *out0 =
format (0,
"acl-index %u count %u tag {%s}\n", acl_index,
167 for (j = 0; j <
vec_len (acl_rules); j++)
170 out0 =
format (out0,
" %9d: %s ", j, r->
is_ipv6 ?
"ipv6" :
"ipv4");
195 out0 =
format (out0,
"\n");
206 int msg_size =
sizeof (*rmp);
214 memset (rmp, 0, msg_size);
216 ntohs (VL_API_ACL_PLUGIN_GET_CONN_TABLE_MAX_ENTRIES_REPLY +
241 u32 **ppolicy_epoch_by_swi =
257 if (acl_num <
vec_len (*p_swi_vec_by_acl))
292 format (0,
"/acl/%d/matches%c", i, 0);
318 u32 * acl_list_index,
u8 * tag)
328 if (tag_len ==
sizeof (a->
tag))
329 return VNET_API_ERROR_INVALID_VALUE;
332 clib_warning (
"API dbg: acl_add_list index %d tag %s", *acl_list_index,
336 for (i = 0; i <
count; i++)
339 return VNET_API_ERROR_INVALID_SRC_ADDRESS;
341 return VNET_API_ERROR_INVALID_DST_ADDRESS;
344 return VNET_API_ERROR_INVALID_VALUE_2;
347 return VNET_API_ERROR_INVALID_VALUE_2;
350 if (*acl_list_index != ~0)
357 (
"acl-plugin-error: Trying to replace nonexistent ACL %d (tag %s)",
358 *acl_list_index, tag);
359 return VNET_API_ERROR_NO_SUCH_ENTRY;
365 (
"acl-plugin-warning: supplied no rules for ACL %d (tag %s)",
366 *acl_list_index, tag);
373 for (i = 0; i <
count; i++)
378 r->
is_ipv6 = rules[
i].src_prefix.address.af;
383 r->
proto = rules[
i].proto;
392 if (~0 == *acl_list_index)
398 *acl_list_index = a - am->
acls;
402 a = am->
acls + *acl_list_index;
407 a->
rules = acl_new_rules;
408 memcpy (a->
tag, tag, tag_len + 1);
424 if (acl_index <
vec_len (foo_index_vec_by_acl))
442 return VNET_API_ERROR_NO_SUCH_ENTRY;
445 return VNET_API_ERROR_ACL_IN_USE_INBOUND;
447 return VNET_API_ERROR_ACL_IN_USE_OUTBOUND;
450 return VNET_API_ERROR_ACL_IN_USE_BY_LOOKUP_CONTEXT;
470 while ((0ULL == *p64) && ((
u8 *) p64 - p) <
size)
474 return (p64 - (
u64 *) p) / 2;
479 u32 mask_len,
u32 next_table_index,
480 u32 miss_next_index,
u32 * table_index,
486 u32 match = (mask_len / 16) - skip;
487 u8 *skip_mask_ptr = mask + 16 * skip;
488 u32 current_data_flag = 0;
489 int current_data_offset = 0;
495 memory_size, skip, match,
496 next_table_index, miss_next_index,
497 table_index, current_data_flag,
498 current_data_offset, is_add,
510 return vec_len (whitelist) > 0;
531 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
540 sw_if_index, enable_disable, 0, 0);
544 sw_if_index, enable_disable, 0, 0);
550 "acl-plugin-in-nonip-l2", sw_if_index,
551 enable_disable, 0, 0);
567 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
577 sw_if_index, enable_disable, 0, 0);
582 sw_if_index, enable_disable, 0, 0);
587 "acl-plugin-out-nonip-l2", sw_if_index,
588 enable_disable, 0, 0);
607 int is_input,
int enable_disable)
623 u8 is_input,
u32 * vec_acl_list_index,
624 int *may_clear_sessions)
627 uword *seen_acl_bitmap = 0;
628 uword *old_seen_acl_bitmap = 0;
629 uword *change_acl_bitmap = 0;
636 (
"API dbg: acl_interface_set_inout_acl_list: sw_if_index %d is_input %d acl_vec: [%U]",
637 sw_if_index, is_input,
format_vec32, vec_acl_list_index,
"%d");
645 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
651 clib_warning (
"ERROR: ACL %d being applied twice", *pacln);
652 rv = VNET_API_ERROR_ENTRY_ALREADY_EXISTS;
659 u32 **pinout_lc_index_by_sw_if_index =
661 output_lc_index_by_sw_if_index;
663 u32 ***pinout_acl_vec_by_sw_if_index =
665 output_acl_vec_by_sw_if_index;
667 u32 ***pinout_sw_if_index_vec_by_acl =
669 output_sw_if_index_vec_by_acl;
671 vec_validate ((*pinout_acl_vec_by_sw_if_index), sw_if_index);
675 vec_foreach (pacln, (*pinout_acl_vec_by_sw_if_index)[sw_if_index])
677 old_seen_acl_bitmap =
clib_bitmap_set (old_seen_acl_bitmap, *pacln, 1);
683 clib_warning (
"bitmaps: old seen %U new seen %U changed %U",
691 if (acln <
vec_len((*pinout_sw_if_index_vec_by_acl))) {
692 int index =
vec_search((*pinout_sw_if_index_vec_by_acl)[acln], sw_if_index);
693 vec_del1((*pinout_sw_if_index_vec_by_acl)[acln], index);
698 vec_add1((*pinout_sw_if_index_vec_by_acl)[acln], sw_if_index);
703 vec_free ((*pinout_acl_vec_by_sw_if_index)[sw_if_index]);
715 if (may_clear_sessions && *may_clear_sessions
719 *may_clear_sessions = 0;
728 if (
vec_len (vec_acl_list_index) > 0)
735 sw_if_index, is_input);
736 (*pinout_lc_index_by_sw_if_index)[
sw_if_index] = lc_index;
738 acl_plugin.set_acl_vec_for_context (lc_index, vec_acl_list_index);
742 if (~0 != (*pinout_lc_index_by_sw_if_index)[sw_if_index])
745 put_lookup_context_index ((*pinout_lc_index_by_sw_if_index)
747 (*pinout_lc_index_by_sw_if_index)[
sw_if_index] = ~0;
752 vec_len (vec_acl_list_index) > 0);
763 int *may_clear_sessions)
777 int may_clear_sessions = 1;
779 int error_already_applied = is_input ? VNET_API_ERROR_ACL_IN_USE_INBOUND
780 : VNET_API_ERROR_ACL_IN_USE_OUTBOUND;
782 u32 ***pinout_acl_vec_by_sw_if_index =
784 output_acl_vec_by_sw_if_index;
788 vec_validate ((*pinout_acl_vec_by_sw_if_index), sw_if_index);
794 rv = error_already_applied;
798 acl_vec =
vec_dup ((*pinout_acl_vec_by_sw_if_index)[sw_if_index]);
803 if (sw_if_index >=
vec_len (*pinout_acl_vec_by_sw_if_index))
805 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
814 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
818 acl_vec =
vec_dup ((*pinout_acl_vec_by_sw_if_index)[sw_if_index]);
823 &may_clear_sessions);
896 for (i = 0; i <
vec_len (mv); i++)
899 && (0 == memcmp (mv[i].mac_mask, mac_mask, 6)))
914 unsigned int mac_bits_set = 0;
915 unsigned int mac_byte;
917 for (i = 0; i < 6; i++)
920 for (; mac_byte; mac_byte >>= 1)
921 mac_bits_set += mac_byte & 1;
971 return (is_permit == 3);
981 u32 match_type_index;
988 for (i = 0; i < a->
count; i++)
996 match_type_index =
vec_len (mvec);
998 memcpy (mvec[match_type_index].mac_mask,
1016 mvec[match_type_index].
count++;
1024 out_last_table = ~0;
1031 u32 *last_tag_table;
1032 u32 *out_last_tag_table;
1064 for (tags = 2; tags >= 0; tags--)
1068 memcpy (&mask[6], mt->
mac_mask, 6);
1094 memcpy (&mask[l3_offset + 8], mt->
mac_mask, 6);
1097 mask[l3_offset + 14 + i] = 0xff;
1099 mask[l3_offset + 14 + (mt->
prefix_len / 8)] =
1100 0xff - ((1 << (8 - mt->
prefix_len % 8)) - 1);
1102 mask_len = ((l3_offset + 14 + ((mt->
prefix_len + 7) / 8) +
1106 (~0 == last_table) ? 0 : ~0,
1108 last_table = *last_tag_table;
1139 mask_len = ((l3_offset +
1145 out_last_table) ? 0 : ~0,
1146 out_last_tag_table, 1);
1147 out_last_table = *out_last_tag_table;
1160 u32 *last_tag_table;
1161 u32 *out_last_tag_table;
1166 for (tags = 2; tags >= 0; tags--)
1169 memcpy (&mask[6], mt->
mac_mask, 6);
1192 mask[l3_src_offs +
i] = 0xff;
1197 0xff - ((1 << (8 - mt->
prefix_len % 8)) - 1);
1203 mask_len = ((l3_src_offs + ((mt->
prefix_len + 7) / 8) +
1206 (~0 == last_table) ? 0 : ~0,
1208 last_table = *last_tag_table;
1212 for (tags = 2; tags >= 0; tags--)
1216 memcpy (&mask[0], mt->
mac_mask, 6);
1239 mask[l3_dst_offs +
i] = 0xff;
1244 0xff - ((1 << (8 - mt->
prefix_len % 8)) - 1);
1250 mask_len = ((l3_dst_offs + ((mt->
prefix_len + 7) / 8) +
1255 (~0 == out_last_table) ? 0 : ~0,
1256 out_last_tag_table, 1);
1257 out_last_table = *out_last_tag_table;
1270 for (i = 0; i < a->
count; i++)
1284 ASSERT (match_type_index != ~0);
1286 for (tags = 2; tags >= 0; tags--)
1317 mask[eth + 1] = 0xdd;
1323 mask[eth + 1] = 0x00;
1329 i, 0, action, metadata, 1);
1334 if (!is6 && (mvec[match_type_index].arp_table_index != ~0))
1339 for (tags = 2; tags >= 0; tags--)
1370 memcpy (&mask[l3_src_offs + 8], a->
rules[i].
src_mac, 6);
1375 i, 0, action, metadata, 1);
1381 for (tags = 2; tags >= 0; tags--)
1414 mask[eth + 1] = 0xdd;
1421 mask[eth + 1] = 0x00;
1428 i, 0, action, metadata, 1);
1433 if (!is6 && (mvec[match_type_index].out_arp_table_index != ~0))
1435 for (tags = 2; tags >= 0; tags--)
1469 is_permit ? ~0 : 0, i, 0,
1470 action, metadata, 1);
1551 u32 * acl_list_index,
u8 * tag)
1562 if (tag_len ==
sizeof (a->
tag))
1563 return VNET_API_ERROR_INVALID_VALUE;
1565 if (*acl_list_index != ~0)
1572 (
"acl-plugin-error: Trying to replace nonexistent MACIP ACL %d (tag %s)",
1573 *acl_list_index, tag);
1574 return VNET_API_ERROR_NO_SUCH_ENTRY;
1581 (
"acl-plugin-warning: Trying to create empty MACIP ACL (tag %s)",
1585 if (~0 != *acl_list_index)
1591 for (i = 0; i <
count; i++)
1593 r = &acl_new_rules[
i];
1595 r->
is_ipv6 = rules[
i].src_prefix.address.af;
1603 if (~0 == *acl_list_index)
1621 a->
rules = acl_new_rules;
1623 memcpy (a->
tag, tag, tag_len + 1);
1644 u32 macip_acl_index;
1649 return VNET_API_ERROR_NO_SUCH_ENTRY;
1653 if (~0 == macip_acl_index)
1654 return VNET_API_ERROR_NO_SUCH_ENTRY;
1679 u32 macip_acl_index)
1685 return VNET_API_ERROR_NO_SUCH_ENTRY;
1715 return VNET_API_ERROR_NO_SUCH_ENTRY;
1778 if (supplied_len < expected_len)
1780 clib_warning (
"%s: Supplied message length %d is less than expected %d",
1781 where, supplied_len, expected_len);
1799 u64 expected_len =
sizeof (*mp) + acl_count *
sizeof (mp->
r[0]);
1807 rv = VNET_API_ERROR_INVALID_VALUE;
1822 vl_api_acl_del_reply_t *rmp;
1836 vl_api_acl_stats_intf_counters_enable_reply_t *rmp;
1851 vl_api_acl_interface_add_del_reply_t *rmp;
1855 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
1869 vl_api_acl_interface_set_acl_list_reply_t *rmp;
1876 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
1879 int may_clear_sessions = 1;
1880 for (i = 0; i < mp->
count; i++)
1885 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1890 u32 *in_acl_vec = 0;
1891 u32 *out_acl_vec = 0;
1892 for (i = 0; i < mp->
count; i++)
1893 if (i < mp->n_input)
1894 vec_add1 (in_acl_vec, clib_net_to_host_u32 (mp->
acls[i]));
1896 vec_add1 (out_acl_vec, clib_net_to_host_u32 (mp->
acls[i]));
1900 &may_clear_sessions);
1904 &may_clear_sessions);
1910 REPLY_MACRO (VL_API_ACL_INTERFACE_SET_ACL_LIST_REPLY);
1918 &api_rule->src_prefix.address);
1920 &api_rule->dst_prefix.address);
1923 api_rule->proto = r->
proto;
1937 vl_api_acl_rule_t *
rules;
1940 int msg_size =
sizeof (*mp) +
sizeof (mp->
r[0]) *
vec_len (acl_rules);
1950 snprintf ((
char *) mp->
tag, sizeof (mp->
tag),
"%s", acl->
tag);
1953 for (i = 0; i <
vec_len (acl_rules); i++)
2019 count = n_input + n_output;
2021 msg_size =
sizeof (*mp);
2022 msg_size +=
sizeof (mp->
acls[0]) * count;
2034 for (i = 0; i < n_input; i++)
2038 for (i = 0; i < n_output; i++)
2040 mp->
acls[n_input +
i] =
2086 u32 acl_list_index = ~0;
2088 u64 expected_len =
sizeof (*mp) + acl_count *
sizeof (mp->
r[0]);
2096 rv = VNET_API_ERROR_INVALID_VALUE;
2115 u64 expected_len =
sizeof (*mp) + acl_count *
sizeof (mp->
r[0]);
2123 rv = VNET_API_ERROR_INVALID_VALUE;
2138 vl_api_macip_acl_del_reply_t *rmp;
2151 vl_api_macip_acl_interface_add_del_reply_t *rmp;
2157 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
2163 REPLY_MACRO (VL_API_MACIP_ACL_INTERFACE_ADD_DEL_REPLY);
2171 vl_api_macip_acl_rule_t *
rules;
2174 int msg_size =
sizeof (*mp) + (acl ?
sizeof (mp->
r[0]) * acl->
count : 0);
2184 snprintf ((
char *) mp->
tag, sizeof (mp->
tag),
"%s", acl->
tag);
2188 for (i = 0; i < acl->
count; i++)
2195 rules[i].src_mac_mask);
2198 &rules[i].src_prefix.address);
2253 int msg_size =
sizeof (*rmp) +
sizeof (rmp->
acls[0]) * count;
2266 rmp->
count = htonl (count);
2267 for (i = 0; i <
count; i++)
2283 int msg_size =
sizeof (*rmp) +
sizeof (rmp->
acls[0]);
2294 rmp->
acls[0] = htonl (acl_index);
2311 if (sw_if_index == ~0)
2319 macip_acl_by_sw_if_index
2341 vl_api_acl_interface_set_etype_whitelist_reply_t *rmp;
2346 u16 *vec_in = 0, *vec_out = 0;
2349 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
2352 for (i = 0; i < mp->
count; i++)
2354 if (i < mp->n_input)
2362 REPLY_MACRO (VL_API_ACL_INTERFACE_SET_ETYPE_WHITELIST_REPLY);
2377 u16 *whitelist_in = 0;
2378 u16 *whitelist_out = 0;
2388 if ((0 == whitelist_in) && (0 == whitelist_out))
2391 n_input =
vec_len (whitelist_in);
2392 n_output =
vec_len (whitelist_out);
2393 count = n_input + n_output;
2395 msg_size =
sizeof (*mp);
2396 msg_size +=
sizeof (mp->
whitelist[0]) * count;
2408 for (i = 0; i < n_input; i++)
2412 for (i = 0; i < n_output; i++)
2414 mp->
whitelist[n_input +
i] = htons (whitelist_out[i]);
2465 clib_warning (
"Unknown timeout type %d", timeout_type);
2484 if ((eh < 256) && (value < 2))
2501 int may_clear_sessions = 1;
2528 if (
unformat (input,
"skip-ipv6-extension-header %u %u", &eh_val, &val))
2536 if (
unformat (input,
"use-hash-acl-matching %u", &val))
2541 if (
unformat (input,
"l4-match-nonfirst-fragment %u", &val))
2546 if (
unformat (input,
"reclassify-sessions %u", &val))
2551 if (
unformat (input,
"event-trace"))
2556 "expecting trace level, got `%U`",
2570 if (
unformat (input,
"validate %u", &val))
2572 else if (
unformat (input,
"trace %u", &val))
2578 if (
unformat (input,
"validate %u", &val))
2580 else if (
unformat (input,
"trace %u", &val))
2591 if (
unformat (input,
"max-entries"))
2596 "expecting maximum number of entries, got `%U`",
2606 if (
unformat (input,
"hash-table-buckets"))
2611 "expecting maximum number of hash table buckets, got `%U`",
2621 if (
unformat (input,
"hash-table-memory"))
2626 "expecting maximum amount of hash table memory, got `%U`",
2636 if (
unformat (input,
"event-trace"))
2641 "expecting trace level, got `%U`",
2659 if (!
unformat (input,
"%u", &timeout))
2662 "expecting timeout value in seconds, got `%U`",
2678 if (!
unformat (input,
"%u", &timeout))
2681 "expecting timeout value in seconds, got `%U`",
2694 if (!
unformat (input,
"%u", &timeout))
2697 "expecting timeout value in seconds, got `%U`",
2720 u8 *
a = va_arg (*args,
u8 *);
2721 return format (s,
"%02x:%02x:%02x:%02x:%02x:%02x",
2722 a[0], a[1], a[2], a[3], a[4], a[5]);
2730 out =
format (out,
"%s action %d ip %U/%d mac %U mask %U",
2754 "MACIP acl_index: %d, count: %d (true len %d) tag {%s} is free pool slot: %d\n",
2758 " ip4_table_index %d, ip6_table_index %d, l2_table_index %d\n",
2761 " out_ip4_table_index %d, out_ip6_table_index %d, out_l2_table_index %d\n",
2779 is_add = is_input = 1;
2780 acl_index = sw_if_index = ~0;
2791 else if (
unformat (line_input,
"add"))
2793 else if (
unformat (line_input,
"del"))
2795 else if (
unformat (line_input,
"acl %d", &acl_index))
2797 else if (
unformat (line_input,
"input"))
2799 else if (
unformat (line_input,
"output"))
2805 if (~0 == sw_if_index)
2807 if (~0 == acl_index)
2816 #define vec_validate_acl_rules(v, idx) \ 2818 if (vec_len(v) < idx+1) { \ 2819 vec_validate(v, idx); \ 2820 v[idx].is_permit = 0x1; \ 2821 v[idx].srcport_or_icmptype_last = 0xffff; \ 2822 v[idx].dstport_or_icmpcode_last = 0xffff; \ 2831 vl_api_acl_rule_t *
rules = 0;
2834 int n_rules_override = -1;
2839 u32 tcpflags, tcpmask;
2840 u32 src_prefix_length = 0, dst_prefix_length = 0;
2849 if (
unformat (line_input,
"permit+reflect"))
2852 rules[rule_idx].is_permit = 2;
2854 else if (
unformat (line_input,
"permit"))
2857 rules[rule_idx].is_permit = 1;
2859 else if (
unformat (line_input,
"deny"))
2862 rules[rule_idx].is_permit = 0;
2864 else if (
unformat (line_input,
"count %d", &n_rules_override))
2868 else if (
unformat (line_input,
"action %d", &action))
2871 rules[rule_idx].is_permit =
action;
2873 else if (
unformat (line_input,
"src %U/%d",
2875 &src_prefix_length))
2880 rules[rule_idx].src_prefix.address.af =
ADDRESS_IP4;
2881 rules[rule_idx].src_prefix.len = src_prefix_length;
2883 else if (
unformat (line_input,
"dst %U/%d",
2885 &dst_prefix_length))
2890 rules[rule_idx].dst_prefix.address.af =
ADDRESS_IP4;
2891 rules[rule_idx].dst_prefix.len = dst_prefix_length;
2893 else if (
unformat (line_input,
"sport %d-%d", &port1, &port2))
2896 rules[rule_idx].srcport_or_icmptype_first = htons (port1);
2897 rules[rule_idx].srcport_or_icmptype_last = htons (port2);
2899 else if (
unformat (line_input,
"sport %d", &port1))
2902 rules[rule_idx].srcport_or_icmptype_first = htons (port1);
2903 rules[rule_idx].srcport_or_icmptype_last = htons (port1);
2905 else if (
unformat (line_input,
"dport %d-%d", &port1, &port2))
2908 rules[rule_idx].dstport_or_icmpcode_first = htons (port1);
2909 rules[rule_idx].dstport_or_icmpcode_last = htons (port2);
2911 else if (
unformat (line_input,
"dport %d", &port1))
2914 rules[rule_idx].dstport_or_icmpcode_first = htons (port1);
2915 rules[rule_idx].dstport_or_icmpcode_last = htons (port1);
2917 else if (
unformat (line_input,
"tcpflags %d %d", &tcpflags, &tcpmask))
2920 rules[rule_idx].tcp_flags_value = tcpflags;
2921 rules[rule_idx].tcp_flags_mask = tcpmask;
2924 if (
unformat (line_input,
"tcpflags %d mask %d", &tcpflags, &tcpmask))
2927 rules[rule_idx].tcp_flags_value = tcpflags;
2928 rules[rule_idx].tcp_flags_mask = tcpmask;
2930 else if (
unformat (line_input,
"proto %d", &proto))
2933 rules[rule_idx].proto =
proto;
2935 else if (
unformat (line_input,
"tag %s", &tag))
2938 else if (
unformat (line_input,
","))
2974 (void)
unformat (input,
"index %u", &acl_index);
2982 if ((acl_index != ~0) && (acl_index !=
i))
3029 if ((acl_index != ~0) && (acl_index !=
i))
3063 (void)
unformat (input,
"index %u", &acl_index);
3077 (void)
unformat (input,
"index %u", &lc_index);
3091 (void)
unformat (input,
"index %u", &lc_index);
3109 if ((sw_if_index != ~0) && (sw_if_index != swi))
3188 u64 five_tuple[6] = { 0, 0, 0, 0, 0, 0 };
3191 (input,
"%llx %llx %llx %llx %llx %llx", &five_tuple[0], &five_tuple[1],
3192 &five_tuple[2], &five_tuple[3], &five_tuple[4], &five_tuple[5]))
3210 (void)
unformat (input,
"sw_if_index %u", &sw_if_index);
3211 int show_acl =
unformat (input,
"acl");
3212 int detail =
unformat (input,
"detail");
3230 u32 show_session_thread_id,
3231 u32 show_session_session_index)
3244 vlib_cli_output (vm,
"Sessions total: add %lu - del %lu = %lu", n_adds,
3245 n_dels, n_adds - n_dels);
3246 vlib_cli_output (vm,
"Sessions active: add %lu - deact %lu = %lu", n_adds,
3247 n_deact, n_adds - n_deact);
3248 vlib_cli_output (vm,
"Sessions being purged: deact %lu - del %lu = %lu",
3249 n_deact, n_dels, n_deact - n_dels);
3258 if (show_session_thread_id == wk
3262 show_session_session_index);
3267 " info: %016llx %016llx %016llx %016llx %016llx %016llx",
3268 m[0], m[1], m[2], m[3], m[4], m[5]);
3296 u64 n_epoch_changes =
3301 " sw_if_index %d: add %lu - del %lu = %lu; epoch chg: %lu",
3317 head_session_index);
3318 if (~0 != head_session_index)
3361 #define _(cnt, desc) vlib_cli_output(vm, " %20lu: %s", am->cnt, desc); 3367 "Sessions per interval: min %lu max %lu increment: %f ms current: %f ms",
3384 u32 show_bihash_verbose = 0;
3385 u32 show_session_thread_id = ~0;
3386 u32 show_session_session_index = ~0;
3387 (void)
unformat (input,
"thread %u index %u", &show_session_thread_id,
3388 &show_session_session_index);
3389 (void)
unformat (input,
"verbose %u", &show_bihash_verbose);
3392 show_session_session_index);
3406 int show_acl_hash_info = 0;
3407 int show_applied_info = 0;
3408 int show_mask_type = 0;
3409 int show_bihash = 0;
3410 u32 show_bihash_verbose = 0;
3414 show_acl_hash_info = 1;
3417 unformat (input,
"index %u", &acl_index);
3419 else if (
unformat (input,
"applied"))
3421 show_applied_info = 1;
3422 unformat (input,
"lc_index %u", &lc_index);
3431 unformat (input,
"verbose %u", &show_bihash_verbose);
3435 (show_mask_type || show_acl_hash_info || show_applied_info
3440 show_acl_hash_info = 1;
3441 show_applied_info = 1;
3448 if (show_acl_hash_info)
3450 if (show_applied_info)
3471 .path =
"set acl-plugin",
3472 .short_help =
"set acl-plugin session timeout {{udp idle}|tcp {idle|transient}} <seconds>",
3477 .path =
"show acl-plugin acl",
3478 .short_help =
"show acl-plugin acl [index N]",
3483 .path =
"show acl-plugin lookup context",
3484 .short_help =
"show acl-plugin lookup context [index N]",
3489 .path =
"show acl-plugin lookup user",
3490 .short_help =
"show acl-plugin lookup user [index N]",
3495 .path =
"show acl-plugin decode 5tuple",
3496 .short_help =
"show acl-plugin decode 5tuple XXXX XXXX XXXX XXXX XXXX XXXX",
3501 .path =
"show acl-plugin interface",
3502 .short_help =
"show acl-plugin interface [sw_if_index N] [acl]",
3507 .path =
"show acl-plugin memory",
3508 .short_help =
"show acl-plugin memory",
3513 .path =
"show acl-plugin sessions",
3514 .short_help =
"show acl-plugin sessions",
3519 .path =
"show acl-plugin tables",
3520 .short_help =
"show acl-plugin tables [ acl [index N] | applied [ lc_index N ] | mask | hash [verbose N] ]",
3525 .path =
"show acl-plugin macip acl",
3526 .short_help =
"show acl-plugin macip acl [index N]",
3531 .path =
"show acl-plugin macip interface",
3532 .short_help =
"show acl-plugin macip interface",
3537 .path =
"clear acl-plugin sessions",
3538 .short_help =
"clear acl-plugin sessions",
3552 .path =
"set acl-plugin interface",
3553 .short_help =
"set acl-plugin interface <interface> <input|output> <acl INDEX> [del] ",
3574 .path =
"set acl-plugin acl",
3575 .short_help =
"set acl-plugin acl <permit|deny> src <PREFIX> dst <PREFIX> proto X sport X-Y dport X-Y [tag FOO] {use comma separated list for multiple rules}",
3584 u32 conn_table_hash_buckets;
3585 uword conn_table_hash_memory_size;
3586 u32 conn_table_max_entries;
3587 uword main_heap_size;
3588 uword hash_heap_size;
3589 u32 hash_lookup_hash_buckets;
3590 uword hash_lookup_hash_memory;
3591 u32 reclassify_sessions;
3592 u32 use_tuple_merge;
3593 u32 tuple_merge_split_threshold;
3598 (input,
"connection hash buckets %d", &conn_table_hash_buckets))
3603 &conn_table_hash_memory_size))
3605 else if (
unformat (input,
"connection count max %d",
3606 &conn_table_max_entries))
3613 (
"WARNING: ACL heap is now part of the main heap. 'main heap size' is ineffective.");
3619 (
"WARNING: ACL heap is now part of the main heap. 'hash lookup heap size' is ineffective.");
3622 (input,
"hash lookup hash buckets %d", &hash_lookup_hash_buckets))
3627 &hash_lookup_hash_memory))
3629 else if (
unformat (input,
"use tuple merge %d", &use_tuple_merge))
3633 (input,
"tuple merge split threshold %d",
3634 &tuple_merge_split_threshold))
3637 else if (
unformat (input,
"reclassify sessions %d",
3638 &reclassify_sessions))
3652 #include <acl/acl.api.c> 3720 am->fa_cleaner_cnt_delete_by_sw_index = 0;
3721 am->fa_cleaner_cnt_delete_by_sw_index_ok = 0;
3722 am->fa_cleaner_cnt_unknown_event = 0;
3723 am->fa_cleaner_cnt_timer_restarted = 0;
3724 am->fa_cleaner_cnt_wait_with_timeout = 0;
3727 #define _(N, v, s) am->fa_ipv6_known_eh_bitmap = clib_bitmap_set(am->fa_ipv6_known_eh_bitmap, v, 1); 3740 acl_plugin.register_user_module (
"interface ACL",
"sw_if_index",
static void vl_api_acl_stats_intf_counters_enable_t_handler(vl_api_acl_stats_intf_counters_enable_t *mp)
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 * input_policy_epoch_by_sw_if_index
static int acl_api_invalid_prefix(const vl_api_prefix_t *prefix)
u8 * format_vec16(u8 *s, va_list *va)
static int macip_acl_interface_add_acl(acl_main_t *am, u32 sw_if_index, u32 macip_acl_index)
u32 fa_cleaner_node_index
u32 session_timeout_sec[ACL_N_TIMEOUTS]
static clib_error_t * acl_set_aclplugin_interface_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Use acl_interface_set_acl_list instead Append/remove an ACL index to/from the list of ACLs checked fo...
#define vec_foreach_index(var, v)
Iterate over vector indices.
static int macip_acl_interface_add_del_acl(u32 sw_if_index, u8 is_add, u32 acl_list_index)
static void vl_api_acl_plugin_get_conn_table_max_entries_t_handler(vl_api_acl_plugin_get_conn_table_max_entries_t *mp)
static clib_error_t * acl_clear_aclplugin_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static int acl_set_skip_ipv6_eh(u32 eh, u32 value)
vl_api_prefix_t dst_prefix
static clib_error_t * acl_show_aclplugin_lookup_user_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define UDP_SESSION_IDLE_TIMEOUT_SEC
static clib_error_t * acl_init(vlib_main_t *vm)
#define FA_SESSION_BOGUS_INDEX
uword * pending_clear_sw_if_index_bitmap
static void acl_plugin_counter_lock(acl_main_t *am)
void acl_plugin_show_tables_mask_type(void)
vlib_combined_counter_main_t * combined_acl_counters
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
static void vl_api_acl_plugin_get_version_t_handler(vl_api_acl_plugin_get_version_t *mp)
u64 fa_current_cleaner_timer_wait_interval
Set the vector of input/output ACLs checked for an interface.
static u8 * format_acl_action(u8 *s, u8 action)
char * stat_segment_name
Name in stat segment directory.
vl_api_interface_index_t sw_if_index
Set the ethertype whitelists on an interface.
u32 ** input_acl_vec_by_sw_if_index
void acl_plugin_show_tables_applied_info(u32 lc_index)
Dump the list(s) of ACL applied to specific or all interfaces.
vnet_hw_if_output_node_runtime_t * r
vl_api_macip_acl_rule_t r[count]
bool is_add[default=true]
void mac_address_encode(const mac_address_t *in, u8 *out)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static int count_skip(u8 *p, u32 size)
vnet_interface_main_t interface_main
static void vl_api_acl_add_replace_t_handler(vl_api_acl_add_replace_t *mp)
static void vl_api_macip_acl_dump_t_handler(vl_api_macip_acl_dump_t *mp)
#define clib_error(format, args...)
int l4_match_nonfirst_fragment
Control ping from the client to the server response.
#define ACL_FA_CONN_TABLE_DEFAULT_HASH_NUM_BUCKETS
#define ACL_PLUGIN_VERSION_MINOR
static clib_error_t * acl_plugin_config(vlib_main_t *vm, unformat_input_t *input)
#define ACL_PLUGIN_HASH_LOOKUP_HASH_MEMORY
#define REPLY_MACRO2(t, body)
vnet_feature_config_main_t * cm
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_macip_acl_add_t_handler(vl_api_macip_acl_add_t *mp)
static void vl_api_acl_interface_etype_whitelist_dump_t_handler(vl_api_acl_interface_list_dump_t *mp)
Details about ethertype whitelist on a single interface.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
vl_api_interface_index_t sw_if_index
Reply to get connection table max entries.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static u64 clib_cpu_time_now(void)
static void acl_clear_sessions(acl_main_t *am, u32 sw_if_index)
static int get_l3_dst_offset(int is6)
u16 srcport_or_icmptype_last
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
u64 session_timeout[ACL_N_TIMEOUTS]
fa_session_t * fa_sessions_pool
u16 srcport_or_icmptype_first
bool is_add[default=true]
u32 * output_policy_epoch_by_sw_if_index
u32 out_dot1q_table_index
void(* acl_vector_print_func_t)(vlib_main_t *vm, u8 *out0)
unformat_function_t unformat_vnet_sw_interface
static void validate_and_reset_acl_counters(acl_main_t *am, u32 acl_index)
void * vl_msg_api_alloc(int nbytes)
int vnet_classify_add_del_table(vnet_classify_main_t *cm, const u8 *mask, u32 nbuckets, u32 memory_size, u32 skip, u32 match, u32 next_table_index, u32 miss_next_index, u32 *table_index, u8 current_data_flag, i16 current_data_offset, int is_add, int del_chain)
#define pool_len(p)
Number of elements in pool vector.
static u32 macip_find_match_type(macip_match_type_t *mv, u8 *mac_mask, u8 prefix_len, u8 is_ipv6)
vl_api_interface_index_t sw_if_index
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
vlib_log_class_t log_default
Details about one MACIP ACL.
void acl_plugin_lookup_context_notify_acl_change(u32 acl_num)
f64 fa_cleaner_wait_time_increment
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
u32 arp_dot1q_table_index
#define clib_bitmap_validate(v, n_bits)
u32 interface_acl_user_id
u32 ** lc_index_vec_by_acl
uword fa_conn_table_hash_memory_size
u16 dst_port_or_code_last
static int acl_interface_in_enable_disable(acl_main_t *am, u32 sw_if_index, int enable_disable)
static clib_error_t * acl_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
u64 rcvd_session_change_requests
ip46_address_t src_ip_addr
void mv(vnet_classify_table_t *t)
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
#define VLIB_INIT_FUNCTION(x)
static int acl_is_not_defined(acl_main_t *am, u32 acl_list_index)
static clib_error_t * acl_show_aclplugin_acl_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
volatile u32 * acl_counter_lock
u64 fa_conn_table_max_entries
static uword clib_bitmap_is_zero(uword *ai)
predicate function; is an entire bitmap empty?
static int acl_is_used_by(u32 acl_index, u32 **foo_index_vec_by_acl)
int vnet_classify_add_del_session(vnet_classify_main_t *cm, u32 table_index, const u8 *match, u32 hit_next_index, u32 opaque_index, i32 advance, u8 action, u16 metadata, int is_add)
description fragment has unexpected format
u64 cnt_session_timer_restarted
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Add or delete a MACIP ACL to/from interface.
static void increment_policy_epoch(acl_main_t *am, u32 sw_if_index, int is_input)
static clib_error_t * acl_show_aclplugin_interface_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
vnet_main_t * vnet_get_main(void)
#define ACL_FA_CONN_TABLE_DEFAULT_MAX_ENTRIES
uword * in_acl_on_sw_if_index
static void acl_print_acl(vlib_main_t *vm, acl_main_t *am, int acl_index)
u32 acl_index[default=0xffffffff]
u32 out_arp_dot1q_table_index
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(acl_sw_interface_add_del)
static clib_error_t * acl_show_aclplugin_decode_5tuple_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Get Connection table max entries.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
Reply to add/replace MACIP ACL.
static u8 * my_macip_acl_rule_t_pretty_format(u8 *out, va_list *args)
static void clib_spinlock_init(clib_spinlock_t *p)
static clib_error_t * acl_show_aclplugin_memory_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vl_api_interface_index_t sw_if_index
static void acl_plugin_show_interface(acl_main_t *am, u32 sw_if_index, int show_acl, int detail)
Details about a single MACIP ACL contents.
static void acl_set_session_max_entries(u32 value)
Control ping from client to api server request.
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
#define ACL_FA_DEFAULT_CLEANER_WAIT_TIME_INCREMENT
u16 dst_port_or_code_first
#define TCP_SESSION_IDLE_TIMEOUT_SEC
static void warning_acl_print_acl(vlib_main_t *vm, acl_main_t *am, int acl_index)
static void vl_api_acl_dump_t_handler(vl_api_acl_dump_t *mp)
uword * fa_ipv6_known_eh_bitmap
Replace an existing ACL in-place or create a new ACL.
#define ACL_FA_DEFAULT_MIN_DELETED_SESSIONS_PER_INTERVAL
#define pool_put(P, E)
Free an object E in pool P.
#define vec_dup(V)
Return copy of vector (no header, no alignment)
u64 * fa_session_epoch_change_by_sw_if_index
u32 * output_lc_index_by_sw_if_index
Details about a single ACL contents.
static clib_error_t * acl_show_aclplugin_tables_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_CONFIG_FUNCTION(x, n,...)
#define vec_del1(v, i)
Delete the element at index I.
vl_api_acl_rule_t r[count]
static void send_acl_details(acl_main_t *am, vl_api_registration_t *reg, acl_list_t *acl, u32 context)
vl_api_address_union_t src_address
static int get_l3_src_offset(int is6)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
__clib_export u8 * format_bitmap_hex(u8 *s, va_list *args)
Format a bitmap as a string of hex bytes.
int vnet_set_input_acl_intfc(vlib_main_t *vm, u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 l2_table_index, u32 is_add)
static int macip_maybe_apply_unapply_classifier_tables(acl_main_t *am, u32 acl_index, int is_apply)
static void send_acl_interface_etype_whitelist_details(acl_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u32 context)
u32 interface_acl_counters_enabled
int interrupt_is_unwanted
static u8 * my_format_mac_address(u8 *s, va_list *args)
u64 * fa_conn_list_head_expiry_time
u32 out_arp_dot1ad_table_index
u64 * fa_session_adds_by_sw_if_index
#define FA_POLICY_EPOCH_IS_INPUT
u16 src_port_or_type_first
u64 * fa_session_dels_by_sw_if_index
u64 fa_min_deleted_sessions_per_interval
static int match_type_compare(macip_match_type_t *m1, macip_match_type_t *m2)
static void acl_print_acl_x(acl_vector_print_func_t vpr, vlib_main_t *vm, acl_main_t *am, int acl_index)
format_function_t format_ip46_address
void acl_plugin_show_tables_bihash(u32 show_bihash_verbose)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
vl_api_prefix_t src_prefix
union fa_session_t::@16 tcp_flags_seen
vl_api_acl_rule_t r[count]
An API client registration, only in vpp/vlib.
Dump the list(s) of MACIP ACLs applied to specific or all interfaces.
static void setup_message_id_table(api_main_t *am)
static void vl_api_acl_interface_set_etype_whitelist_t_handler(vl_api_acl_interface_set_etype_whitelist_t *mp)
int vnet_l2_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static int match_type_metric(macip_match_type_t *m)
static int macip_acl_del_list(u32 acl_list_index)
Dump one or all defined MACIP ACLs.
static int acl_classify_add_del_table_small(vnet_classify_main_t *cm, u8 *mask, u32 mask_len, u32 next_table_index, u32 miss_next_index, u32 *table_index, int is_add)
int ip_prefix_decode2(const vl_api_prefix_t *in, ip_prefix_t *out)
u64 sent_session_change_requests
static void acl_plugin_show_acl(acl_main_t *am, u32 acl_index)
static uword * clib_bitmap_dup_xor(uword *ai, uword *bi)
Logical operator across two bitmaps which duplicates the first bitmap.
sll srl srl sll sra u16x4 i
u64 fa_session_total_adds
#define vec_free(V)
Free vector's memory (no header).
void acl_fa_enable_disable(u32 sw_if_index, int is_input, int enable_disable)
static int acl_stats_intf_counters_enable_disable(acl_main_t *am, int enable_disable)
Reply to add/replace ACL.
#define clib_warning(format, args...)
vnet_interface_main_t * im
Reply with the vector of MACIP ACLs by sw_if_index.
static void acl_plugin_counter_unlock(acl_main_t *am)
void acl_plugin_show_lookup_user(u32 user_index)
int use_hash_acl_matching
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static clib_error_t * acl_plugin_exports_init(acl_plugin_methods_t *m)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
vl_api_interface_index_t sw_if_index
uword hash_lookup_hash_memory
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define foreach_fa_cleaner_counter
vl_api_macip_acl_rule_t r[count]
u32 acl_index[default=0xffffffff]
static int acl_interface_out_enable_disable(acl_main_t *am, u32 sw_if_index, int enable_disable)
int tuple_merge_split_threshold
vl_api_interface_index_t sw_if_index
vl_api_mac_address_t src_mac
#define VLIB_CLI_COMMAND(x,...)
struct _vnet_classify_main vnet_classify_main_t
vl_api_gbp_rule_t rules[n_rules]
static clib_error_t * acl_show_aclplugin_macip_acl_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define ACL_PLUGIN_HASH_LOOKUP_HASH_BUCKETS
u32 hash_lookup_hash_buckets
vl_api_interface_index_t sw_if_index
static void vl_api_acl_interface_add_del_t_handler(vl_api_acl_interface_add_del_t *mp)
static int macip_acl_interface_del_acl(acl_main_t *am, u32 sw_if_index)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void vl_api_macip_acl_del_t_handler(vl_api_macip_acl_del_t *mp)
#define vec_validate_acl_rules(v, idx)
static int acl_interface_inout_enable_disable(acl_main_t *am, u32 sw_if_index, int is_input, int enable_disable)
u16 src_port_or_type_last
static int macip_create_classify_tables(acl_main_t *am, u32 macip_acl_index)
static void acl_set_timeout_sec(int timeout_type, u32 value)
uword * out_acl_on_sw_if_index
void acl_plugin_show_lookup_context(u32 lc_index)
u32 ** sw_if_index_vec_by_macip_acl
static int macip_permit_also_egress(u8 is_permit)
#define clib_bitmap_free(v)
Free a bitmap.
vnet_classify_main_t vnet_classify_main
static void vl_api_macip_acl_add_replace_t_handler(vl_api_macip_acl_add_replace_t *mp)
Reply to get the plugin version.
static int macip_acl_add_list(u32 count, vl_api_macip_acl_rule_t rules[], u32 *acl_list_index, u8 *tag)
uword * serviced_sw_if_index_bitmap
vl_api_macip_acl_rule_t r[count]
Reply to set the ACL list on an interface.
#define vec_elt(v, i)
Get vector value at index i.
static void macip_acl_print(acl_main_t *am, u32 macip_acl_index)
u32 * macip_acl_by_sw_if_index
Get the vector of MACIP ACL IDs applied to the interfaces.
static void vl_api_acl_interface_list_dump_t_handler(vl_api_acl_interface_list_dump_t *mp)
static void acl_interface_reset_inout_acls(u32 sw_if_index, u8 is_input, int *may_clear_sessions)
static int acl_add_list(u32 count, vl_api_acl_rule_t rules[], u32 *acl_list_index, u8 *tag)
static void print_clib_warning_and_reset(vlib_main_t *vm, u8 *out0)
static int acl_set_etype_whitelists(acl_main_t *am, u32 sw_if_index, u16 *vec_in, u16 *vec_out)
static clib_error_t * acl_set_aclplugin_acl_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 arp_dot1ad_table_index
static void vl_api_acl_del_t_handler(vl_api_acl_del_t *mp)
static void send_macip_acl_details(acl_main_t *am, vl_api_registration_t *reg, macip_acl_list_t *acl, u32 context)
macip_acl_list_t * macip_acls
static clib_error_t * acl_show_aclplugin_sessions_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static acl_plugin_methods_t acl_plugin
static void send_macip_acl_interface_list_details(acl_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u32 acl_index, u32 context)
vl_api_mac_event_action_t action
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Details about a single ACL contents.
static void vl_api_macip_acl_interface_list_dump_t_handler(vl_api_macip_acl_interface_list_dump_t *mp)
vl_api_mac_address_t src_mac_mask
acl_fa_per_worker_data_t * per_worker_data
u64 conn_table_max_entries
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
u16 dstport_or_icmpcode_first
vnet_sw_interface_t * sw_interfaces
int fa_interrupt_generation
u32 ** input_sw_if_index_vec_by_acl
u64 cnt_already_deleted_sessions
char * name
The counter collection's name.
u16 ** output_etype_whitelist_by_sw_if_index
static void vl_api_acl_interface_set_acl_list_t_handler(vl_api_acl_interface_set_acl_list_t *mp)
u64 fa_max_deleted_sessions_per_interval
static clib_error_t * acl_set_aclplugin_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_interface_index_t sw_if_index[default=0xffffffff]
vl_api_interface_index_t sw_if_index
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static void try_increment_acl_policy_epoch(acl_main_t *am, u32 acl_num, int is_input)
static void * clib_mem_alloc_aligned(uword size, uword align)
static int acl_interface_add_del_inout_acl(u32 sw_if_index, u8 is_add, u8 is_input, u32 acl_list_index)
static void policy_notify_acl_change(acl_main_t *am, u32 acl_num)
#define clib_strnlen(s, m)
static vlib_thread_main_t * vlib_get_thread_main()
static void acl_plugin_show_sessions(acl_main_t *am, u32 show_session_thread_id, u32 show_session_session_index)
static void copy_acl_rule_to_api_rule(vl_api_acl_rule_t *api_rule, acl_rule_t *r)
u16 ** input_etype_whitelist_by_sw_if_index
static int verify_message_len(void *mp, u64 expected_len, char *where)
#define vec_foreach(var, vec)
Vector iterator.
clib_spinlock_t pending_session_change_request_lock
u64 fa_session_total_deactivations
static void print_cli_and_reset(vlib_main_t *vm, u8 *out0)
void show_fa_sessions_hash(vlib_main_t *vm, u32 verbose)
u8 * format_acl_plugin_5tuple(u8 *s, va_list *args)
u32 * input_lc_index_by_sw_if_index
u32 vl_msg_api_get_msg_length(void *msg_arg)
u16 dstport_or_icmpcode_last
u32 ** output_sw_if_index_vec_by_acl
#define ACL_PLUGIN_VERSION_MAJOR
static clib_error_t * acl_show_aclplugin_macip_interface_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define FA_POLICY_EPOCH_MASK
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
#define CLIB_CACHE_LINE_BYTES
static int intf_has_etype_whitelist(acl_main_t *am, u32 sw_if_index, int is_input)
void acl_plugin_show_tables_acl_hash_info(u32 acl_index)
#define TM_SPLIT_THRESHOLD
vl_api_interface_index_t sw_if_index
static int acl_interface_set_inout_acl_list(acl_main_t *am, u32 sw_if_index, u8 is_input, u32 *vec_acl_list_index, int *may_clear_sessions)
#define ACL_FA_DEFAULT_MAX_DELETED_SESSIONS_PER_INTERVAL
static void vl_api_acl_plugin_control_ping_t_handler(vl_api_acl_plugin_control_ping_t *mp)
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
int vnet_set_output_acl_intfc(vlib_main_t *vm, u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 l2_table_index, u32 is_add)
u32 ** output_acl_vec_by_sw_if_index
static clib_error_t * acl_show_aclplugin_lookup_context_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 out_dot1ad_table_index
#define TCP_SESSION_TRANSIENT_TIMEOUT_SEC
static void vl_api_macip_acl_interface_add_del_t_handler(vl_api_macip_acl_interface_add_del_t *mp)
u64 current_time_wait_interval
u32 fa_conn_table_hash_num_buckets
#define ACL_FA_CONN_TABLE_DEFAULT_HASH_MEMORY_SIZE
u64 fa_session_total_dels
static int acl_del_list(u32 acl_list_index)
static void send_acl_interface_list_details(acl_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u32 context)
static void macip_destroy_classify_tables(acl_main_t *am, u32 macip_acl_index)
Enable or disable incrementing ACL counters in stats segment by interface processing.
static void vl_api_macip_acl_interface_get_t_handler(vl_api_macip_acl_interface_get_t *mp)
foreach_fa_cleaner_counter vlib_main_t * vlib_main