Commit 738a4c88 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Darek Stojaczyk
Browse files

net: Use spdk_json_write_named_* APIs throughout



Change-Id: Icbe12506040eef236534489a14fe27ddb9ee5531
Signed-off-by: default avatarShuhei 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent ed8b4f5b
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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);