Commit Graph

3 Commits

Author SHA1 Message Date
Frediano Ziglio
b843d02a1b Avoid usage of GCC extension for __VA_ARGS__ where possible
The "##" before __VA_ARGS__ is a GCC extension.
Try to limit its usage where necessary.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10 09:55:27 +01:00
Kevin Pouget
3331ad1a04 agent-interface: add configuration functions
agent_interface_start: this function allows launching the agent
interface (ie, its listening socket) on a given port.

agent_interface_set_on_connect_cb: this function allows passing a
callback function that will be triggered when a client (a Local Agent)
connects to the Agent Interface socket.

agent_interface_set_forward_quality_cb: this function allows SPICE to
provide a function that will forward Quality messages received by the
Agent Interface towards SPICE server, for a centralized processing of
the messages.

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-10-18 17:04:06 +01:00
Kevin Pouget
a16c7027c5 agent-interface: introduce the core of the Agent Interface
When initialized (recorder_initialization), the Agent Interface launch
a GThread (handle_communications) that opens a TCP server socket and
waits for Smart Local Agent connections. When a Local Agent connects
to the sockets, the communication is initialized
(agent_initialize_communication), the communication socket is stored
and the list of Recorders is sent. In return, the local agent
indicates which recorders to enable.

On the SPICE side, the Agent Interface handles the record() calls
(recorder_append*). When a record is received from SPICE, and if the
recorder is enabled, the record entry is sent through the TCP
connection. Otherwise, the record is dropped.

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-10-18 17:04:03 +01:00