15.1.1 ProtocolVersion: 12, 12 bytes
2
3    - Sent by server, max supported
4        12 ascii - "RFB 003.008\n"
5    - Response by client, version to use
6        12 ascii - "RFB 003.003\n"
7
85.1.2 Authentication: >=4, [16, 4] bytes
9
10    - Sent by server
11        CARD32 - authentication-scheme
12                0 - connection failed
13                    CARD32 - length
14                    length - reason
15                1 - no authentication
16
17                2 - VNC authentication
18                    16 CARD8 - challenge (random bytes)
19
20    - Response by client (if VNC authentication)
21        16 CARD8 - client encrypts the challenge with DES, using user
22                   password as key, sends resulting 16 byte response
23
24    - Response by server (if VNC authentication)
25        CARD32 - 0 - OK
26                 1 - failed
27                 2 - too-many
28
295.1.3 ClientInitialisation: 1 byte
30    - Sent by client
31        CARD8 - shared-flag, 0 exclusive, non-zero shared
32
335.1.4 ServerInitialisation: >=24 bytes
34    - Sent by server
35        CARD16 - framebuffer-width
36        CARD16 - framebuffer-height
37        16 byte PIXEL_FORMAT - server-pixel-format
38            CARD8 - bits-per-pixel
39            CARD8 - depth
40            CARD8 - big-endian-flag, non-zero is big endian
41            CARD8 - true-color-flag, non-zero then next 6 apply
42            CARD16 - red-max
43            CARD16 - green-max
44            CARD16 - blue-max
45            CARD8 - red-shift
46            CARD8 - green-shift
47            CARD8 - blue-shift
48            3 bytes - padding
49        CARD32 - name-length
50
51        CARD8[length] - name-string
52
53
54
55Client to Server Messages:
56
575.2.1 SetPixelFormat: 20 bytes
58    CARD8: 0 - message-type
59    ...
60
615.2.2 FixColourMapEntries: >=6 bytes
62    CARD8: 1 - message-type
63    ...
64
655.2.3 SetEncodings: >=8 bytes
66    CARD8: 2 - message-type
67    CARD8    - padding
68    CARD16   - numer-of-encodings
69
70    CARD32   - encoding-type in preference order
71        0 - raw
72        1 - copy-rectangle
73        2 - RRE
74        4 - CoRRE
75        5 - hextile
76
775.2.4 FramebufferUpdateRequest (10 bytes)
78    CARD8: 3 - message-type
79    CARD8    - incremental (0 for full-update, non-zero for incremental)
80    CARD16   - x-position
81    CARD16   - y-position
82    CARD16   - width
83    CARD16   - height
84
85
865.2.5 KeyEvent: 8 bytes
87    CARD8: 4 - message-type
88    CARD8    - down-flag
89    2 bytes  - padding
90    CARD32   - key (X-Windows keysym values)
91
925.2.6 PointerEvent: 6 bytes
93    CARD8: 5 - message-type
94    CARD8    - button-mask
95    CARD16   - x-position
96    CARD16   - y-position
97
985.2.7 ClientCutText: >=9 bytes
99    CARD8: 6 - message-type
100    ...
101
102
103Server to Client Messages:
104
1055.3.1 FramebufferUpdate
106    CARD8: 0 - message-type
107    1 byte   - padding
108    CARD16   - number-of-rectangles
109
110    CARD16   - x-position
111    CARD16   - y-position
112    CARD16   - width
113    CARD16   - height
114    CARD16   - encoding-type:
115        0 - raw
116        1 - copy rectangle
117        2 - RRE
118        4 - CoRRE
119        5 - hextile
120
121        raw:
122            - width x height pixel values
123
124        copy rectangle:
125            CARD16 - src-x-position
126            CARD16 - src-y-position
127
128        RRE:
129            CARD32  - N number-of-subrectangles
130            Nxd bytes - background-pixel-value (d bits-per-pixel)
131
132        ...
133
1345.3.2 SetColourMapEntries (no support)
135    CARD8: 1 - message-type
136    ...
137
1385.3.3 Bell
139    CARD8: 2 - message-type
140
1415.3.4 ServerCutText
142    CARD8: 3 - message-type
143
144
145
146
147
148