def send(self, message): """ @summary: Send encompassed data @param message: {network.Type} message to send """ RawLayer.send(self, (UInt8(Action.FASTPATH_ACTION_X224), UInt8(0), UInt16Be(sizeof(message) + 4), message))
def __init__(self, listener): """ @param listener: listener use to inform new orders """ RawLayer.__init__(self) #set client listener self._clientListener = listener #useful for RFB protocol self._callbackBody = None #protocol version negotiated self._version = String(ProtocolVersion.RFB003008) #number security launch by server self._securityLevel = UInt8(SecurityType.INVALID) #shared FrameBuffer client init message self._sharedFlag = UInt8(False) #server init message #which contain FrameBuffer dim and pixel format self._serverInit = ServerInit() #client pixel format self._pixelFormat = PixelFormat() #server name self._serverName = String() #nb rectangle self._nbRect = 0 #current rectangle header self._currentRect = Rectangle() #for vnc security type self._password = '******' * 8
def sendFastPath(self, secFlag, fastPathS): """ @param fastPathS: type transform to stream and send as fastpath @param secFlag: {integer} Security flag for fastpath packet """ RawLayer.send( self, (UInt8(Action.FASTPATH_ACTION_FASTPATH | ((secFlag & 0x3) << 6)), UInt16Be((sizeof(fastPathS) + 3) | 0x8000), fastPathS))
def __init__(self, presentation): """ @param presentation: {Layer} presentation layer, in RDP case is x224 layer """ RawLayer.__init__(self, presentation) #length may be coded on more than 1 bytes self._lastShortLength = UInt8() #fast path listener self._fastPathListener = None #last secure flag self._secFlag = 0
def sendFastPath(self, secFlag, fastPathS): """ @param fastPathS: {Type | Tuple} type transform to stream and send as fastpath @param secFlag: {integer} Security flag for fastpath packet """ RawLayer.send(self, (UInt8(Action.FASTPATH_ACTION_FASTPATH | ((secFlag & 0x3) << 6)), UInt16Be((sizeof(fastPathS) + 3) | 0x8000), fastPathS))
def write(self, simpletype): RawLayer.send(self, simpletype)