qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h
Date: Thu, 29 Jan 2009 16:29:14 +0100	[thread overview]
Message-ID: <4981CB4A.9070303@suse.de> (raw)
In-Reply-To: <4981C9B2.20709@codemonkey.ws>

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 */
>>   
>

  reply	other threads:[~2009-01-29 15:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 11:24 [Qemu-devel] [PATCH 0/7] Add tight support to VNC Alexander Graf
2009-01-29 11:24 ` [Qemu-devel] [PATCH 1/7] Split VNC defines to vnc.h Alexander Graf
2009-01-29 11:24   ` [Qemu-devel] [PATCH 2/7] Use VNC protocol defines Alexander Graf
2009-01-29 11:24     ` [Qemu-devel] [PATCH 3/7] Fix invalid #if in vnc.c when debugging is enabled Alexander Graf
2009-01-29 11:24       ` [Qemu-devel] [PATCH 4/7] Make vnc buffer big-chunk aware Alexander Graf
2009-01-29 11:24         ` [Qemu-devel] [PATCH 5/7] Split vnc authentication code Alexander Graf
2009-01-29 11:24           ` [Qemu-devel] [PATCH 6/7] Add tight protocol awareness to vnc.c Alexander Graf
2009-01-29 11:24             ` [Qemu-devel] [PATCH 7/7] Add tight encoding (jpeg) " Alexander Graf
2009-01-29 15:17               ` [Qemu-devel] " Anthony Liguori
2009-01-29 15:23                 ` Stefano Stabellini
2009-01-29 15:47                   ` Anthony Liguori
2009-01-29 15:13             ` [Qemu-devel] Re: [PATCH 6/7] Add tight protocol awareness " Anthony Liguori
2009-01-29 15:24               ` Alexander Graf
2009-01-29 15:43                 ` Anthony Liguori
2009-01-29 15:11         ` [Qemu-devel] Re: [PATCH 4/7] Make vnc buffer big-chunk aware Anthony Liguori
2009-01-29 15:16           ` Alexander Graf
2009-01-29 15:22   ` [Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h Anthony Liguori
2009-01-29 15:29     ` Alexander Graf [this message]
2009-01-29 15:46       ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2009-01-30 14:38 [Qemu-devel] [PATCH 0/7] Add zlib support to VNC server Alexander Graf
2009-01-30 14:38 ` [Qemu-devel] [PATCH 1/7] Split VNC defines to vnc.h Alexander Graf
2009-02-02 15:58   ` [Qemu-devel] " Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4981CB4A.9070303@suse.de \
    --to=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).