Restore the plugin to its original state

When I started in my copy, I removed a bunch of code and options that I
felt were distracting. I also renamed lots of elements like 'linux-cp'
and 'Linux CP' and 'Linux-CP' to just be 'lcpng'.

Now, rename all of this back, and make it ready for upstreaming.

The only diffs between my repo and upstream now are the includes and the
lcpng_interface.[ch] code changes, which is good.
This commit is contained in:
Pim van Pelt
2021-08-12 21:18:44 +02:00
parent a6e71359c5
commit 97b9894dce
8 changed files with 128 additions and 89 deletions

View File

@ -99,18 +99,57 @@ lcp_itf_pair_create_command_fn (vlib_main_t *vm, unformat_input_t *input,
vec_free (ns);
if (r)
return clib_error_return (0, "lcpng pair creation failed (%d)", r);
return clib_error_return (0, "lcp pair creation failed (%d)", r);
return 0;
}
VLIB_CLI_COMMAND (lcp_itf_pair_create_command, static) = {
.path = "lcpng create",
.short_help = "lcpng create <sw_if_index>|<if-name> host-if <host-if-name> "
.path = "lcp create",
.short_help = "lcp create <sw_if_index>|<if-name> host-if <host-if-name> "
"netns <namespace> [tun]",
.function = lcp_itf_pair_create_command_fn,
};
static clib_error_t *
lcp_default_netns_command_fn (vlib_main_t *vm, unformat_input_t *input,
vlib_cli_command_t *cmd)
{
unformat_input_t _line_input, *line_input = &_line_input;
u8 *ns;
int r;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
ns = 0;
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "netns %s", &ns))
;
else if (unformat (line_input, "clear netns"))
;
}
unformat_free (line_input);
vlib_cli_output (vm, "lcp set default netns '%s'\n", (char *) ns);
r = lcp_set_default_ns (ns);
if (r)
return clib_error_return (0, "linux-cp set default netns failed (%d)", r);
return 0;
}
VLIB_CLI_COMMAND (lcp_default_netns_command, static) = {
.path = "lcp default",
.short_help = "lcp default netns [<namespace>]",
.function = lcp_default_netns_command_fn,
};
static clib_error_t *
lcp_itf_pair_delete_command_fn (vlib_main_t *vm, unformat_input_t *input,
vlib_cli_command_t *cmd)
@ -145,13 +184,13 @@ lcp_itf_pair_delete_command_fn (vlib_main_t *vm, unformat_input_t *input,
r = lcp_itf_pair_delete (sw_if_index);
if (r)
return clib_error_return (0, "lcpng pair deletion failed (%d)", r);
return clib_error_return (0, "lcp pair deletion failed (%d)", r);
return 0;
}
VLIB_CLI_COMMAND (lcp_itf_pair_delete_command, static) = {
.path = "lcpng delete",
.short_help = "lcpng delete <sw_if_index>|<if-name>",
.path = "lcp delete",
.short_help = "lcp delete <sw_if_index>|<if-name>",
.function = lcp_itf_pair_delete_command_fn,
};
@ -180,9 +219,9 @@ lcp_itf_pair_show_cmd (vlib_main_t *vm, unformat_input_t *input,
}
VLIB_CLI_COMMAND (lcp_itf_pair_show_cmd_node, static) = {
.path = "show lcpng",
.path = "show lcp",
.function = lcp_itf_pair_show_cmd,
.short_help = "show lcpng [phy <interface>]",
.short_help = "show lcp [phy <interface>]",
.is_mp_safe = 1,
};