vnc.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. /*
  2. * QEMU VNC display driver
  3. *
  4. * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
  5. * Copyright (C) 2006 Fabrice Bellard
  6. * Copyright (C) 2009 Red Hat, Inc
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  21. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. #ifndef __QEMU_VNC_H
  27. #define __QEMU_VNC_H
  28. #include "qemu-common.h"
  29. #include "qemu-queue.h"
  30. #include "qemu-thread.h"
  31. #include "console.h"
  32. #include "monitor.h"
  33. #include "audio/audio.h"
  34. #include "bitmap.h"
  35. #include <zlib.h>
  36. #include <stdbool.h>
  37. #include "keymaps.h"
  38. #include "vnc-palette.h"
  39. #include "vnc-enc-zrle.h"
  40. // #define _VNC_DEBUG 1
  41. #ifdef _VNC_DEBUG
  42. #define VNC_DEBUG(fmt, ...) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
  43. #else
  44. #define VNC_DEBUG(fmt, ...) do { } while (0)
  45. #endif
  46. /*****************************************************************************
  47. *
  48. * Core data structures
  49. *
  50. *****************************************************************************/
  51. typedef struct Buffer
  52. {
  53. size_t capacity;
  54. size_t offset;
  55. uint8_t *buffer;
  56. } Buffer;
  57. typedef struct VncState VncState;
  58. typedef struct VncJob VncJob;
  59. typedef struct VncRect VncRect;
  60. typedef struct VncRectEntry VncRectEntry;
  61. typedef int VncReadEvent(VncState *vs, uint8_t *data, size_t len);
  62. typedef void VncWritePixels(VncState *vs, struct PixelFormat *pf, void *data, int size);
  63. typedef void VncSendHextileTile(VncState *vs,
  64. int x, int y, int w, int h,
  65. void *last_bg,
  66. void *last_fg,
  67. int *has_bg, int *has_fg);
  68. /* VNC_MAX_WIDTH must be a multiple of 16. */
  69. #define VNC_MAX_WIDTH 2560
  70. #define VNC_MAX_HEIGHT 2048
  71. /* VNC_DIRTY_BITS is the number of bits in the dirty bitmap. */
  72. #define VNC_DIRTY_BITS (VNC_MAX_WIDTH / 16)
  73. #define VNC_STAT_RECT 64
  74. #define VNC_STAT_COLS (VNC_MAX_WIDTH / VNC_STAT_RECT)
  75. #define VNC_STAT_ROWS (VNC_MAX_HEIGHT / VNC_STAT_RECT)
  76. #define VNC_AUTH_CHALLENGE_SIZE 16
  77. typedef struct VncDisplay VncDisplay;
  78. #ifdef CONFIG_VNC_TLS
  79. #include "vnc-tls.h"
  80. #include "vnc-auth-vencrypt.h"
  81. #endif
  82. #ifdef CONFIG_VNC_SASL
  83. #include "vnc-auth-sasl.h"
  84. #endif
  85. struct VncRectStat
  86. {
  87. /* time of last 10 updates, to find update frequency */
  88. struct timeval times[10];
  89. int idx;
  90. double freq; /* Update frequency (in Hz) */
  91. bool updated; /* Already updated during this refresh */
  92. };
  93. typedef struct VncRectStat VncRectStat;
  94. struct VncSurface
  95. {
  96. struct timeval last_freq_check;
  97. DECLARE_BITMAP(dirty[VNC_MAX_HEIGHT], VNC_MAX_WIDTH / 16);
  98. VncRectStat stats[VNC_STAT_ROWS][VNC_STAT_COLS];
  99. DisplaySurface *ds;
  100. };
  101. typedef enum VncShareMode {
  102. VNC_SHARE_MODE_CONNECTING = 1,
  103. VNC_SHARE_MODE_SHARED,
  104. VNC_SHARE_MODE_EXCLUSIVE,
  105. VNC_SHARE_MODE_DISCONNECTED,
  106. } VncShareMode;
  107. typedef enum VncSharePolicy {
  108. VNC_SHARE_POLICY_IGNORE = 1,
  109. VNC_SHARE_POLICY_ALLOW_EXCLUSIVE,
  110. VNC_SHARE_POLICY_FORCE_SHARED,
  111. } VncSharePolicy;
  112. struct VncDisplay
  113. {
  114. QTAILQ_HEAD(, VncState) clients;
  115. int num_exclusive;
  116. VncSharePolicy share_policy;
  117. QEMUTimer *timer;
  118. int timer_interval;
  119. int lsock;
  120. DisplayState *ds;
  121. kbd_layout_t *kbd_layout;
  122. int lock_key_sync;
  123. QemuMutex mutex;
  124. QEMUCursor *cursor;
  125. int cursor_msize;
  126. uint8_t *cursor_mask;
  127. struct VncSurface guest; /* guest visible surface (aka ds->surface) */
  128. DisplaySurface *server; /* vnc server surface */
  129. char *display;
  130. char *password;
  131. time_t expires;
  132. int auth;
  133. bool lossy;
  134. bool non_adaptive;
  135. #ifdef CONFIG_VNC_TLS
  136. int subauth; /* Used by VeNCrypt */
  137. VncDisplayTLS tls;
  138. #endif
  139. #ifdef CONFIG_VNC_SASL
  140. VncDisplaySASL sasl;
  141. #endif
  142. };
  143. typedef struct VncTight {
  144. int type;
  145. uint8_t quality;
  146. uint8_t compression;
  147. uint8_t pixel24;
  148. Buffer tight;
  149. Buffer tmp;
  150. Buffer zlib;
  151. Buffer gradient;
  152. #ifdef CONFIG_VNC_JPEG
  153. Buffer jpeg;
  154. #endif
  155. #ifdef CONFIG_VNC_PNG
  156. Buffer png;
  157. #endif
  158. int levels[4];
  159. z_stream stream[4];
  160. } VncTight;
  161. typedef struct VncHextile {
  162. VncSendHextileTile *send_tile;
  163. } VncHextile;
  164. typedef struct VncZlib {
  165. Buffer zlib;
  166. Buffer tmp;
  167. z_stream stream;
  168. int level;
  169. } VncZlib;
  170. typedef struct VncZrle {
  171. int type;
  172. Buffer fb;
  173. Buffer zrle;
  174. Buffer tmp;
  175. Buffer zlib;
  176. z_stream stream;
  177. VncPalette palette;
  178. } VncZrle;
  179. typedef struct VncZywrle {
  180. int buf[VNC_ZRLE_TILE_WIDTH * VNC_ZRLE_TILE_HEIGHT];
  181. } VncZywrle;
  182. struct VncRect
  183. {
  184. int x;
  185. int y;
  186. int w;
  187. int h;
  188. };
  189. struct VncRectEntry
  190. {
  191. struct VncRect rect;
  192. QLIST_ENTRY(VncRectEntry) next;
  193. };
  194. struct VncJob
  195. {
  196. VncState *vs;
  197. QLIST_HEAD(, VncRectEntry) rectangles;
  198. QTAILQ_ENTRY(VncJob) next;
  199. };
  200. struct VncState
  201. {
  202. int csock;
  203. DisplayState *ds;
  204. DECLARE_BITMAP(dirty[VNC_MAX_HEIGHT], VNC_DIRTY_BITS);
  205. uint8_t **lossy_rect; /* Not an Array to avoid costly memcpy in
  206. * vnc-jobs-async.c */
  207. VncDisplay *vd;
  208. int need_update;
  209. int force_update;
  210. uint32_t features;
  211. int absolute;
  212. int last_x;
  213. int last_y;
  214. int client_width;
  215. int client_height;
  216. VncShareMode share_mode;
  217. uint32_t vnc_encoding;
  218. int major;
  219. int minor;
  220. int auth;
  221. char challenge[VNC_AUTH_CHALLENGE_SIZE];
  222. #ifdef CONFIG_VNC_TLS
  223. int subauth; /* Used by VeNCrypt */
  224. VncStateTLS tls;
  225. #endif
  226. #ifdef CONFIG_VNC_SASL
  227. VncStateSASL sasl;
  228. #endif
  229. QObject *info;
  230. Buffer output;
  231. Buffer input;
  232. /* current output mode information */
  233. VncWritePixels *write_pixels;
  234. DisplaySurface clientds;
  235. CaptureVoiceOut *audio_cap;
  236. struct audsettings as;
  237. VncReadEvent *read_handler;
  238. size_t read_handler_expect;
  239. /* input */
  240. uint8_t modifiers_state[256];
  241. QEMUPutLEDEntry *led;
  242. bool abort;
  243. QemuMutex output_mutex;
  244. QEMUBH *bh;
  245. Buffer jobs_buffer;
  246. /* Encoding specific, if you add something here, don't forget to
  247. * update vnc_async_encoding_start()
  248. */
  249. VncTight tight;
  250. VncZlib zlib;
  251. VncHextile hextile;
  252. VncZrle zrle;
  253. VncZywrle zywrle;
  254. Notifier mouse_mode_notifier;
  255. QTAILQ_ENTRY(VncState) next;
  256. };
  257. /*****************************************************************************
  258. *
  259. * Authentication modes
  260. *
  261. *****************************************************************************/
  262. enum {
  263. VNC_AUTH_INVALID = 0,
  264. VNC_AUTH_NONE = 1,
  265. VNC_AUTH_VNC = 2,
  266. VNC_AUTH_RA2 = 5,
  267. VNC_AUTH_RA2NE = 6,
  268. VNC_AUTH_TIGHT = 16,
  269. VNC_AUTH_ULTRA = 17,
  270. VNC_AUTH_TLS = 18, /* Supported in GTK-VNC & VINO */
  271. VNC_AUTH_VENCRYPT = 19, /* Supported in GTK-VNC & VeNCrypt */
  272. VNC_AUTH_SASL = 20, /* Supported in GTK-VNC & VINO */
  273. };
  274. enum {
  275. VNC_AUTH_VENCRYPT_PLAIN = 256,
  276. VNC_AUTH_VENCRYPT_TLSNONE = 257,
  277. VNC_AUTH_VENCRYPT_TLSVNC = 258,
  278. VNC_AUTH_VENCRYPT_TLSPLAIN = 259,
  279. VNC_AUTH_VENCRYPT_X509NONE = 260,
  280. VNC_AUTH_VENCRYPT_X509VNC = 261,
  281. VNC_AUTH_VENCRYPT_X509PLAIN = 262,
  282. VNC_AUTH_VENCRYPT_X509SASL = 263,
  283. VNC_AUTH_VENCRYPT_TLSSASL = 264,
  284. };
  285. /*****************************************************************************
  286. *
  287. * Encoding types
  288. *
  289. *****************************************************************************/
  290. #define VNC_ENCODING_RAW 0x00000000
  291. #define VNC_ENCODING_COPYRECT 0x00000001
  292. #define VNC_ENCODING_RRE 0x00000002
  293. #define VNC_ENCODING_CORRE 0x00000004
  294. #define VNC_ENCODING_HEXTILE 0x00000005
  295. #define VNC_ENCODING_ZLIB 0x00000006
  296. #define VNC_ENCODING_TIGHT 0x00000007
  297. #define VNC_ENCODING_ZLIBHEX 0x00000008
  298. #define VNC_ENCODING_TRLE 0x0000000f
  299. #define VNC_ENCODING_ZRLE 0x00000010
  300. #define VNC_ENCODING_ZYWRLE 0x00000011
  301. #define VNC_ENCODING_COMPRESSLEVEL0 0xFFFFFF00 /* -256 */
  302. #define VNC_ENCODING_QUALITYLEVEL0 0xFFFFFFE0 /* -32 */
  303. #define VNC_ENCODING_XCURSOR 0xFFFFFF10 /* -240 */
  304. #define VNC_ENCODING_RICH_CURSOR 0xFFFFFF11 /* -239 */
  305. #define VNC_ENCODING_POINTER_POS 0xFFFFFF18 /* -232 */
  306. #define VNC_ENCODING_LASTRECT 0xFFFFFF20 /* -224 */
  307. #define VNC_ENCODING_DESKTOPRESIZE 0xFFFFFF21 /* -223 */
  308. #define VNC_ENCODING_POINTER_TYPE_CHANGE 0XFFFFFEFF /* -257 */
  309. #define VNC_ENCODING_EXT_KEY_EVENT 0XFFFFFEFE /* -258 */
  310. #define VNC_ENCODING_AUDIO 0XFFFFFEFD /* -259 */
  311. #define VNC_ENCODING_TIGHT_PNG 0xFFFFFEFC /* -260 */
  312. #define VNC_ENCODING_WMVi 0x574D5669
  313. /*****************************************************************************
  314. *
  315. * Other tight constants
  316. *
  317. *****************************************************************************/
  318. /*
  319. * Vendors known by TightVNC: standard VNC/RealVNC, TridiaVNC, and TightVNC.
  320. */
  321. #define VNC_TIGHT_CCB_RESET_MASK (0x0f)
  322. #define VNC_TIGHT_CCB_TYPE_MASK (0x0f << 4)
  323. #define VNC_TIGHT_CCB_TYPE_FILL (0x08 << 4)
  324. #define VNC_TIGHT_CCB_TYPE_JPEG (0x09 << 4)
  325. #define VNC_TIGHT_CCB_TYPE_PNG (0x0A << 4)
  326. #define VNC_TIGHT_CCB_BASIC_MAX (0x07 << 4)
  327. #define VNC_TIGHT_CCB_BASIC_ZLIB (0x03 << 4)
  328. #define VNC_TIGHT_CCB_BASIC_FILTER (0x04 << 4)
  329. /*****************************************************************************
  330. *
  331. * Features
  332. *
  333. *****************************************************************************/
  334. #define VNC_FEATURE_RESIZE 0
  335. #define VNC_FEATURE_HEXTILE 1
  336. #define VNC_FEATURE_POINTER_TYPE_CHANGE 2
  337. #define VNC_FEATURE_WMVI 3
  338. #define VNC_FEATURE_TIGHT 4
  339. #define VNC_FEATURE_ZLIB 5
  340. #define VNC_FEATURE_COPYRECT 6
  341. #define VNC_FEATURE_RICH_CURSOR 7
  342. #define VNC_FEATURE_TIGHT_PNG 8
  343. #define VNC_FEATURE_ZRLE 9
  344. #define VNC_FEATURE_ZYWRLE 10
  345. #define VNC_FEATURE_RESIZE_MASK (1 << VNC_FEATURE_RESIZE)
  346. #define VNC_FEATURE_HEXTILE_MASK (1 << VNC_FEATURE_HEXTILE)
  347. #define VNC_FEATURE_POINTER_TYPE_CHANGE_MASK (1 << VNC_FEATURE_POINTER_TYPE_CHANGE)
  348. #define VNC_FEATURE_WMVI_MASK (1 << VNC_FEATURE_WMVI)
  349. #define VNC_FEATURE_TIGHT_MASK (1 << VNC_FEATURE_TIGHT)
  350. #define VNC_FEATURE_ZLIB_MASK (1 << VNC_FEATURE_ZLIB)
  351. #define VNC_FEATURE_COPYRECT_MASK (1 << VNC_FEATURE_COPYRECT)
  352. #define VNC_FEATURE_RICH_CURSOR_MASK (1 << VNC_FEATURE_RICH_CURSOR)
  353. #define VNC_FEATURE_TIGHT_PNG_MASK (1 << VNC_FEATURE_TIGHT_PNG)
  354. #define VNC_FEATURE_ZRLE_MASK (1 << VNC_FEATURE_ZRLE)
  355. #define VNC_FEATURE_ZYWRLE_MASK (1 << VNC_FEATURE_ZYWRLE)
  356. /* Client -> Server message IDs */
  357. #define VNC_MSG_CLIENT_SET_PIXEL_FORMAT 0
  358. #define VNC_MSG_CLIENT_SET_ENCODINGS 2
  359. #define VNC_MSG_CLIENT_FRAMEBUFFER_UPDATE_REQUEST 3
  360. #define VNC_MSG_CLIENT_KEY_EVENT 4
  361. #define VNC_MSG_CLIENT_POINTER_EVENT 5
  362. #define VNC_MSG_CLIENT_CUT_TEXT 6
  363. #define VNC_MSG_CLIENT_VMWARE_0 127
  364. #define VNC_MSG_CLIENT_CALL_CONTROL 249
  365. #define VNC_MSG_CLIENT_XVP 250
  366. #define VNC_MSG_CLIENT_SET_DESKTOP_SIZE 251
  367. #define VNC_MSG_CLIENT_TIGHT 252
  368. #define VNC_MSG_CLIENT_GII 253
  369. #define VNC_MSG_CLIENT_VMWARE_1 254
  370. #define VNC_MSG_CLIENT_QEMU 255
  371. /* Server -> Client message IDs */
  372. #define VNC_MSG_SERVER_FRAMEBUFFER_UPDATE 0
  373. #define VNC_MSG_SERVER_SET_COLOUR_MAP_ENTRIES 1
  374. #define VNC_MSG_SERVER_BELL 2
  375. #define VNC_MSG_SERVER_CUT_TEXT 3
  376. #define VNC_MSG_SERVER_VMWARE_0 127
  377. #define VNC_MSG_SERVER_CALL_CONTROL 249
  378. #define VNC_MSG_SERVER_XVP 250
  379. #define VNC_MSG_SERVER_TIGHT 252
  380. #define VNC_MSG_SERVER_GII 253
  381. #define VNC_MSG_SERVER_VMWARE_1 254
  382. #define VNC_MSG_SERVER_QEMU 255
  383. /* QEMU client -> server message IDs */
  384. #define VNC_MSG_CLIENT_QEMU_EXT_KEY_EVENT 0
  385. #define VNC_MSG_CLIENT_QEMU_AUDIO 1
  386. /* QEMU server -> client message IDs */
  387. #define VNC_MSG_SERVER_QEMU_AUDIO 1
  388. /* QEMU client -> server audio message IDs */
  389. #define VNC_MSG_CLIENT_QEMU_AUDIO_ENABLE 0
  390. #define VNC_MSG_CLIENT_QEMU_AUDIO_DISABLE 1
  391. #define VNC_MSG_CLIENT_QEMU_AUDIO_SET_FORMAT 2
  392. /* QEMU server -> client audio message IDs */
  393. #define VNC_MSG_SERVER_QEMU_AUDIO_END 0
  394. #define VNC_MSG_SERVER_QEMU_AUDIO_BEGIN 1
  395. #define VNC_MSG_SERVER_QEMU_AUDIO_DATA 2
  396. /*****************************************************************************
  397. *
  398. * Internal APIs
  399. *
  400. *****************************************************************************/
  401. /* Event loop functions */
  402. void vnc_client_read(void *opaque);
  403. void vnc_client_write(void *opaque);
  404. long vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen);
  405. long vnc_client_write_buf(VncState *vs, const uint8_t *data, size_t datalen);
  406. /* Protocol I/O functions */
  407. void vnc_write(VncState *vs, const void *data, size_t len);
  408. void vnc_write_u32(VncState *vs, uint32_t value);
  409. void vnc_write_s32(VncState *vs, int32_t value);
  410. void vnc_write_u16(VncState *vs, uint16_t value);
  411. void vnc_write_u8(VncState *vs, uint8_t value);
  412. void vnc_flush(VncState *vs);
  413. void vnc_read_when(VncState *vs, VncReadEvent *func, size_t expecting);
  414. /* Buffer I/O functions */
  415. uint8_t read_u8(uint8_t *data, size_t offset);
  416. uint16_t read_u16(uint8_t *data, size_t offset);
  417. int32_t read_s32(uint8_t *data, size_t offset);
  418. uint32_t read_u32(uint8_t *data, size_t offset);
  419. /* Protocol stage functions */
  420. void vnc_client_error(VncState *vs);
  421. int vnc_client_io_error(VncState *vs, int ret, int last_errno);
  422. void start_client_init(VncState *vs);
  423. void start_auth_vnc(VncState *vs);
  424. /* Buffer management */
  425. void buffer_reserve(Buffer *buffer, size_t len);
  426. int buffer_empty(Buffer *buffer);
  427. uint8_t *buffer_end(Buffer *buffer);
  428. void buffer_reset(Buffer *buffer);
  429. void buffer_free(Buffer *buffer);
  430. void buffer_append(Buffer *buffer, const void *data, size_t len);
  431. /* Misc helpers */
  432. char *vnc_socket_local_addr(const char *format, int fd);
  433. char *vnc_socket_remote_addr(const char *format, int fd);
  434. static inline uint32_t vnc_has_feature(VncState *vs, int feature) {
  435. return (vs->features & (1 << feature));
  436. }
  437. /* Framebuffer */
  438. void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
  439. int32_t encoding);
  440. void vnc_convert_pixel(VncState *vs, uint8_t *buf, uint32_t v);
  441. double vnc_update_freq(VncState *vs, int x, int y, int w, int h);
  442. void vnc_sent_lossy_rect(VncState *vs, int x, int y, int w, int h);
  443. /* Encodings */
  444. int vnc_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
  445. int vnc_raw_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
  446. int vnc_hextile_send_framebuffer_update(VncState *vs, int x,
  447. int y, int w, int h);
  448. void vnc_hextile_set_pixel_conversion(VncState *vs, int generic);
  449. void *vnc_zlib_zalloc(void *x, unsigned items, unsigned size);
  450. void vnc_zlib_zfree(void *x, void *addr);
  451. int vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
  452. void vnc_zlib_clear(VncState *vs);
  453. int vnc_tight_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
  454. int vnc_tight_png_send_framebuffer_update(VncState *vs, int x, int y,
  455. int w, int h);
  456. void vnc_tight_clear(VncState *vs);
  457. int vnc_zrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
  458. int vnc_zywrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
  459. void vnc_zrle_clear(VncState *vs);
  460. #endif /* __QEMU_VNC_H */