[Top][All Lists]
[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: |
Alexander Graf |
Subject: |
[Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h |
Date: |
Thu, 29 Jan 2009 16:29:14 +0100 |
User-agent: |
Thunderbird 2.0.0.18 (X11/20081112) |
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.
>
>> +#define VNC_ENCODING_ZRLE 0x00000010
>> +#define VNC_ENCODING_COMPRESSLEVEL0 0xFFFFFF00
>> +#define VNC_ENCODING_QUALITYLEVEL0 0xFFFFFFE0
>> +#define VNC_ENCODING_XCURSOR 0xFFFFFF10
>> +#define VNC_ENCODING_RICH_CURSOR 0xFFFFFF11
>> +#define VNC_ENCODING_POINTER_POS 0xFFFFFF18
>>
> Nor was this.
>> +#define VNC_ENCODING_LASTRECT 0xFFFFFF20
>>
> Nor this.
>> +#define VNC_ENCODING_DESKTOPRESIZE 0xFFFFFF21
>> +#define VNC_ENCODING_POINTER_TYPE_CHANGE 0XFFFFFEFF
>> +#define VNC_ENCODING_EXT_KEY_EVENT 0XFFFFFEFE
>> +#define VNC_ENCODING_AUDIO 0XFFFFFEFD
>> +#define VNC_ENCODING_WMVi 0x574D5669
>> +
>> +/* signatures for basic encoding types */
>> +#define VNC_ENCODING_RAW_SIG "RAW_____"
>> +#define VNC_ENCODING_COPYRECT_SIG "COPYRECT"
>> +#define VNC_ENCODING_RRE_SIG "RRE_____"
>> +#define VNC_ENCODING_CORRE_SIG "CORRE___"
>> +#define VNC_ENCODING_HEXTILE_SIG "HEXTILE_"
>> +#define VNC_ENCODING_ZLIB_SIG "ZLIB____"
>> +#define VNC_ENCODING_TIGHT_SIG "TIGHT___"
>> +#define VNC_ENCODING_ZLIBHEX_SIG "ZLIBHEX_"
>> +#define VNC_ENCODING_ZRLE_SIG "ZRLE____"
>> +#define VNC_ENCODING_COMPRESSLEVEL0_SIG "COMPRLVL"
>> +#define VNC_ENCODING_QUALITYLEVEL0_SIG "JPEGQLVL"
>>
>
> These are not part of the standard either. I'm not sure what they do.
>
>> +/*****************************************************************************
>>
>> + *
>> + * Other tight constants
>> + *
>> +
>> *****************************************************************************/
>>
>> +
>> +/*
>> + * Vendors known by TightVNC: standard VNC/RealVNC, TridiaVNC, and
>> TightVNC.
>> + */
>> +
>> +#define VNC_VENDOR_STANDARD "STDV"
>> +#define VNC_VENDOR_TRIDIA "TRDV"
>> +#define VNC_VENDOR_TIGHT "TGHT"
>>
>
> This also is not part of the standard.
>
> Regards,
>
> Anthony Liguori
>
>> +#define VNC_TIGHT_CCB_RESET_MASK (0x0f)
>> +#define VNC_TIGHT_CCB_TYPE_MASK (0x0f << 4)
>> +#define VNC_TIGHT_CCB_TYPE_FILL (0x08 << 4)
>> +#define VNC_TIGHT_CCB_TYPE_JPEG (0x09 << 4)
>> +#define VNC_TIGHT_CCB_BASIC_MAX (0x07 << 4)
>> +#define VNC_TIGHT_CCB_BASIC_ZLIB (0x03 << 4)
>> +#define VNC_TIGHT_CCB_BASIC_FILTER (0x04 << 4)
>> +
>> +/*****************************************************************************
>>
>> + *
>> + * Features
>> + *
>> +
>> *****************************************************************************/
>>
>> +
>> +#define VNC_FEATURE_RESIZE 0
>> +#define VNC_FEATURE_HEXTILE 1
>> +#define VNC_FEATURE_POINTER_TYPE_CHANGE 2
>> +#define VNC_FEATURE_WMVI 3
>> +#define VNC_FEATURE_TIGHT 4
>> +#define VNC_FEATURE_TIGHT_PROTOCOL 5
>> +
>> +#define VNC_FEATURE_RESIZE_MASK (1 << VNC_FEATURE_RESIZE)
>> +#define VNC_FEATURE_HEXTILE_MASK (1 << VNC_FEATURE_HEXTILE)
>> +#define VNC_FEATURE_POINTER_TYPE_CHANGE_MASK (1 <<
>> VNC_FEATURE_POINTER_TYPE_CHANGE)
>> +#define VNC_FEATURE_WMVI_MASK (1 << VNC_FEATURE_WMVI)
>> +#define VNC_FEATURE_TIGHT_MASK (1 << VNC_FEATURE_TIGHT)
>> +#define VNC_FEATURE_TIGHT_PROTOCOL_MASK (1 <<
>> VNC_FEATURE_TIGHT_PROTOCOL)
>> +
>> +#endif /* __VNCTIGHT_H */
>>
>
- [Qemu-devel] [PATCH 7/7] Add tight encoding (jpeg) to vnc.c, (continued)
- [Qemu-devel] Re: [PATCH 6/7] Add tight protocol awareness to vnc.c, Anthony Liguori, 2009/01/29
- [Qemu-devel] Re: [PATCH 6/7] Add tight protocol awareness to vnc.c, Alexander Graf, 2009/01/29
- [Qemu-devel] Re: [PATCH 6/7] Add tight protocol awareness to vnc.c, Anthony Liguori, 2009/01/29
- [Qemu-devel] Re: [PATCH 4/7] Make vnc buffer big-chunk aware, Anthony Liguori, 2009/01/29
- [Qemu-devel] Re: [PATCH 4/7] Make vnc buffer big-chunk aware, Alexander Graf, 2009/01/29
[Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h, Anthony Liguori, 2009/01/29