I find that it's nice to give functions for commands names specific to the utility, even though they're static, because occasionally it makes it easier to find them using "tags", "grep", etc.
Signed-off-by: Ben Pfaff <b...@nicira.com> --- ovn/utilities/ovn-nbctl.c | 96 +++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 0bdb3a3..e33dd37 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -168,7 +168,7 @@ print_lswitch(const struct nbrec_logical_switch *lswitch) } static void -do_show(struct ovs_cmdl_context *ctx) +nbctl_show(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const struct nbrec_logical_switch *lswitch; @@ -186,7 +186,7 @@ do_show(struct ovs_cmdl_context *ctx) } static void -do_lswitch_add(struct ovs_cmdl_context *ctx) +nbctl_lswitch_add(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; struct nbrec_logical_switch *lswitch; @@ -198,7 +198,7 @@ do_lswitch_add(struct ovs_cmdl_context *ctx) } static void -do_lswitch_del(struct ovs_cmdl_context *ctx) +nbctl_lswitch_del(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -213,7 +213,7 @@ do_lswitch_del(struct ovs_cmdl_context *ctx) } static void -do_lswitch_list(struct ovs_cmdl_context *ctx) +nbctl_lswitch_list(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const struct nbrec_logical_switch *lswitch; @@ -225,7 +225,7 @@ do_lswitch_list(struct ovs_cmdl_context *ctx) } static void -do_lswitch_set_external_id(struct ovs_cmdl_context *ctx) +nbctl_lswitch_set_external_id(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -249,7 +249,7 @@ do_lswitch_set_external_id(struct ovs_cmdl_context *ctx) } static void -do_lswitch_get_external_id(struct ovs_cmdl_context *ctx) +nbctl_lswitch_get_external_id(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -310,7 +310,7 @@ lport_by_name_or_uuid(struct nbctl_context *nb_ctx, const char *id) } static void -do_lport_add(struct ovs_cmdl_context *ctx) +nbctl_lport_add(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; struct nbrec_logical_port *lport; @@ -377,7 +377,7 @@ remove_lport(const struct nbrec_logical_switch *lswitch, size_t idx) } static void -do_lport_del(struct ovs_cmdl_context *ctx) +nbctl_lport_del(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const struct nbrec_logical_port *lport; @@ -403,7 +403,7 @@ do_lport_del(struct ovs_cmdl_context *ctx) } static void -do_lport_list(struct ovs_cmdl_context *ctx) +nbctl_lport_list(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -422,7 +422,7 @@ do_lport_list(struct ovs_cmdl_context *ctx) } static void -do_lport_get_parent(struct ovs_cmdl_context *ctx) +nbctl_lport_get_parent(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const struct nbrec_logical_port *lport; @@ -438,7 +438,7 @@ do_lport_get_parent(struct ovs_cmdl_context *ctx) } static void -do_lport_get_tag(struct ovs_cmdl_context *ctx) +nbctl_lport_get_tag(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const struct nbrec_logical_port *lport; @@ -454,7 +454,7 @@ do_lport_get_tag(struct ovs_cmdl_context *ctx) } static void -do_lport_set_external_id(struct ovs_cmdl_context *ctx) +nbctl_lport_set_external_id(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -478,7 +478,7 @@ do_lport_set_external_id(struct ovs_cmdl_context *ctx) } static void -do_lport_get_external_id(struct ovs_cmdl_context *ctx) +nbctl_lport_get_external_id(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -511,7 +511,7 @@ do_lport_get_external_id(struct ovs_cmdl_context *ctx) } static void -do_lport_set_macs(struct ovs_cmdl_context *ctx) +nbctl_lport_set_macs(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -527,7 +527,7 @@ do_lport_set_macs(struct ovs_cmdl_context *ctx) } static void -do_lport_get_macs(struct ovs_cmdl_context *ctx) +nbctl_lport_get_macs(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -545,7 +545,7 @@ do_lport_get_macs(struct ovs_cmdl_context *ctx) } static void -do_lport_set_port_security(struct ovs_cmdl_context *ctx) +nbctl_lport_set_port_security(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -561,7 +561,7 @@ do_lport_set_port_security(struct ovs_cmdl_context *ctx) } static void -do_lport_get_port_security(struct ovs_cmdl_context *ctx) +nbctl_lport_get_port_security(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -579,7 +579,7 @@ do_lport_get_port_security(struct ovs_cmdl_context *ctx) } static void -do_lport_get_up(struct ovs_cmdl_context *ctx) +nbctl_lport_get_up(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -594,7 +594,7 @@ do_lport_get_up(struct ovs_cmdl_context *ctx) } static void -do_lport_set_enabled(struct ovs_cmdl_context *ctx) +nbctl_lport_set_enabled(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -618,7 +618,7 @@ do_lport_set_enabled(struct ovs_cmdl_context *ctx) } static void -do_lport_get_enabled(struct ovs_cmdl_context *ctx) +nbctl_lport_get_enabled(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -634,7 +634,7 @@ do_lport_get_enabled(struct ovs_cmdl_context *ctx) } static void -do_lport_set_type(struct ovs_cmdl_context *ctx) +nbctl_lport_set_type(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -650,7 +650,7 @@ do_lport_set_type(struct ovs_cmdl_context *ctx) } static void -do_lport_get_type(struct ovs_cmdl_context *ctx) +nbctl_lport_get_type(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -665,7 +665,7 @@ do_lport_get_type(struct ovs_cmdl_context *ctx) } static void -do_lport_set_options(struct ovs_cmdl_context *ctx) +nbctl_lport_set_options(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -694,7 +694,7 @@ do_lport_set_options(struct ovs_cmdl_context *ctx) } static void -do_lport_get_options(struct ovs_cmdl_context *ctx) +nbctl_lport_get_options(struct ovs_cmdl_context *ctx) { struct nbctl_context *nb_ctx = ctx->pvt; const char *id = ctx->argv[1]; @@ -774,91 +774,91 @@ static const struct ovs_cmdl_command all_commands[] = { .usage = "[LSWITCH]", .min_args = 0, .max_args = 1, - .handler = do_show, + .handler = nbctl_show, }, { .name = "lswitch-add", .usage = "[LSWITCH]", .min_args = 0, .max_args = 1, - .handler = do_lswitch_add, + .handler = nbctl_lswitch_add, }, { .name = "lswitch-del", .usage = "LSWITCH", .min_args = 1, .max_args = 1, - .handler = do_lswitch_del, + .handler = nbctl_lswitch_del, }, { .name = "lswitch-list", .usage = "", .min_args = 0, .max_args = 0, - .handler = do_lswitch_list, + .handler = nbctl_lswitch_list, }, { .name = "lswitch-set-external-id", .usage = "LSWITCH KEY [VALUE]", .min_args = 2, .max_args = 3, - .handler = do_lswitch_set_external_id, + .handler = nbctl_lswitch_set_external_id, }, { .name = "lswitch-get-external-id", .usage = "LSWITCH [KEY]", .min_args = 1, .max_args = 2, - .handler = do_lswitch_get_external_id, + .handler = nbctl_lswitch_get_external_id, }, { .name = "lport-add", .usage = "LSWITCH LPORT [PARENT] [TAG]", .min_args = 2, .max_args = 4, - .handler = do_lport_add, + .handler = nbctl_lport_add, }, { .name = "lport-del", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_del, + .handler = nbctl_lport_del, }, { .name = "lport-list", .usage = "LSWITCH", .min_args = 1, .max_args = 1, - .handler = do_lport_list, + .handler = nbctl_lport_list, }, { .name = "lport-get-parent", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_parent, + .handler = nbctl_lport_get_parent, }, { .name = "lport-get-tag", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_tag, + .handler = nbctl_lport_get_tag, }, { .name = "lport-set-external-id", .usage = "LPORT KEY [VALUE]", .min_args = 2, .max_args = 3, - .handler = do_lport_set_external_id, + .handler = nbctl_lport_set_external_id, }, { .name = "lport-get-external-id", .usage = "LPORT [KEY]", .min_args = 1, .max_args = 2, - .handler = do_lport_get_external_id, + .handler = nbctl_lport_get_external_id, }, { .name = "lport-set-macs", @@ -866,14 +866,14 @@ static const struct ovs_cmdl_command all_commands[] = { .min_args = 1, /* Accept however many arguments the system will allow. */ .max_args = INT_MAX, - .handler = do_lport_set_macs, + .handler = nbctl_lport_set_macs, }, { .name = "lport-get-macs", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_macs, + .handler = nbctl_lport_get_macs, }, { .name = "lport-set-port-security", @@ -881,63 +881,63 @@ static const struct ovs_cmdl_command all_commands[] = { .min_args = 0, /* Accept however many arguments the system will allow. */ .max_args = INT_MAX, - .handler = do_lport_set_port_security, + .handler = nbctl_lport_set_port_security, }, { .name = "lport-get-port-security", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_port_security, + .handler = nbctl_lport_get_port_security, }, { .name = "lport-get-up", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_up, + .handler = nbctl_lport_get_up, }, { .name = "lport-set-enabled", .usage = "LPORT STATE", .min_args = 2, .max_args = 2, - .handler = do_lport_set_enabled, + .handler = nbctl_lport_set_enabled, }, { .name = "lport-get-enabled", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_enabled, + .handler = nbctl_lport_get_enabled, }, { .name = "lport-set-type", .usage = "LPORT TYPE", .min_args = 2, .max_args = 2, - .handler = do_lport_set_type, + .handler = nbctl_lport_set_type, }, { .name = "lport-get-type", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_type, + .handler = nbctl_lport_get_type, }, { .name = "lport-set-options", .usage = "LPORT KEY=VALUE [KEY=VALUE]...", .min_args = 1, .max_args = INT_MAX, - .handler = do_lport_set_options + .handler = nbctl_lport_set_options }, { .name = "lport-get-options", .usage = "LPORT", .min_args = 1, .max_args = 1, - .handler = do_lport_get_options, + .handler = nbctl_lport_get_options, }, { -- 2.1.3 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev