|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
7 #include <sys/socket.h>
15 #include <vpp/app/version.h>
19 #include <linux-cp/lcp.api_enum.h>
20 #include <linux-cp/lcp.api_types.h>
23 #define REPLY_MSG_ID_BASE lcp_msg_id_base
35 static vl_api_lcp_itf_host_type_t
62 u8 *mp_host_if_name,
size_t sizeof_host_if_name,
63 u8 *mp_namespace,
size_t sizeof_mp_namespace,
64 u32 *host_sw_if_index_p)
66 u8 *host_if_name, *netns;
67 int host_len, netns_len,
rv;
69 host_if_name = netns = 0;
72 host_len =
clib_strnlen ((
char *) mp_host_if_name, sizeof_host_if_name - 1);
73 vec_add (host_if_name, mp_host_if_name, host_len);
76 netns_len =
clib_strnlen ((
char *) mp_namespace, sizeof_mp_namespace - 1);
77 vec_add (netns, mp_namespace, netns_len);
81 netns, host_sw_if_index_p);
93 vl_api_lcp_itf_pair_add_del_reply_t *rmp;
99 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
100 goto bad_sw_if_index;
110 mp->namespace, sizeof (mp->namespace), NULL);
124 u32 phy_sw_if_index, host_sw_if_index = ~0;
131 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
132 goto bad_sw_if_index;
142 sizeof (mp->namespace), &host_sw_if_index);
162 VL_API_LCP_ITF_PAIR_DETAILS, rp,
context, ({
190 vl_api_lcp_default_ns_set_reply_t *rmp;
213 rmp->_vl_msg_id = (VL_API_LCP_DEFAULT_NS_GET_REPLY + lcpm->
msg_id_base);
227 vl_api_lcp_itf_pair_replace_begin_reply_t *rmp;
232 REPLY_MACRO (VL_API_LCP_ITF_PAIR_REPLACE_BEGIN_REPLY);
239 vl_api_lcp_itf_pair_replace_end_reply_t *rmp;
244 REPLY_MACRO (VL_API_LCP_ITF_PAIR_REPLACE_END_REPLY);
250 #include <linux-cp/lcp.api.c>
263 #include <vpp/app/version.h>
265 .version = VPP_BUILD_VER,
266 .description =
"Linux Control Plane - Interface Mirror",
267 .default_disabled = 1,
#define clib_strncpy(d, s, n)
Linux Control Plane interface pair dump response.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
#define REPLY_MACRO2(t, body)
static lip_host_type_t api_decode_host_type(vl_api_lcp_itf_host_type_t type)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
u8 * lcp_get_default_ns(void)
Dump Linux Control Plane interface pair data.
__clib_export errno_t memcpy_s(void *__restrict__ dest, rsize_t dmax, const void *__restrict__ src, rsize_t n)
copy src to dest, at most n bytes, up to dmax
void lcp_set_auto_intf(u8 is_auto)
manage interface auto creation
static vl_api_lcp_itf_host_type_t api_encode_host_type(lip_host_type_t type)
static int vl_api_lcp_itf_pair_add(u32 phy_sw_if_index, lip_host_type_t lip_host_type, u8 *mp_host_if_name, size_t sizeof_host_if_name, u8 *mp_namespace, size_t sizeof_mp_namespace, u32 *host_sw_if_index_p)
static void vl_api_lcp_itf_pair_add_del_t_handler(vl_api_lcp_itf_pair_add_del_t *mp)
vl_api_lcp_itf_host_type_t host_if_type
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
get the default Linux Control Plane namespace
static void vl_api_lcp_itf_pair_get_t_handler(vl_api_lcp_itf_pair_get_t *mp)
lcp_itf_pair_t * lcp_itf_pair_get(u32 index)
Get an interface-pair object from its VPP index.
static void setup_message_id_table(api_main_t *am)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
int lcp_itf_pair_create(u32 phy_sw_if_index, u8 *host_if_name, lip_host_type_t host_if_type, u8 *ns, u32 *host_sw_if_indexp)
Create an interface-pair from PHY sw_if_index and tap name.
Add or delete a Linux Conrol Plane interface pair.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
vl_api_interface_index_t host_sw_if_index
An API client registration, only in vpp/vlib.
static void vl_api_lcp_itf_pair_replace_begin_t_handler(vl_api_lcp_itf_pair_replace_begin_t *mp)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define REPLY_MACRO_DETAILS4(t, rp, context, body)
static clib_error_t * lcp_plugin_api_hookup(vlib_main_t *vm)
int lcp_itf_pair_replace_begin(void)
Begin and End the replace process.
#define REPLY_AND_DETAILS_MACRO(t, p, body)
static void vl_api_lcp_default_ns_set_t_handler(vl_api_lcp_default_ns_set_t *mp)
vl_api_interface_index_t phy_sw_if_index
static void vl_api_lcp_itf_pair_add_del_v2_t_handler(vl_api_lcp_itf_pair_add_del_v2_t *mp)
static void vl_api_lcp_default_ns_get_t_handler(vl_api_lcp_default_ns_get_t *mp)
#define BAD_SW_IF_INDEX_LABEL
lip_host_type_t lip_host_type
static u16 lcp_msg_id_base
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
int lcp_itf_pair_delete(u32 phy_sw_if_index)
Delete a LCP_ITF_PAIR.
#define clib_strnlen(s, m)
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_lcp_itf_pair_replace_end_t_handler(vl_api_lcp_itf_pair_replace_end_t *mp)
#define VLIB_INIT_FUNCTION(x)
vl_api_interface_index_t sw_if_index
get the default Linux Control Plane namespace
vl_api_lcp_itf_host_type_t host_if_type
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
lcp_itf_pair_t * lcp_itf_pair_pool
Pool of LIP objects.
Set the default Linux Control Plane namespace.
static void send_lcp_itf_pair_details(index_t lipi, vl_api_registration_t *rp, u32 context)
vl_api_interface_index_t sw_if_index
vl_api_lcp_itf_host_type_t host_if_type
int lcp_itf_pair_replace_end(void)
int lcp_set_default_ns(u8 *ns)
Get/Set the default namespace for LCP host taps.
vl_api_fib_path_type_t type
vl_api_interface_index_t host_sw_if_index
void * vl_msg_api_alloc(int nbytes)