From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bcmv-tmail01.ecl.ntt.co.jp (bcmv-tmail01.ecl.ntt.co.jp [124.146.185.148]) by dpdk.org (Postfix) with ESMTP id 883085F36 for ; Thu, 4 Oct 2018 07:59:34 +0200 (CEST) Received: from bcmv-ns01.ecl.ntt.co.jp (bcmv-ns01.ecl.ntt.co.jp [129.60.83.123]) by bcmv-tmail01.ecl.ntt.co.jp (8.14.4/8.14.4) with ESMTP id w945xXRR008262; Thu, 4 Oct 2018 14:59:33 +0900 Received: from bcmv-ns01.ecl.ntt.co.jp (localhost [127.0.0.1]) by bcmv-ns01.ecl.ntt.co.jp (Postfix) with ESMTP id 5A3FE129; Thu, 4 Oct 2018 14:59:33 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by bcmv-ns01.ecl.ntt.co.jp (Postfix) with ESMTP id 4445A10E; Thu, 4 Oct 2018 14:59:33 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 4 Oct 2018 14:59:17 +0900 Message-Id: <20181004055918.5922-4-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181004055918.5922-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181004055918.5922-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 3/4] spp_vm: update retrieving status 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: , X-List-Received-Date: Thu, 04 Oct 2018 05:59:35 -0000 From: Yasufumi Ogawa Change from print_active_ports() to get_sec_status_json() to create a response for status command. Signed-off-by: Yasufumi Ogawa --- src/vm/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vm/main.c b/src/vm/main.c index 16b4c6b..4f3511b 100644 --- a/src/vm/main.c +++ b/src/vm/main.c @@ -397,7 +397,6 @@ parse_command(char *str) char *token_list[MAX_PARAMETER] = {NULL}; int max_token = 0; int ret = 0; - int i; if (!str) return 0; @@ -418,14 +417,15 @@ parse_command(char *str) RTE_LOG(DEBUG, APP, "status\n"); memset(str, '\0', MSG_SIZE); if (cmd == FORWARD) - i = sprintf(str, "status: running\n"); + get_sec_stats_json(str, "running", ports_fwd_array, + port_map); else - i = sprintf(str, "status: idling\n"); - print_active_ports(str + i, ports_fwd_array, port_map); + get_sec_stats_json(str, "idling", ports_fwd_array, + port_map); } else if (!strcmp(token_list[0], "_get_client_id")) { memset(str, '\0', MSG_SIZE); - i = sprintf(str, "%d", client_id); + sprintf(str, "%d", client_id); } else if (!strcmp(token_list[0], "_set_client_id")) { int id; -- 2.7.4