diff options
author | 2015-08-23 17:41:23 +0300 | |
---|---|---|
committer | 2015-08-23 17:41:23 +0300 | |
commit | 49f6b00b58c3ec734218fcd69259771a42c157bd (patch) | |
tree | ab31e2286ad6d426c4b565ce0c07e6e1eff06f1c /scripts/automation/trex_control_plane/python_lib/dpkt-1.8.6.2/dpkt/rfb.py | |
parent | 405ba254de0c62ac9f4395d04f918a3749635808 (diff) |
Added dkpt package, created basic shell for packetGen usage
Diffstat (limited to 'scripts/automation/trex_control_plane/python_lib/dpkt-1.8.6.2/dpkt/rfb.py')
-rw-r--r-- | scripts/automation/trex_control_plane/python_lib/dpkt-1.8.6.2/dpkt/rfb.py | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/python_lib/dpkt-1.8.6.2/dpkt/rfb.py b/scripts/automation/trex_control_plane/python_lib/dpkt-1.8.6.2/dpkt/rfb.py new file mode 100644 index 00000000..6a69892f --- /dev/null +++ b/scripts/automation/trex_control_plane/python_lib/dpkt-1.8.6.2/dpkt/rfb.py @@ -0,0 +1,90 @@ +# $Id: rfb.py 47 2008-05-27 02:10:00Z jon.oberheide $ +# -*- coding: utf-8 -*- +"""Remote Framebuffer Protocol.""" + +import dpkt + +# Remote Framebuffer Protocol +# http://www.realvnc.com/docs/rfbproto.pdf + +# Client to Server Messages +CLIENT_SET_PIXEL_FORMAT = 0 +CLIENT_SET_ENCODINGS = 2 +CLIENT_FRAMEBUFFER_UPDATE_REQUEST = 3 +CLIENT_KEY_EVENT = 4 +CLIENT_POINTER_EVENT = 5 +CLIENT_CUT_TEXT = 6 + +# Server to Client Messages +SERVER_FRAMEBUFFER_UPDATE = 0 +SERVER_SET_COLOUR_MAP_ENTRIES = 1 +SERVER_BELL = 2 +SERVER_CUT_TEXT = 3 + + +class RFB(dpkt.Packet): + __hdr__ = ( + ('type', 'B', 0), + ) + + +class SetPixelFormat(dpkt.Packet): + __hdr__ = ( + ('pad', '3s', ''), + ('pixel_fmt', '16s', '') + ) + + +class SetEncodings(dpkt.Packet): + __hdr__ = ( + ('pad', '1s', ''), + ('num_encodings', 'H', 0) + ) + + +class FramebufferUpdateRequest(dpkt.Packet): + __hdr__ = ( + ('incremental', 'B', 0), + ('x_position', 'H', 0), + ('y_position', 'H', 0), + ('width', 'H', 0), + ('height', 'H', 0) + ) + + +class KeyEvent(dpkt.Packet): + __hdr__ = ( + ('down_flag', 'B', 0), + ('pad', '2s', ''), + ('key', 'I', 0) + ) + + +class PointerEvent(dpkt.Packet): + __hdr__ = ( + ('button_mask', 'B', 0), + ('x_position', 'H', 0), + ('y_position', 'H', 0) + ) + + +class FramebufferUpdate(dpkt.Packet): + __hdr__ = ( + ('pad', '1s', ''), + ('num_rects', 'H', 0) + ) + + +class SetColourMapEntries(dpkt.Packet): + __hdr__ = ( + ('pad', '1s', ''), + ('first_colour', 'H', 0), + ('num_colours', 'H', 0) + ) + + +class CutText(dpkt.Packet): + __hdr__ = ( + ('pad', '3s', ''), + ('length', 'I', 0) + ) |