Re: [PATCH 03/11] telemetry: add client feature and sockets
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2018-08-23 23:27:41
On Thu, 23 Aug 2018 13:08:05 +0100 Ciara Power [off-list ref] wrote:
This patch introduces clients to the telemetry API. When a client makes a connection through the initial telemetry socket, they can send a message through the socket to be parsed. Register messages are expected through this socket, to enable clients to register and have a client socket setup for future communications. A TAILQ is used to store all clients information. Using this, the client sockets are polled for messages, which will later be parsed and dealt with accordingly. Functionality that make use of the client sockets were introduced in this patch also, such as writing to client sockets, and sending error responses. Signed-off-by: Ciara Power <redacted> Signed-off-by: Brian Archbold <redacted>
Rather than using the rather heavyweight jansson library and creating an additional dependency on an external library; may I recommend reusing the json_writer library (I wrote) that is part of iproute2 and much simpler. https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/lib/json_writer.c