From 97f33fa86aa6edd25111b173dc0d9599ac29f879 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 11 Oct 2010 16:30:58 +0200 Subject: server: add channel notifications. This patch adds a channel event callback to the spice core interface. This new callback will be called for three events: (1) A new connection has been established. (2) The channel is ready (i.e. authentication is done, link message verification passed all tests, channel is ready to use). (3) Channel was disconnected. Qemu will use this to send notifications to the management app. --- server/spice.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'server/spice.h') diff --git a/server/spice.h b/server/spice.h index 6f4c7820..e6304020 100644 --- a/server/spice.h +++ b/server/spice.h @@ -42,18 +42,34 @@ struct SpiceBaseInstance { #define SPICE_INTERFACE_CORE "core" #define SPICE_INTERFACE_CORE_MAJOR 1 -#define SPICE_INTERFACE_CORE_MINOR 2 +#define SPICE_INTERFACE_CORE_MINOR 3 typedef struct SpiceCoreInterface SpiceCoreInterface; #define SPICE_WATCH_EVENT_READ (1 << 0) #define SPICE_WATCH_EVENT_WRITE (1 << 1) +#define SPICE_CHANNEL_EVENT_CONNECTED 1 +#define SPICE_CHANNEL_EVENT_INITIALIZED 2 +#define SPICE_CHANNEL_EVENT_DISCONNECTED 3 + +#define SPICE_CHANNEL_EVENT_FLAG_TLS (1 << 0) + typedef struct SpiceWatch SpiceWatch; typedef void (*SpiceWatchFunc)(int fd, int event, void *opaque); typedef struct SpiceTimer SpiceTimer; typedef void (*SpiceTimerFunc)(void *opaque); +typedef struct SpiceChannelEventInfo { + int connection_id; + int type; + int id; + int flags; + struct sockaddr laddr; + struct sockaddr paddr; + socklen_t llen, plen; +} SpiceChannelEventInfo; + struct SpiceCoreInterface { SpiceBaseInterface base; @@ -66,6 +82,7 @@ struct SpiceCoreInterface { void (*watch_update_mask)(SpiceWatch *watch, int event_mask); void (*watch_remove)(SpiceWatch *watch); + void (*channel_event)(int event, SpiceChannelEventInfo *info); }; /* qxl interface */ -- cgit