24 #include <vpp/app/version.h> 43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 49 #define vl_api_version(n,v) static u32 api_version=(v); 62 #define foreach_svs_plugin_api_msg \ 63 _(SVS_PLUGIN_GET_VERSION, svs_plugin_get_version) \ 64 _(SVS_TABLE_ADD_DEL, svs_table_add_del) \ 65 _(SVS_ROUTE_ADD_DEL, svs_route_add_del) \ 66 _(SVS_ENABLE_DISABLE, svs_enable_disable) \ 73 int msg_size =
sizeof (*rmp);
96 vl_api_svs_table_add_del_reply_t *rmp;
117 vl_api_svs_route_add_del_reply_t *rmp;
139 vl_api_svs_enable_disable_reply_t *rmp;
209 #define vl_msg_name_crc_list 211 #undef vl_msg_name_crc_list 218 vl_msg_api_set_handlers((VL_API_##N + svs_base_msg_id), \ 220 vl_api_##n##_t_handler, \ 222 vl_api_##n##_t_endian, \ 223 vl_api_##n##_t_print, \ 224 sizeof(vl_api_##n##_t), 1); 234 #define _(id,n,crc) \ 235 vl_msg_api_add_msg_name_crc (apim, #n "_" #crc, id + svs_base_msg_id); 236 foreach_vl_msg_name_crc_svs;
265 .version = VPP_BUILD_VER,
266 .description =
"Source VRF Select",
#define SVS_PLUGIN_VERSION_MINOR
vl_api_address_family_t af
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
int svs_route_delete(u32 table_id, const fib_prefix_t *pfx)
static void vl_api_svs_dump_t_handler(vl_api_svs_dump_t *mp)
struct svs_dump_walk_ctx_t_ svs_dump_walk_ctx_t
SVS table-id to interface mapping.
int svs_disable(fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
void * vl_msg_api_alloc(int nbytes)
#define foreach_svs_plugin_api_msg
Dump the SVS table mappings of table_id to interface To see the routes added to a given table use ip_...
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
enum walk_rc_t_ walk_rc_t
Walk return code.
Add a table in which to add routes that will match against source addresses.
#define VLIB_INIT_FUNCTION(x)
fib_protocol_t fib_proto_from_api_address_family(int af)
svm_queue_t unix_shared_memory_queue_t
Aggregrate type for a prefix.
int svs_enable(fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
static void vl_api_svs_route_add_del_t_handler(vl_api_svs_route_add_del_t *mp)
int svs_table_delete(fib_protocol_t fproto, u32 table_id)
static void vl_api_svs_enable_disable_t_handler(vl_api_svs_enable_disable_t *mp)
int fib_proto_to_api_address_family(fib_protocol_t fproto)
static clib_error_t * svs_plugin_api_hookup(vlib_main_t *vm)
API main structure, used by both vpp and binary API clients.
#define BAD_SW_IF_INDEX_LABEL
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
svm_queue_t * vl_api_client_index_to_input_queue(u32 index)
#define vec_free(V)
Free vector's memory (no header).
vl_api_address_family_t af
static walk_rc_t svs_send_details(fib_protocol_t fproto, u32 table_id, u32 sw_if_index, void *args)
Reply to get the plugin version.
static u32 svs_base_msg_id
Base message ID fot the plugin.
void svs_walk(svs_walk_fn_t fn, void *ctx)
unix_shared_memory_queue_t * q
static void vl_api_svs_plugin_get_version_t_handler(vl_api_svs_plugin_get_version_t *mp)
int svs_table_add(fib_protocol_t fproto, u32 table_id)
#define SVS_PLUGIN_VERSION_MAJOR
Source VRF Selection matches against a packet's source address to set the VRF in which the subsequnet...
static void setup_message_id_table(api_main_t *apim)
brief Get the plugin version
int svs_route_add(u32 table_id, const fib_prefix_t *pfx, u32 source_table_id)
Enable SVS on a given interface by using the given table to match RX'd packets' source addresses...
vl_api_address_family_t af
static clib_error_t * svs_api_init(vlib_main_t *vm)
static void vl_api_svs_table_add_del_t_handler(vl_api_svs_table_add_del_t *mp)
#define VALIDATE_SW_IF_INDEX(mp)
u16 vl_msg_api_get_msg_ids(const char *name, int n)
Add a route into the source address matching table.