Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vlib: add description field in plugin registration
[vpp.git]
/
src
/
plugins
/
sixrd
/
sixrd.c
diff --git
a/src/plugins/sixrd/sixrd.c
b/src/plugins/sixrd/sixrd.c
index
71fc181
..
9838752
100644
(file)
--- a/
src/plugins/sixrd/sixrd.c
+++ b/
src/plugins/sixrd/sixrd.c
@@
-192,6
+192,7
@@
sixrd_add_domain_command_fn (vlib_main_t *vm,
u32 num_m_args = 0;
/* Optional arguments */
u32 mtu = 0;
u32 num_m_args = 0;
/* Optional arguments */
u32 mtu = 0;
+ clib_error_t *error = 0;
/* Get a line of input. */
if (!unformat_user(input, unformat_line_input, line_input))
/* Get a line of input. */
if (!unformat_user(input, unformat_line_input, line_input))
@@
-205,19
+206,25
@@
sixrd_add_domain_command_fn (vlib_main_t *vm,
num_m_args++;
else if (unformat(line_input, "mtu %d", &mtu))
num_m_args++;
num_m_args++;
else if (unformat(line_input, "mtu %d", &mtu))
num_m_args++;
- else
- return clib_error_return(0, "unknown input `%U'",
- format_unformat_error, input);
+ else {
+ error = clib_error_return(0, "unknown input `%U'",
+ format_unformat_error, line_input);
+ goto done;
+ }
}
}
- unformat_free(line_input);
- if (num_m_args < 3)
- return clib_error_return(0, "mandatory argument(s) missing");
+ if (num_m_args < 3) {
+ error = clib_error_return(0, "mandatory argument(s) missing");
+ goto done;
+ }
sixrd_create_domain(&ip6_prefix, ip6_prefix_len, &ip4_prefix, ip4_prefix_len,
&ip4_src, &sixrd_domain_index, mtu);
sixrd_create_domain(&ip6_prefix, ip6_prefix_len, &ip4_prefix, ip4_prefix_len,
&ip4_src, &sixrd_domain_index, mtu);
- return 0;
+done:
+ unformat_free (line_input);
+
+ return error;
}
static clib_error_t *
}
static clib_error_t *
@@
-228,6
+235,7
@@
sixrd_del_domain_command_fn (vlib_main_t *vm,
unformat_input_t _line_input, *line_input = &_line_input;
u32 num_m_args = 0;
u32 sixrd_domain_index;
unformat_input_t _line_input, *line_input = &_line_input;
u32 num_m_args = 0;
u32 sixrd_domain_index;
+ clib_error_t *error = 0;
/* Get a line of input. */
if (! unformat_user(input, unformat_line_input, line_input))
/* Get a line of input. */
if (! unformat_user(input, unformat_line_input, line_input))
@@
-236,18
+244,24
@@
sixrd_del_domain_command_fn (vlib_main_t *vm,
while (unformat_check_input(line_input) != UNFORMAT_END_OF_INPUT) {
if (unformat(line_input, "index %d", &sixrd_domain_index))
num_m_args++;
while (unformat_check_input(line_input) != UNFORMAT_END_OF_INPUT) {
if (unformat(line_input, "index %d", &sixrd_domain_index))
num_m_args++;
- else
- return clib_error_return(0, "unknown input `%U'",
- format_unformat_error, input);
+ else {
+ error = clib_error_return(0, "unknown input `%U'",
+ format_unformat_error, line_input);
+ goto done;
+ }
}
}
- unformat_free(line_input);
- if (num_m_args != 1)
- return clib_error_return(0, "mandatory argument(s) missing");
+ if (num_m_args != 1) {
+ error = clib_error_return(0, "mandatory argument(s) missing");
+ goto done;
+ }
sixrd_delete_domain(sixrd_domain_index);
sixrd_delete_domain(sixrd_domain_index);
- return 0;
+done:
+ unformat_free (line_input);
+
+ return error;
}
static u8 *
}
static u8 *
@@
-342,8
+356,9
@@
VLIB_CLI_COMMAND(show_sixrd_stats_command, static) = {
};
/* *INDENT-OFF* */
};
/* *INDENT-OFF* */
-VLIB_PLUGIN_REGISTER () =
{
+VLIB_PLUGIN_REGISTER () ={
.version = VPP_BUILD_VER,
.version = VPP_BUILD_VER,
+ .description = "IPv6 Rapid Deployment on IPv4 Infrastructure (RFC5969)",
};
/* *INDENT-ON* */
};
/* *INDENT-ON* */