1
2
3 """Remote Framebuffer Protocol."""
4 from __future__ import absolute_import
5
6 from . import dpkt
7
8
9
10
11
12 CLIENT_SET_PIXEL_FORMAT = 0
13 CLIENT_SET_ENCODINGS = 2
14 CLIENT_FRAMEBUFFER_UPDATE_REQUEST = 3
15 CLIENT_KEY_EVENT = 4
16 CLIENT_POINTER_EVENT = 5
17 CLIENT_CUT_TEXT = 6
18
19
20 SERVER_FRAMEBUFFER_UPDATE = 0
21 SERVER_SET_COLOUR_MAP_ENTRIES = 1
22 SERVER_BELL = 2
23 SERVER_CUT_TEXT = 3
24
25
26 -class RFB(dpkt.Packet):
27 """Remote Framebuffer Protocol.
28
29 TODO: Longer class information....
30
31 Attributes:
32 __hdr__: Header fields of RADIUS.
33 TODO.
34 """
35
36 __hdr__ = (
37 ('type', 'B', 0),
38 )
39
40
46
47
49 __hdr__ = (
50 ('pad', '1s', ''),
51 ('num_encodings', 'H', 0)
52 )
53
54
56 __hdr__ = (
57 ('incremental', 'B', 0),
58 ('x_position', 'H', 0),
59 ('y_position', 'H', 0),
60 ('width', 'H', 0),
61 ('height', 'H', 0)
62 )
63
64
66 __hdr__ = (
67 ('down_flag', 'B', 0),
68 ('pad', '2s', ''),
69 ('key', 'I', 0)
70 )
71
72
74 __hdr__ = (
75 ('button_mask', 'B', 0),
76 ('x_position', 'H', 0),
77 ('y_position', 'H', 0)
78 )
79
80
82 __hdr__ = (
83 ('pad', '1s', ''),
84 ('num_rects', 'H', 0)
85 )
86
87
89 __hdr__ = (
90 ('pad', '1s', ''),
91 ('first_colour', 'H', 0),
92 ('num_colours', 'H', 0)
93 )
94
95
96 -class CutText(dpkt.Packet):
97 __hdr__ = (
98 ('pad', '3s', ''),
99 ('length', 'I', 0)
100 )
101