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); 61 #define foreach_svs_plugin_api_msg \ 62 _(SVS_PLUGIN_GET_VERSION, svs_plugin_get_version) \ 63 _(SVS_TABLE_ADD_DEL, svs_table_add_del) \ 64 _(SVS_ROUTE_ADD_DEL, svs_route_add_del) \ 65 _(SVS_ENABLE_DISABLE, svs_enable_disable) \ 72 int msg_size =
sizeof (*rmp);
93 vl_api_svs_table_add_del_reply_t *rmp;
114 vl_api_svs_route_add_del_reply_t *rmp;
136 vl_api_svs_enable_disable_reply_t *rmp;
204 #define vl_msg_name_crc_list 206 #undef vl_msg_name_crc_list 213 vl_msg_api_set_handlers((VL_API_##N + svs_base_msg_id), \ 215 vl_api_##n##_t_handler, \ 217 vl_api_##n##_t_endian, \ 218 vl_api_##n##_t_print, \ 219 sizeof(vl_api_##n##_t), 1); 229 #define _(id,n,crc) \ 230 vl_msg_api_add_msg_name_crc (apim, #n "_" #crc, id + svs_base_msg_id); 231 foreach_vl_msg_name_crc_svs;
260 .version = VPP_BUILD_VER,
261 .description =
"Source Virtual Routing and Fowarding (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.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
int svs_disable(fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
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.
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
fib_protocol_t fib_proto_from_api_address_family(int af)
Aggregate 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.
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
#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)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_registration_t * rp
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)
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.