From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2D478A045E for ; Fri, 31 May 2019 10:55:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 216731B951; Fri, 31 May 2019 10:55:19 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 8B70E1B945 for ; Fri, 31 May 2019 10:55:16 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4V8tF6o000711; Fri, 31 May 2019 17:55:15 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 6A7F0EA860A; Fri, 31 May 2019 17:55:15 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 5D636EA85FD; Fri, 31 May 2019 17:55:15 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Fri, 31 May 2019 17:52:34 +0900 Message-Id: <1559292762-27042-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559292762-27042-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1559292762-27042-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 02/10] spp_pcap: rename struct spp_command X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa Rename struct `spp_command` to `pcap_cmd_attr` because it is not a command, but a set of attributes actually. Signed-off-by: Yasufumi Ogawa --- src/pcap/cmd_parser.c | 7 ++++--- src/pcap/cmd_parser.h | 7 +++---- src/pcap/cmd_runner.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pcap/cmd_parser.c b/src/pcap/cmd_parser.c index 946300e..1624347 100644 --- a/src/pcap/cmd_parser.c +++ b/src/pcap/cmd_parser.c @@ -13,7 +13,8 @@ #define RTE_LOGTYPE_PCAP_PARSER RTE_LOGTYPE_USER2 -/* set parse error */ +/* Format error message object and return error code for an error case. */ +/* TODO(yasufum) merge it to the same definition in shared/.../cmd_parser.c */ static inline int set_parse_error(struct sppwk_parse_err_msg *wk_err_msg, const int err_code, const char *err_msg) @@ -118,7 +119,7 @@ parse_command_in_list(struct spp_command_request *request, continue; } - request->commands[0].type = command_list_pcap[i].type; + request->cmd_attrs[0].type = command_list_pcap[i].type; if (list->func != NULL) return (*list->func)(request, argc, argv, wk_err_msg, list->param_max); @@ -163,7 +164,7 @@ spp_command_parse_request( /* check getter command */ for (i = 0; i < request->num_valid_command; ++i) { - switch (request->commands[i].type) { + switch (request->cmd_attrs[i].type) { case PCAP_CMDTYPE_CLIENT_ID: request->is_requested_client_id = 1; break; diff --git a/src/pcap/cmd_parser.h b/src/pcap/cmd_parser.h index fd110cb..706144d 100644 --- a/src/pcap/cmd_parser.h +++ b/src/pcap/cmd_parser.h @@ -51,16 +51,15 @@ enum pcap_cmd_type { PCAP_CMDTYPE_STOP, /**< port */ }; -/** command parameters */ -struct spp_command { - enum pcap_cmd_type type; /**< Command type */ +struct pcap_cmd_attr { + enum pcap_cmd_type type; }; /** request parameters */ struct spp_command_request { int num_command; /**< Number of accepted commands */ int num_valid_command; /**< Number of executed commands */ - struct spp_command commands[SPPWK_MAX_CMDS]; + struct pcap_cmd_attr cmd_attrs[SPPWK_MAX_CMDS]; /**