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) 94 vl_api_abf_policy_add_del_reply_t *rmp;
130 vl_api_abf_itf_attach_add_del_reply_t *rmp;
167 vl_api_fib_path_t *fp;
175 msg_size =
sizeof (*mp) +
sizeof (mp->
policy.
paths[0]) * n_paths;
233 mp->_vl_msg_id = ntohs (VL_API_ABF_ITF_ATTACH_DETAILS +
abf_base_msg_id);
263 #define vl_msg_name_crc_list 265 #undef vl_msg_name_crc_list 272 vl_msg_api_set_handlers((VL_API_##N + abf_base_msg_id), \ 274 vl_api_##n##_t_handler, \ 276 vl_api_##n##_t_endian, \ 277 vl_api_##n##_t_print, \ 278 sizeof(vl_api_##n##_t), 1); 288 #define _(id,n,crc) \ 289 vl_msg_api_add_msg_name_crc (apim, #n "_" #crc, id + abf_base_msg_id); 290 foreach_vl_msg_name_crc_abf;
319 .version = VPP_BUILD_VER,
320 .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.
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 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.
void fib_api_path_encode(const fib_route_path_t *rpath, vl_api_fib_path_t *out)
static void vl_api_abf_policy_add_del_t_handler(vl_api_abf_policy_add_del_t *mp)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static u32 abf_base_msg_id
Base message ID fot the plugin.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
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]
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
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
int abf_policy_update(u32 policy_id, u32 acl_index, const fib_route_path_t *rpaths)
Create or update an ABF Policy.
vl_api_registration_t * rp
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.
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
fib_node_index_t ap_pl
The path-list describing how to forward in case of a match.
Attachment data for an ABF policy to an interface.
#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)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
u32 aia_prio
The priority of this policy for attachment.
A description of an ABF policy.
An ACL based Forwarding 'policy'.
int fib_api_path_decode(vl_api_fib_path_t *in, fib_route_path_t *out)
void abf_itf_attach_walk(abf_itf_attach_walk_cb_t cb, void *ctx)
Path encode context to use when walking a path-list to encode paths.
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)
vl_api_mfib_path_t paths[n_paths]
u32 ap_acl
ACL index to match.
fib_route_path_t * rpaths
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
import vnet fib fib_types api
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.
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)
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 *args)
u16 vl_msg_api_get_msg_ids(const char *name, int n)