1
2
3 """Remote Framebuffer Protocol."""
4
5 import dpkt
6
7
8
9
10
11 CLIENT_SET_PIXEL_FORMAT = 0
12 CLIENT_SET_ENCODINGS = 2
13 CLIENT_FRAMEBUFFER_UPDATE_REQUEST = 3
14 CLIENT_KEY_EVENT = 4
15 CLIENT_POINTER_EVENT = 5
16 CLIENT_CUT_TEXT = 6
17
18
19 SERVER_FRAMEBUFFER_UPDATE = 0
20 SERVER_SET_COLOUR_MAP_ENTRIES = 1
21 SERVER_BELL = 2
22 SERVER_CUT_TEXT = 3
23
24 -class RFB(dpkt.Packet):
25 __hdr__ = (
26 ('type', 'B', 0),
27 )
28
34
36 __hdr__ = (
37 ('pad', '1s', ''),
38 ('num_encodings', 'H', 0)
39 )
40
42 __hdr__ = (
43 ('incremental', 'B', 0),
44 ('x_position', 'H', 0),
45 ('y_position', 'H', 0),
46 ('width', 'H', 0),
47 ('height', 'H', 0)
48 )
49
51 __hdr__ = (
52 ('down_flag', 'B', 0),
53 ('pad', '2s', ''),
54 ('key', 'I', 0)
55 )
56
58 __hdr__ = (
59 ('button_mask', 'B', 0),
60 ('x_position', 'H', 0),
61 ('y_position', 'H', 0)
62 )
63
65 __hdr__ = (
66 ('pad', '1s', ''),
67 ('num_rects', 'H', 0)
68 )
69
71 __hdr__ = (
72 ('pad', '1s', ''),
73 ('first_colour', 'H', 0),
74 ('num_colours', 'H', 0)
75 )
76
77 -class CutText(dpkt.Packet):
78 __hdr__ = (
79 ('pad', '3s', ''),
80 ('length', 'I', 0)
81 )
82