25 #include <vpp/app/version.h> 44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 63 #define foreach_l3xc_plugin_api_msg \ 64 _(L3XC_PLUGIN_GET_VERSION, l3xc_plugin_get_version) \ 65 _(L3XC_UPDATE, l3xc_update) \ 66 _(L3XC_DEL, l3xc_del) \ 67 _(L3XC_DUMP, l3xc_dump) 102 rv = VNET_API_ERROR_INVALID_VALUE;
137 vl_api_l3xc_del_reply_t *rmp;
164 vl_api_fib_path_t *fp;
172 msg_size =
sizeof (*mp) +
sizeof (mp->
l3xc.
paths[0]) * n_paths;
214 if (~0 == sw_if_index)
231 #define vl_msg_name_crc_list 233 #undef vl_msg_name_crc_list 240 vl_msg_api_set_handlers((VL_API_##N + l3xc_base_msg_id), \ 242 vl_api_##n##_t_handler, \ 244 vl_api_##n##_t_endian, \ 245 vl_api_##n##_t_print, \ 246 sizeof(vl_api_##n##_t), 1); 256 #define _(id,n,crc) \ 257 vl_msg_api_add_msg_name_crc (apim, #n "_" #crc, id + l3xc_base_msg_id); 258 foreach_vl_msg_name_crc_l3xc;
287 .version = VPP_BUILD_VER,
288 .description =
"L3 Cross-Connect (L3XC)",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define L3XC_PLUGIN_VERSION_MAJOR
A L3 cross connect will send all traffic that is received on the input interface to the [set of] path...
Reply to get the plugin version.
A representation of a path as described by a route producer.
void fib_api_path_encode(const fib_route_path_t *rpath, vl_api_fib_path_t *out)
#define REPLY_MACRO2(t, body)
static void vl_api_l3xc_plugin_get_version_t_handler(vl_api_l3xc_plugin_get_version_t *mp)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
int l3xc_delete(u32 sw_if_index, u8 is_ip6)
Delete an L3XC.
void * vl_msg_api_alloc(int nbytes)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static clib_error_t * l3xc_plugin_api_hookup(vlib_main_t *vm)
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
static_always_inline l3xc_t * l3xc_get(u32 index)
int l3xc_update(u32 sw_if_index, u8 is_ip6, const fib_route_path_t *rpaths)
Create or update an L3XC Policy.
static clib_error_t * l3xc_api_init(vlib_main_t *vm)
#define L3XC_PLUGIN_VERSION_MINOR
u32 l3xc_sw_if_index
The input interface.
#define foreach_l3xc_plugin_api_msg
vl_api_fib_path_t paths[n_paths]
API main structure, used by both vpp and binary API clients.
static void vl_api_l3xc_update_t_handler(vl_api_l3xc_update_t *mp)
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_l3xc_dump_t_handler(vl_api_l3xc_dump_t *mp)
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)
void l3xc_walk(l3xc_walk_cb_t cb, void *ctx)
Walk/visit each of the L3XC policies.
static int l3xc_send_details(u32 l3xci, void *args)
static u32 l3xc_base_msg_id
Base message ID fot the plugin.
index_t l3xc_find(u32 sw_if_index, fib_protocol_t fproto)
Find a L3 XC object from an interfce and FIB protocol.
int fib_api_path_decode(vl_api_fib_path_t *in, fib_route_path_t *out)
Path encode context to use when walking a path-list to encode paths.
vl_api_mfib_path_t paths[n_paths]
fib_route_path_t * rpaths
static void setup_message_id_table(api_main_t *apim)
struct l3xc_dump_walk_ctx_t_ l3xc_dump_walk_ctx_t
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vl_api_registration_t * rp
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
static void vl_api_l3xc_del_t_handler(vl_api_l3xc_del_t *mp)
#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)
description returned in the dump
fib_node_index_t l3xc_pl
The path-list describing how to forward in case of a match.
#define VALIDATE_SW_IF_INDEX(mp)
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)