Skip to contentSkip to conversation

[6722] Move VNC structs into header file ("Daniel P.

Qemu-devel Anthony Liguori 1 participant 1 message Mar 6, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6722

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6722
Author:   aliguori
Date:     2009-03-06 20:27:13 +0000 (Fri, 06 Mar 2009)

Log Message:
-----------
Move VNC structs into header file ("Daniel P. Berrange")

This patch moves the definitions of VncState and VncDisplay structs out into a vnc.h header file. This is to allow the code for TLS and SASL auth mechanisms to be moved out of the main vnc.c file.

 vnc.c |  109 ------------------------------------------------
 vnc.h |  149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 148 insertions(+), 110 deletions(-)

Modified Paths:
--------------
trunk/vnc.c
trunk/vnc.h

Modified: trunk/vnc.c
===================================================================

vnc.c +2 -108
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2006 Anthony Liguori <[email protected]>
  * Copyright (C) 2006 Fabrice Bellard
+ * Copyright (C) 2009 Red Hat, Inc
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -23,26 +24,16 @@
  * THE SOFTWARE.
  */
 
-#include "qemu-common.h"
-#include "monitor.h"
-#include "console.h"
+#include "vnc.h"
 #include "sysemu.h"
 #include "qemu_socket.h"
 #include "qemu-timer.h"
-#include "audio/audio.h"
-#include <zlib.h>
 
 #define VNC_REFRESH_INTERVAL (1000 / 30)
 
-#include "vnc.h"
 #include "vnc_keysym.h"
 #include "d3des.h"
 
-#ifdef CONFIG_VNC_TLS
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#endif /* CONFIG_VNC_TLS */
-
 // #define _VNC_DEBUG 1
 
 #ifdef _VNC_DEBUG
@@ -65,104 +56,7 @@
     } \
 }
 
-typedef struct Buffer
-{
-    size_t capacity;
-    size_t offset;
-    uint8_t *buffer;
-} Buffer;
 
-typedef struct VncState VncState;
-
-typedef int VncReadEvent(VncState *vs, uint8_t *data, size_t len);
-
-typedef void VncWritePixels(VncState *vs, void *data, int size);
-
-typedef void VncSendHextileTile(VncState *vs,
-                                int x, int y, int w, int h,
-                                void *last_bg,
-                                void *last_fg,
-                                int *has_bg, int *has_fg);
-
-#define VNC_MAX_WIDTH 2048
-#define VNC_MAX_HEIGHT 2048
-#define VNC_DIRTY_WORDS (VNC_MAX_WIDTH / (16 * 32))
-
-#define VNC_AUTH_CHALLENGE_SIZE 16
-
-typedef struct VncDisplay VncDisplay;
-
-struct VncDisplay
-{
-    int lsock;
-    DisplayState *ds;
-    VncState *clients;
-    kbd_layout_t *kbd_layout;
-
-    char *display;
-    char *password;
-    int auth;
-#ifdef CONFIG_VNC_TLS
-    int subauth;
-    int x509verify;
-
-    char *x509cacert;
-    char *x509cacrl;
-    char *x509cert;
-    char *x509key;
-#endif
-};
-
-struct VncState
-{
-    QEMUTimer *timer;
-    int csock;
-    DisplayState *ds;
-    VncDisplay *vd;
-    int need_update;
-    uint32_t dirty_row[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
-    char *old_data;
-    uint32_t features;
-    int absolute;
-    int last_x;
-    int last_y;
-
-    uint32_t vnc_encoding;
-    uint8_t tight_quality;
-    uint8_t tight_compression;
-
-    int major;
-    int minor;
-
-    char challenge[VNC_AUTH_CHALLENGE_SIZE];
-
-#ifdef CONFIG_VNC_TLS
-    int wiremode;
-    gnutls_session_t tls_session;
-#endif
-
-    Buffer output;
-    Buffer input;
-    /* current output mode information */
-    VncWritePixels *write_pixels;
-    VncSendHextileTile *send_hextile_tile;
-    DisplaySurface clientds, serverds;
-
-    CaptureVoiceOut *audio_cap;
-    struct audsettings as;
-
-    VncReadEvent *read_handler;
-    size_t read_handler_expect;
-    /* input */
-    uint8_t modifiers_state[256];
-
-    Buffer zlib;
-    Buffer zlib_tmp;
-    z_stream zlib_stream[4];
-
-    VncState *next;
-};
-
 static VncDisplay *vnc_display; /* needed for info vnc */
 static DisplayChangeListener *dcl;
 

Modified: trunk/vnc.h
===================================================================

vnc.h +147 -3

159 lines not on this page · raw message