18 #include <sys/socket.h> 26 #include <vpp/app/version.h> 47 host_if_name = ns = NULL;
52 if (
unformat (line_input,
"%d", &sw_if_index))
57 else if (
unformat (line_input,
"host-if %s", &host_if_name))
59 else if (
unformat (line_input,
"netns %s", &ns))
61 else if (
unformat (line_input,
"tun"))
81 if (sw_if_index == ~0)
93 0,
"Namespace name should be fewer than %d characters",
LCP_NS_LEN);
108 .path =
"lcp create",
109 .short_help =
"lcp create <sw_if_index>|<if-name> host-if <host-if-name> " 110 "netns <namespace> [tun]",
129 if (
unformat (line_input,
"netns %s", &ns))
131 else if (
unformat (line_input,
"clear netns"))
148 .path =
"lcp default",
149 .short_help =
"lcp default netns [<namespace>]",
169 if (
unformat (line_input,
"%d", &sw_if_index))
181 if (sw_if_index == ~0)
192 .path =
"lcp delete",
193 .short_help =
"lcp delete <sw_if_index>|<if-name>",
204 phy_sw_if_index = ~0;
224 .short_help =
"show lcp [phy <interface>]",
vnet_hw_if_output_node_runtime_t * r
int lcp_set_default_ns(u8 *ns)
Get/Set the default namespace for LCP host taps.
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * lcp_itf_pair_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
vnet_main_t * vnet_get_main(void)
vl_api_interface_index_t sw_if_index
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.
clib_error_t * lcp_cli_init(vlib_main_t *vm)
int lcp_itf_pair_delete(u32 phy_sw_if_index)
Delete a LCP_ITF_PAIR.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define vec_free(V)
Free vector's memory (no header).
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * lcp_itf_pair_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lcp_itf_pair_show_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void lcp_itf_pair_show(u32 phy_sw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static clib_error_t * lcp_default_netns_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)