server side

This commit is contained in:
citronneur
2014-07-13 16:25:47 +02:00
parent 5712c701ff
commit 088893fa63
2 changed files with 21 additions and 11 deletions

View File

@@ -388,7 +388,7 @@ def writeConferenceCreateRequest(settings):
"""
Write conference create request structure
@param settings: ClientSettings
@return: structure that represent
@return: gcc packet
"""
userData = writeClientDataBlocks(settings)
userDataStream = Stream()
@@ -400,6 +400,14 @@ def writeConferenceCreateRequest(settings):
per.writeNumberOfSet(1), per.writeChoice(0xc0),
per.writeOctetStream(h221_cs_key, 4), per.writeOctetStream(userDataStream.getvalue()))
def writeConferenceCreateResponse(settings):
"""
Write a conference create response packet
@param settings: ServerSettings
@return: gcc packet
"""
pass
def writeClientDataBlocks(settings):
"""
Write all blocks for client

View File

@@ -178,6 +178,9 @@ class MCS(LayerAutomata):
#we must receive a connect response
self.setNextState(self.recvConnectResponse)
def sendConnectResponse(self):
pass
def sendErectDomainRequest(self):
"""
Send a formated erect domain request for RDP connection
@@ -196,6 +199,14 @@ class MCS(LayerAutomata):
"""
self._transport.send((self.writeMCSPDUHeader(UInt8(DomainMCSPDU.CHANNEL_JOIN_REQUEST)), UInt16Be(self._userId), UInt16Be(channelId)))
def send(self, channelId, data):
"""
Specific send function for channelId
@param channelId: Channel use to send
@param data: message to send
"""
self._transport.send((self.writeMCSPDUHeader(UInt8(DomainMCSPDU.SEND_DATA_REQUEST)), UInt16Be(self._userId), UInt16Be(channelId), UInt8(0x70), UInt16Be(sizeof(data)) | UInt16Be(0x8000), data))
def recvConnectInitial(self, data):
"""
Receive MCS connect initial from client
@@ -318,16 +329,7 @@ class MCS(LayerAutomata):
print "receive data for an unconnected layer"
return
self._channelIds[channelId].recv(data)
def send(self, channelId, data):
"""
Specific send function for channelId
@param channelId: Channel use to send
@param data: message to send
"""
self._transport.send((self.writeMCSPDUHeader(UInt8(DomainMCSPDU.SEND_DATA_REQUEST)), UInt16Be(self._userId), UInt16Be(channelId), UInt8(0x70), UInt16Be(sizeof(data)) | UInt16Be(0x8000), data))
self._channelIds[channelId].recv(data)
def writeDomainParams(self, maxChannels, maxUsers, maxTokens, maxPduSize):
"""