From patchwork Wed Sep 2 23:44:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 513702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 438651401F0 for ; Thu, 3 Sep 2015 09:45:16 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 10A52109D3; Wed, 2 Sep 2015 16:44:31 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 96F6E10899 for ; Wed, 2 Sep 2015 16:44:29 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 13DBF1E0436 for ; Wed, 2 Sep 2015 17:44:29 -0600 (MDT) X-ASG-Debug-ID: 1441237468-09eadd4ef358640001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id KtQDCZDnwy63RI2h (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 02 Sep 2015 17:44:28 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-pa0-f53.google.com) (209.85.220.53) by mx1-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 2 Sep 2015 23:44:28 -0000 Received-SPF: unknown (mx1-pf1.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.53 Received: by pacfv12 with SMTP id fv12so26688140pac.2 for ; Wed, 02 Sep 2015 16:44:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K6N1nsFmh5upMFoEby0MvU8wVHpUsGV2TmzJYVDI/nE=; b=axrtacgxZ7HLAd6tvnnslnQp5gaqiCr4onHSb9ETEeCEzyg47afBQegqsPPoXi8Dvu n8h5ZOZLgX8xfCHxVNj6ndAWiRtrW8ZH7omvynq0BfIEjwfUQFGyMxv4TOcbGvrJZwDq AUU4KxFNyFOgBPjBlS4eLw8jX8WilBy2zHDNMrjnvHZTjzz+0BG0/OwSi6ERKk/Gsgra 9uj1r8rhB6hpzToY8Z/ae7U5hl2+sH+L6hduwJRGUuGj8CADXTe2cnLomO49FthYoJoj s2ucBrO2Yu/9VS41Ek3pRqe9PHNRqsXJ/gUcQrMx9HdLkBdtFMn4DrWhkgEQ+jpIa6NN nUaQ== X-Gm-Message-State: ALoCoQlu3I9cgPCVdE0sLjR7wpFJB5r+Jf8LJjr/r1V9BNLdLzGTYEN8Fb8H+F2dGFjYq7Z7A9KI X-Received: by 10.66.160.133 with SMTP id xk5mr60114982pab.131.1441237467823; Wed, 02 Sep 2015 16:44:27 -0700 (PDT) Received: from sigabrt.benpfaff.org ([208.91.2.4]) by smtp.gmail.com with ESMTPSA id f5sm23046151pas.23.2015.09.02.16.44.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Sep 2015 16:44:26 -0700 (PDT) X-CudaMail-Envelope-Sender: blp@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.2.4 From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-901091863 X-CudaMail-DTE: 090215 X-CudaMail-Originating-IP: 209.85.220.53 Date: Wed, 2 Sep 2015 16:44:04 -0700 X-ASG-Orig-Subj: [##CM-E1-901091863##][PATCH v2 07/14] ovn-nbctl: Give handler functions more specific names. Message-Id: <1441237451-17940-7-git-send-email-blp@nicira.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1441237451-17940-1-git-send-email-blp@nicira.com> References: <1441237451-17940-1-git-send-email-blp@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1441237468 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 07/14] ovn-nbctl: Give handler functions more specific names. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 --- 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, }, {