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  # -*- coding: utf-8 -*- 
  3  """Remote Framebuffer Protocol.""" 
  4  from __future__ import absolute_import 
  5   
  6  from . import dpkt 
  7   
  8  # Remote Framebuffer Protocol 
  9  # http://www.realvnc.com/docs/rfbproto.pdf 
 10   
 11  # Client to Server Messages 
 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  # Server to Client Messages 
 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
41 -class SetPixelFormat(dpkt.Packet):
42 __hdr__ = ( 43 ('pad', '3s', ''), 44 ('pixel_fmt', '16s', '') 45 )
46 47
48 -class SetEncodings(dpkt.Packet):
49 __hdr__ = ( 50 ('pad', '1s', ''), 51 ('num_encodings', 'H', 0) 52 )
53 54
55 -class FramebufferUpdateRequest(dpkt.Packet):
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
65 -class KeyEvent(dpkt.Packet):
66 __hdr__ = ( 67 ('down_flag', 'B', 0), 68 ('pad', '2s', ''), 69 ('key', 'I', 0) 70 )
71 72
73 -class PointerEvent(dpkt.Packet):
74 __hdr__ = ( 75 ('button_mask', 'B', 0), 76 ('x_position', 'H', 0), 77 ('y_position', 'H', 0) 78 )
79 80
81 -class FramebufferUpdate(dpkt.Packet):
82 __hdr__ = ( 83 ('pad', '1s', ''), 84 ('num_rects', 'H', 0) 85 )
86 87
88 -class SetColourMapEntries(dpkt.Packet):
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