From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 6CED65F19 for ; Fri, 5 Oct 2018 07:06:41 +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 w9556etu017216; Fri, 5 Oct 2018 14:06:40 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 35D8EEA880F; Fri, 5 Oct 2018 14:06:40 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 14E95EA880D; Fri, 5 Oct 2018 14:06:40 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp Date: Fri, 5 Oct 2018 14:06:29 +0900 Message-Id: <20181005050630.10661-4-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181005050630.10661-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181004055918.5922-1-ogawa.yasufumi@lab.ntt.co.j> <20181005050630.10661-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH v2 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: Fri, 05 Oct 2018 05:06:42 -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