net: Use spdk_json_write_named_* APIs throughout
Change-Id: Icbe12506040eef236534489a14fe27ddb9ee5531 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/c/442945 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
ed8b4f5bae
commit
738a4c88ec
@ -154,14 +154,11 @@ spdk_rpc_get_interfaces(struct spdk_jsonrpc_request *request,
|
||||
TAILQ_FOREACH(ifc, interface_head, tailq) {
|
||||
spdk_json_write_object_begin(w);
|
||||
|
||||
spdk_json_write_name(w, "name");
|
||||
spdk_json_write_string(w, ifc->name);
|
||||
spdk_json_write_named_string(w, "name", ifc->name);
|
||||
|
||||
spdk_json_write_name(w, "ifc_index");
|
||||
spdk_json_write_int32(w, ifc->index);
|
||||
spdk_json_write_named_int32(w, "ifc_index", ifc->index);
|
||||
|
||||
spdk_json_write_name(w, "ip_addr");
|
||||
spdk_json_write_array_begin(w);
|
||||
spdk_json_write_named_array_begin(w, "ip_addr");
|
||||
for (i = 0; i < ifc->num_ip_addresses; i++) {
|
||||
memcpy(&inaddr, &ifc->ip_address[i], sizeof(uint32_t));
|
||||
ip_address = inet_ntoa(inaddr);
|
||||
|
Loading…
Reference in New Issue
Block a user