26 #include <vpp/app/version.h> 45 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 51 #define vl_api_version(n,v) static u32 api_version=(v); 64 #define foreach_abf_plugin_api_msg \ 65 _(ABF_PLUGIN_GET_VERSION, abf_plugin_get_version) \ 66 _(ABF_POLICY_ADD_DEL, abf_policy_add_del) \ 67 _(ABF_POLICY_DUMP, abf_policy_dump) \ 68 _(ABF_ITF_ATTACH_ADD_DEL, abf_itf_attach_add_del) \ 69 _(ABF_ITF_ATTACH_DUMP, abf_itf_attach_dump) 75 int msg_size =
sizeof (*rmp);
98 vl_api_abf_policy_add_del_reply_t *rmp;
134 vl_api_abf_itf_attach_add_del_reply_t *rmp;
176 msg_size =
sizeof (*mp) +
sizeof (mp->
policy.
paths[0]) * n_paths;
234 mp->_vl_msg_id = ntohs (VL_API_ABF_ITF_ATTACH_DETAILS +
abf_base_msg_id);
266 #define vl_msg_name_crc_list 268 #undef vl_msg_name_crc_list 275 vl_msg_api_set_handlers((VL_API_##N + abf_base_msg_id), \ 277 vl_api_##n##_t_handler, \ 279 vl_api_##n##_t_endian, \ 280 vl_api_##n##_t_print, \ 281 sizeof(vl_api_##n##_t), 1); 291 #define _(id,n,crc) \ 292 vl_msg_api_add_msg_name_crc (apim, #n "_" #crc, id + abf_base_msg_id); 293 foreach_vl_msg_name_crc_abf;
322 .version = VPP_BUILD_VER,
323 .description =
"Access Control List (ACL) Based Forwarding",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Add or delete a policy attachment to an interface.
import vnet fib fib_types api
fib_protocol_t aia_proto
The protocol for the attachment.
struct abf_dump_walk_ctx_t_ abf_dump_walk_ctx_t
A representation of a fib path for fib_path_encode to convey the information to the caller...
A representation of a path as described by a route producer.
vl_api_abf_policy_t policy
u32 ap_id
The policy ID - as configured by the client.
abf_policy_t * abf_policy_get(u32 index)
Get an ABF object from its VPP index.
static void vl_api_abf_policy_add_del_t_handler(vl_api_abf_policy_add_del_t *mp)
static u32 abf_base_msg_id
Base message ID fot the plugin.
static void vl_api_abf_policy_dump_t_handler(vl_api_abf_policy_dump_t *mp)
int abf_itf_detach(fib_protocol_t fproto, u32 policy_id, u32 sw_if_index)
vl_api_fib_path_t paths[n_paths]
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
void * vl_msg_api_alloc(int nbytes)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
Policy description returned in the dump.
u32 aia_abf
The VPP index of the ABF policy.
Attachment details from a dump.
static int abf_policy_send_details(u32 api, void *args)
static clib_error_t * abf_api_init(vlib_main_t *vm)
static int abf_itf_attach_send_details(u32 aiai, void *args)
#define VLIB_INIT_FUNCTION(x)
vl_api_abf_itf_attach_t attach
svm_queue_t unix_shared_memory_queue_t
static abf_itf_attach_t * abf_itf_attach_get(u32 index)
static void vl_api_abf_itf_attach_dump_t_handler(vl_api_abf_itf_attach_dump_t *mp)
static void vl_api_abf_plugin_get_version_t_handler(vl_api_abf_plugin_get_version_t *mp)
#define ABF_PLUGIN_VERSION_MAJOR
void abf_policy_update(u32 policy_id, u32 acl_index, const fib_route_path_t *rpaths)
Create or update an ABF Policy.
u32 aia_sw_if_index
The interface for the attachment.
void abf_policy_walk(abf_policy_walk_cb_t cb, void *ctx)
Walk/visit each of the ABF policies.
unix_shared_memory_queue_t * q
API main structure, used by both vpp and binary API clients.
fib_node_index_t ap_pl
The path-list describing how to forward in case of a match.
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
Attachment data for an ABF policy to an interface.
svm_queue_t * vl_api_client_index_to_input_queue(u32 index)
#define vec_free(V)
Free vector's memory (no header).
vl_api_abf_policy_t policy
u32 fib_path_list_get_n_paths(fib_node_index_t path_list_index)
u32 aia_prio
The priority of this policy for attachment.
A description of an ABF policy.
An ACL based Forwarding 'policy'.
void abf_itf_attach_walk(abf_itf_attach_walk_cb_t cb, void *ctx)
int abf_itf_attach(fib_protocol_t fproto, u32 policy_id, u32 priority, u32 sw_if_index)
#define foreach_abf_plugin_api_msg
static void vl_api_abf_itf_attach_add_del_t_handler(vl_api_abf_itf_attach_add_del_t *mp)
void fib_api_path_encode(const fib_route_path_encode_t *api_rpath, vl_api_fib_path_t *out)
u32 ap_acl
ACL index to match.
Dump all the policy attachments.
static clib_error_t * abf_plugin_api_hookup(vlib_main_t *vm)
Reply to get the plugin version.
#define ABF_PLUGIN_VERSION_MINOR
int fib_path_api_parse(const vl_api_fib_path_t *in, fib_route_path_t *out)
int abf_policy_delete(u32 policy_id, const fib_route_path_t *rpaths)
Delete paths from an ABF Policy.
#define vec_foreach(var, vec)
Vector iterator.
fib_path_list_walk_rc_t fib_path_encode(fib_node_index_t path_list_index, fib_node_index_t path_index, const fib_path_ext_t *path_ext, void *ctx)
void fib_path_list_walk_w_ext(fib_node_index_t path_list_index, const fib_path_ext_list_t *ext_list, fib_path_list_walk_w_ext_fn_t func, void *ctx)
vl_api_abf_itf_attach_t attach
static void setup_message_id_table(api_main_t *apim)
u16 vl_msg_api_get_msg_ids(const char *name, int n)