16 #ifndef included_manual_fns_h 17 #define included_manual_fns_h 24 #include <acl/acl_types.api.h> 30 vl_print (handle, (char *)s); \ 37 for(i=0; i<
count; i++) {
38 vl_api_acl_rule_t_endian (&rules[i]);
46 for(i=0; i<
count; i++) {
47 vl_api_macip_acl_rule_t_endian (&rules[i]);
54 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
65 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
77 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
89 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
100 a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
120 s =
format (s,
"permit+reflect");
123 s =
format (s,
"action %d", action);
137 s =
format (0,
" %s ", a->src_prefix.address.af ?
"ipv6" :
"ipv4");
141 s =
format (s,
" src %U dst %U \\\n",
144 s =
format (s,
" proto %d \\\n", a->proto);
145 s =
format (s,
" sport %d-%d dport %d-%d \\\n",
146 clib_net_to_host_u16 (a->srcport_or_icmptype_first),
147 clib_net_to_host_u16 (a->srcport_or_icmptype_last),
148 clib_net_to_host_u16 (a->dstport_or_icmpcode_first),
149 clib_net_to_host_u16 (a->dstport_or_icmpcode_last));
151 s =
format (s,
" tcpflags %u mask %u, \\",
152 a->tcp_flags_value, a->tcp_flags_mask);
165 s =
format (0,
" %s %s \\\n", a->src_prefix.address.af ?
"ipv6" :
"ipv4",
166 a->is_permit ?
"permit" :
"deny");
168 s =
format (s,
" src mac %U mask %U \\\n",
172 s =
format (s,
" src ip %U, \\",
186 if (count > 0x100000)
188 s =
format (s,
"WARN: acl_add_replace count endianness wrong? Fixup to avoid long loop.\n");
192 s =
format (s,
"SCRIPT: acl_add_replace %d count %d ",
201 for (i = 0; i <
count; i++)
214 s =
format (0,
"SCRIPT: acl_del %d ",
229 if (count > 0x100000)
231 s =
format (s,
"WARN: acl_details count endianness wrong? Fixup to avoid long loop.\n");
235 s =
format (s,
"acl_details index %d count %d ",
244 for (i = 0; i <
count; i++)
258 if (count > 0x100000)
260 s =
format (s,
"WARN: macip_acl_details count endianness wrong? Fixup to avoid long loop.\n");
264 s =
format (s,
"macip_acl_details index %d count %d ",
273 for (i = 0; i <
count; i++)
285 if (count > 0x100000)
287 s =
format (s,
"WARN: macip_acl_add count endianness wrong? Fixup to avoid long loop.\n");
291 s =
format (s,
"SCRIPT: macip_acl_add ");
295 s =
format (s,
"count %d \\\n", count);
299 for (i = 0; i <
count; i++)
315 if (count > 0x100000)
317 s =
format (s,
"WARN: macip_acl_add_replace count endianness wrong? Fixup to avoid long loop.\n");
321 s =
format (s,
"SCRIPT: macip_acl_add_replace %d count %d ",
326 s =
format (s,
"count %d \\\n", count);
330 for (i = 0; i <
count; i++)
347 (0,
"SCRIPT: acl_interface_set_acl_list sw_if_index %d count %d\n",
350 s =
format (s,
" input ");
352 for (i = 0; i < a->
count; i++)
355 s =
format (s,
"output ");
356 s =
format (s,
"%d ", clib_net_to_host_u32 (a->
acls[i]));
371 (0,
"SCRIPT: acl_interface_set_etype_whitelist sw_if_index %d count %d\n",
374 s =
format (s,
" input ");
376 for (i = 0; i < a->
count; i++)
379 s =
format (s,
"output ");
393 s =
format (0,
"SCRIPT: acl_interface_add_del sw_if_index %d acl %d ",
410 "SCRIPT: macip_acl_interface_add_del sw_if_index %d acl_index %d ",
425 s =
format (0,
"SCRIPT: macip_acl_del %d ",
static void * vl_api_macip_acl_interface_add_del_t_print(vl_api_macip_acl_interface_add_del_t *a, void *handle)
Use acl_interface_set_acl_list instead Append/remove an ACL index to/from the list of ACLs checked fo...
Set the vector of input/output ACLs checked for an interface.
Set the ethertype whitelists on an interface.
vl_api_macip_acl_rule_t r[count]
bool is_add[default=true]
static void * vl_api_acl_details_t_print(vl_api_acl_details_t *a, void *handle)
bool is_add[default=true]
vl_api_interface_index_t sw_if_index
static void vl_api_macip_acl_add_replace_t_endian(vl_api_macip_acl_add_replace_t *a)
Details about one MACIP ACL.
u8 * format_ethernet_address(u8 *s, va_list *args)
static void * vl_api_acl_interface_set_acl_list_t_print(vl_api_acl_interface_set_acl_list_t *a, void *handle)
Add or delete a MACIP ACL to/from interface.
static u8 * format_acl_action(u8 *s, u8 action)
u32 acl_index[default=0xffffffff]
static void vl_api_macip_acl_rule_t_array_endian(vl_api_macip_acl_rule_t *rules, u32 count)
static void * vl_api_acl_interface_add_del_t_print(vl_api_acl_interface_add_del_t *a, void *handle)
static void * vl_api_macip_acl_rule_t_print(vl_api_macip_acl_rule_t *a, void *handle)
static void * vl_api_macip_acl_add_replace_t_print(vl_api_macip_acl_add_replace_t *a, void *handle)
Replace an existing ACL in-place or create a new ACL.
vl_api_acl_rule_t r[count]
static void vl_api_acl_add_replace_t_endian(vl_api_acl_add_replace_t *a)
static void * vl_api_macip_acl_add_t_print(vl_api_macip_acl_add_t *a, void *handle)
vl_api_acl_rule_t r[count]
int ip_prefix_decode2(const vl_api_prefix_t *in, ip_prefix_t *out)
u8 * format_ip_prefix(u8 *s, va_list *args)
sll srl srl sll sra u16x4 i
vl_api_interface_index_t sw_if_index
vl_api_macip_acl_rule_t r[count]
static void * vl_api_acl_rule_t_print(vl_api_acl_rule_t *a, void *handle)
vl_api_interface_index_t sw_if_index
static void * vl_api_acl_add_replace_t_print(vl_api_acl_add_replace_t *a, void *handle)
vl_api_gbp_rule_t rules[n_rules]
static void vl_api_macip_acl_details_t_endian(vl_api_macip_acl_details_t *a)
static void vl_api_macip_acl_add_t_endian(vl_api_macip_acl_add_t *a)
vl_api_macip_acl_rule_t r[count]
static void * vl_api_acl_interface_set_etype_whitelist_t_print(vl_api_acl_interface_set_etype_whitelist_t *a, void *handle)
vl_api_mac_event_action_t action
Details about a single ACL contents.
vl_api_interface_index_t sw_if_index
static void * vl_api_macip_acl_details_t_print(vl_api_macip_acl_details_t *a, void *handle)
static void * vl_api_acl_del_t_print(vl_api_macip_acl_del_t *a, void *handle)
static void vl_api_acl_rule_t_array_endian(vl_api_acl_rule_t *rules, u32 count)
static void * vl_api_macip_acl_del_t_print(vl_api_macip_acl_del_t *a, void *handle)
static void vl_api_acl_details_t_endian(vl_api_acl_details_t *a)