From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 5/9] spp_pcap: rename define of buffer size for cmds
Date: Fri, 31 May 2019 17:51:35 +0900 [thread overview]
Message-ID: <1559292699-26940-6-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559292699-26940-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
For refactoring, rename SPP_CMD_NAME_BUFSZ and SPP_CMD_NAME_VALUE_BUFSZ
to SPPWK_NAME_BUFSZ and SPPWK_VAL_BUFSZ to be more simple and specific.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/pcap/cmd_parser.c | 2 +-
src/pcap/cmd_parser.h | 8 ++++----
src/pcap/cmd_runner.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/pcap/cmd_parser.c b/src/pcap/cmd_parser.c
index b91b39c..a5f3a4a 100644
--- a/src/pcap/cmd_parser.c
+++ b/src/pcap/cmd_parser.c
@@ -92,7 +92,7 @@ parse_command_in_list(struct spp_command_request *request,
int i = 0;
int argc = 0;
char *argv[SPPWK_MAX_PARAMS];
- char tmp_str[SPPWK_MAX_PARAMS * SPP_CMD_VALUE_BUFSZ];
+ char tmp_str[SPPWK_MAX_PARAMS * SPPWK_VAL_BUFSZ];
memset(argv, 0x00, sizeof(argv));
memset(tmp_str, 0x00, sizeof(tmp_str));
diff --git a/src/pcap/cmd_parser.h b/src/pcap/cmd_parser.h
index 109b649..5945e62 100644
--- a/src/pcap/cmd_parser.h
+++ b/src/pcap/cmd_parser.h
@@ -21,10 +21,10 @@
#define SPPWK_MAX_PARAMS 8
/** command name string buffer size (include null char) */
-#define SPP_CMD_NAME_BUFSZ 32
+#define SPPWK_NAME_BUFSZ 32
/** command value string buffer size (include null char) */
-#define SPP_CMD_VALUE_BUFSZ 111
+#define SPPWK_VAL_BUFSZ 111
/** parse error code */
enum sppwk_parse_error_code {
@@ -82,8 +82,8 @@ struct spp_command_request {
/** parse error information */
struct spp_command_parse_error {
int code; /**< Error code */
- char value_name[SPP_CMD_NAME_BUFSZ]; /**< Error value name */
- char value[SPP_CMD_VALUE_BUFSZ]; /**< Error value */
+ char value_name[SPPWK_NAME_BUFSZ]; /**< Error value name */
+ char value[SPPWK_VAL_BUFSZ]; /**< Error value */
};
/**
diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 0ce5d49..d5ae3a5 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -42,7 +42,7 @@ struct command_result {
int code;
/* Response message */
- char msg[SPP_CMD_NAME_BUFSZ];
+ char msg[SPPWK_NAME_BUFSZ];
/* Detailed response message */
char error_message[CMD_RES_ERR_MSG_SIZE];
@@ -51,7 +51,7 @@ struct command_result {
/* command response list control structure */
struct command_response_list {
/* JSON Tag name */
- char tag_name[SPP_CMD_NAME_BUFSZ];
+ char tag_name[SPPWK_NAME_BUFSZ];
/* Pointer to handling function */
int (*func)(const char *name, char **output, void *tmp);
--
2.17.1
next prev parent reply other threads:[~2019-05-31 8:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 8:51 [spp] [PATCH 0/9] Refactor func and struct for spp_pcap resources ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 1/9] spp_pcap: rename enum spp_core_status ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 2/9] spp_pcap: rename file of util libs ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 3/9] spp_pcap: refactor parse error code ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 4/9] spp_pcap: rename define starts from SPP_CMD_MAX ogawa.yasufumi
2019-05-31 8:51 ` ogawa.yasufumi [this message]
2019-05-31 8:51 ` [spp] [PATCH 6/9] spp_pcap: revise name of error message object ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 7/9] spp_pcap: revise return codes ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 8/9] spp_pcap: rename struct spp_port_info ogawa.yasufumi
2019-05-31 8:51 ` [spp] [PATCH 9/9] spp_pcap: rename struct spp_port_index ogawa.yasufumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1559292699-26940-6-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).