bond: cli rename
rename "enslave interface <slave> to <BondEthernetx>" to "bond add <BondEthernetx> <slave> "detach interface <slave>" to "bond del <slave>" Change-Id: I1bf8f017517b1f8a823127c7efedd3766e45cd5b Signed-off-by: Steven <sluong@cisco.com>
This commit is contained in:
@ -505,12 +505,10 @@ enslave_interface_command_fn (vlib_main_t * vm, unformat_input_t * input,
|
|||||||
args.group = ~0;
|
args.group = ~0;
|
||||||
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
|
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
|
||||||
{
|
{
|
||||||
if (unformat (line_input, "interface %U",
|
if (unformat (line_input, "%U %U",
|
||||||
|
unformat_vnet_sw_interface, vnm, &args.group,
|
||||||
unformat_vnet_sw_interface, vnm, &args.slave))
|
unformat_vnet_sw_interface, vnm, &args.slave))
|
||||||
;
|
;
|
||||||
else if (unformat (line_input, "to %U", unformat_vnet_sw_interface, vnm,
|
|
||||||
&args.group))
|
|
||||||
;
|
|
||||||
else if (unformat (line_input, "passive"))
|
else if (unformat (line_input, "passive"))
|
||||||
args.is_passive = 1;
|
args.is_passive = 1;
|
||||||
else if (unformat (line_input, "long-timeout"))
|
else if (unformat (line_input, "long-timeout"))
|
||||||
@ -529,7 +527,7 @@ enslave_interface_command_fn (vlib_main_t * vm, unformat_input_t * input,
|
|||||||
if (args.group == ~0)
|
if (args.group == ~0)
|
||||||
return clib_error_return (0, "Missing bond interface");
|
return clib_error_return (0, "Missing bond interface");
|
||||||
if (args.slave == ~0)
|
if (args.slave == ~0)
|
||||||
return clib_error_return (0, "please specify valid interface name");
|
return clib_error_return (0, "please specify valid slave interface name");
|
||||||
|
|
||||||
bond_enslave (vm, &args);
|
bond_enslave (vm, &args);
|
||||||
|
|
||||||
@ -538,8 +536,9 @@ enslave_interface_command_fn (vlib_main_t * vm, unformat_input_t * input,
|
|||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
VLIB_CLI_COMMAND (enslave_interface_command, static) = {
|
VLIB_CLI_COMMAND (enslave_interface_command, static) = {
|
||||||
.path = "enslave",
|
.path = "bond add",
|
||||||
.short_help = "enslave interface <interface> to <BondEthernetx> [passive] [long-timeout]",
|
.short_help = "bond add <BondEthernetx> <slave-interface> "
|
||||||
|
"[passive] [long-timeout]",
|
||||||
.function = enslave_interface_command_fn,
|
.function = enslave_interface_command_fn,
|
||||||
};
|
};
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
@ -576,7 +575,7 @@ detach_interface_command_fn (vlib_main_t * vm, unformat_input_t * input,
|
|||||||
args.slave = ~0;
|
args.slave = ~0;
|
||||||
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
|
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
|
||||||
{
|
{
|
||||||
if (unformat (line_input, "interface %U",
|
if (unformat (line_input, "%U",
|
||||||
unformat_vnet_sw_interface, vnm, &args.slave))
|
unformat_vnet_sw_interface, vnm, &args.slave))
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
@ -591,7 +590,7 @@ detach_interface_command_fn (vlib_main_t * vm, unformat_input_t * input,
|
|||||||
if (args.error)
|
if (args.error)
|
||||||
return args.error;
|
return args.error;
|
||||||
if (args.slave == ~0)
|
if (args.slave == ~0)
|
||||||
return clib_error_return (0, "please specify valid interface name");
|
return clib_error_return (0, "please specify valid slave interface name");
|
||||||
|
|
||||||
bond_detach_slave (vm, &args);
|
bond_detach_slave (vm, &args);
|
||||||
|
|
||||||
@ -600,8 +599,8 @@ detach_interface_command_fn (vlib_main_t * vm, unformat_input_t * input,
|
|||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
VLIB_CLI_COMMAND (detach_interface_command, static) = {
|
VLIB_CLI_COMMAND (detach_interface_command, static) = {
|
||||||
.path = "detach",
|
.path = "bond del",
|
||||||
.short_help = "detach interface <interface>",
|
.short_help = "bond del <slave-interface>",
|
||||||
.function = detach_interface_command_fn,
|
.function = detach_interface_command_fn,
|
||||||
};
|
};
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
Reference in New Issue
Block a user