Package dpkt :: Module rfb
[hide private]
[frames] | no frames]

Source Code for Module dpkt.rfb

 1  # $Id: rfb.py 47 2008-05-27 02:10:00Z jon.oberheide $ 
 2   
 3  """Remote Framebuffer Protocol.""" 
 4   
 5  import dpkt 
 6   
 7  # Remote Framebuffer Protocol 
 8  # http://www.realvnc.com/docs/rfbproto.pdf 
 9   
10  # Client to Server Messages 
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  # Server to Client Messages 
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
29 -class SetPixelFormat(dpkt.Packet):
30 __hdr__ = ( 31 ('pad', '3s', ''), 32 ('pixel_fmt', '16s', '') 33 )
34
35 -class SetEncodings(dpkt.Packet):
36 __hdr__ = ( 37 ('pad', '1s', ''), 38 ('num_encodings', 'H', 0) 39 )
40
41 -class FramebufferUpdateRequest(dpkt.Packet):
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
50 -class KeyEvent(dpkt.Packet):
51 __hdr__ = ( 52 ('down_flag', 'B', 0), 53 ('pad', '2s', ''), 54 ('key', 'I', 0) 55 )
56
57 -class PointerEvent(dpkt.Packet):
58 __hdr__ = ( 59 ('button_mask', 'B', 0), 60 ('x_position', 'H', 0), 61 ('y_position', 'H', 0) 62 )
63
64 -class FramebufferUpdate(dpkt.Packet):
65 __hdr__ = ( 66 ('pad', '1s', ''), 67 ('num_rects', 'H', 0) 68 )
69
70 -class SetColourMapEntries(dpkt.Packet):
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