#define QEMU_VNC_H
#include "qemu-common.h"
+#include "qapi/qapi-types-ui.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
#include "ui/console.h"
#include "qemu/buffer.h"
#include "io/channel-socket.h"
#include "io/channel-tls.h"
+#include "io/net-listener.h"
+#include "authz/base.h"
#include <zlib.h>
#include "keymaps.h"
#include "vnc-palette.h"
#include "vnc-enc-zrle.h"
-#include "qapi-types.h"
+#include "ui/kbd-state.h"
// #define _VNC_DEBUG 1
int num_exclusive;
int connections_limit;
VncSharePolicy share_policy;
- size_t nlsock;
- QIOChannelSocket **lsock;
- guint *lsock_tag;
- size_t nlwebsock;
- QIOChannelSocket **lwebsock;
- guint *lwebsock_tag;
+ QIONetListener *listener;
+ QIONetListener *wslistener;
DisplaySurface *ds;
DisplayChangeListener dcl;
kbd_layout_t *kbd_layout;
int lock_key_sync;
QEMUPutLEDEntry *led;
int ledstate;
- int key_delay_ms;
+ QKbdState *kbd;
QemuMutex mutex;
QEMUCursor *cursor;
bool lossy;
bool non_adaptive;
QCryptoTLSCreds *tlscreds;
- char *tlsaclname;
+ QAuthZ *tlsauthz;
+ char *tlsauthzid;
#ifdef CONFIG_VNC_SASL
VncDisplaySASL sasl;
#endif
VNC_STATE_UPDATE_FORCE,
} VncStateUpdate;
+#define VNC_MAGIC ((uint64_t)0x05b3f069b3d204bb)
+
struct VncState
{
+ uint64_t magic;
QIOChannelSocket *sioc; /* The underlying socket */
QIOChannel *ioc; /* The channel currently used for I/O */
guint ioc_tag;
int last_x;
int last_y;
uint32_t last_bmask;
- int client_width;
- int client_height;
+ size_t client_width; /* limited to u16 by RFB proto */
+ size_t client_height; /* limited to u16 by RFB proto */
VncShareMode share_mode;
uint32_t vnc_encoding;
bool encode_ws;
bool websocket;
+#ifdef CONFIG_VNC
VncClientInfo *info;
+#endif
/* Job thread bottom half has put data for a forced update
* into the output buffer. This offset points to the end of
VncReadEvent *read_handler;
size_t read_handler_expect;
- /* input */
- uint8_t modifiers_state[256];
bool abort;
QemuMutex output_mutex;