Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/2] spp_nfv: change _get_client_id to return JSON msg
Date: Tue, 15 Jan 2019 21:27:59 +0900	[thread overview]
Message-ID: <1547555280-11736-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1547555280-11736-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Spp_nfv returns its client ID as plain text. This update is to change
the format to JSON as same as other secondary processes.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/nfv/commands.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/nfv/commands.h b/src/nfv/commands.h
index 54e0f21..7dbe25b 100644
--- a/src/nfv/commands.h
+++ b/src/nfv/commands.h
@@ -6,6 +6,7 @@
 #ifndef _NFV_COMMANDS_H_
 #define _NFV_COMMANDS_H_
 
+#include "shared/common.h"
 #include "shared/secondary/add_port.h"
 #include "shared/secondary/utils.h"
 
@@ -180,7 +181,10 @@ parse_command(char *str)
 
 	} else if (!strcmp(token_list[0], "_get_client_id")) {
 		memset(str, '\0', MSG_SIZE);
-		sprintf(str, "%d", client_id);
+		sprintf(str, "{%s:%s,%s:%d,%s:%s}",
+				"\"results\"", "[{\"result\":\"success\"}]",
+				"\"client_id\"", client_id,
+				"\"process_type\"", "\"nfv\"");
 
 	} else if (!strcmp(token_list[0], "_set_client_id")) {
 		int id;
-- 
2.17.1

  reply	other threads:[~2019-01-15 12:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 12:27 [spp] [PATCH 0/2] Change response of _get_client_id in spp_nfv ogawa.yasufumi
2019-01-15 12:27 ` ogawa.yasufumi [this message]
2019-01-15 12:28 ` [spp] [PATCH 2/2] spp-ctl: change NfvProc to parse JSON msg 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=1547555280-11736-2-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).