qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h


From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h
Date: Thu, 29 Jan 2009 09:46:21 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Alexander Graf wrote:
Anthony Liguori wrote:
Alexander Graf wrote:
The VNC protocol contains quite some constants, some of which are
currently hardcoded in the vnc.c code. This is not exactly pretty.

Let's move all those constants out to vnc.h, so they are clearly
separated. While at it, I also included other defines that will be
used later in this patch series.
A much needed change.

diff --git a/vnc.h b/vnc.h
new file mode 100644
index 0000000..ae69bc3
--- /dev/null
+++ b/vnc.h
@@ -0,0 +1,130 @@
+#ifndef __VNCTIGHT_H
+#define __VNCTIGHT_H
+
+/*****************************************************************************

+ *
+ * Authentication modes
+ *
+
*****************************************************************************/

+
+enum {
+    VNC_AUTH_INVALID = 0,
+    VNC_AUTH_NONE = 1,
+    VNC_AUTH_VNC = 2,
+    VNC_AUTH_RA2 = 5,
+    VNC_AUTH_RA2NE = 6,
+    VNC_AUTH_TIGHT = 16,
+    VNC_AUTH_ULTRA = 17,
+    VNC_AUTH_TLS = 18,
+    VNC_AUTH_VENCRYPT = 19
+};
+
+#define VNC_AUTH_NONE_SIG "NOAUTH__"
+#define VNC_AUTH_VNC_SIG  "VNCAUTH_"
These AUTH sigs are not part of the standard as far as I'm aware of
it.  This is the VNC_AUTH_TIGHT stuff?  I'd rather not do that.

Right. That is the follow-up from AUTH_TIGHT. Tight uses signatures in
general as addition to normal codes. The same thing applies to the
encoding signatures. These are required for the "Hey client, I know
these encodings" packet.

+
+#define VNC_ENCODING_RAW                  0x00000000
+#define VNC_ENCODING_COPYRECT             0x00000001
+#define VNC_ENCODING_RRE                  0x00000002
+#define VNC_ENCODING_CORRE                0x00000004
+#define VNC_ENCODING_HEXTILE              0x00000005
+#define VNC_ENCODING_ZLIB                 0x00000006
+#define VNC_ENCODING_TIGHT                0x00000007
+#define VNC_ENCODING_ZLIBHEX              0x00000008
This was never standardized.

From rfbproto.h of current tightvnc:

#define rfbEncodingRaw       0
#define rfbEncodingCopyRect  1
#define rfbEncodingRRE       2
#define rfbEncodingCoRRE     4
#define rfbEncodingHextile   5
#define rfbEncodingZlib      6
#define rfbEncodingTight     7
#define rfbEncodingZlibHex   8
#define rfbEncodingZRLE     16
[...]
#define rfbEncodingXCursor         0xFFFFFF10
#define rfbEncodingRichCursor      0xFFFFFF11
#define rfbEncodingPointerPos      0xFFFFFF18

#define rfbEncodingLastRect        0xFFFFFF20
#define rfbEncodingNewFBSize       0xFFFFFF21

Where else should I look for defines? I'd rather have them here and if
anything collide than not in any header files.

http://www.realvnc.com/docs/rfbproto.pdf is where the protocol is defined. Early in VNC's life, when TightVNC first fork()'d from RealVNC, there was no formal protocol definition. This led to some incompatible implementations so if you want to maintain compatibility with the largest number of clients, it's best to stick to what's defined by the standard.

Regards,

Anthony Liguori





reply via email to

[Prev in Thread] Current Thread [Next in Thread]