24 #include <vpp/app/version.h> 31 #include <svs/svs.api_enum.h> 32 #include <svs/svs.api_types.h> 44 int msg_size =
sizeof (*rmp);
65 vl_api_svs_table_add_del_reply_t *rmp;
89 vl_api_svs_route_add_del_reply_t *rmp;
111 vl_api_svs_enable_disable_reply_t *rmp;
182 #include <svs/svs.api.c> 196 .version = VPP_BUILD_VER,
197 .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)
vl_api_address_family_t fib_proto_to_api_address_family(fib_protocol_t fproto)
int svs_disable(fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
vl_api_interface_index_t sw_if_index
int fib_proto_from_api_address_family(vl_api_address_family_t af, fib_protocol_t *out)
void * vl_msg_api_alloc(int nbytes)
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)
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)
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
vl_api_address_family_t af
vl_api_interface_index_t sw_if_index
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...
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...
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
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)
Add a route into the source address matching table.