MCPcopy
hub / github.com/GoSecure/pyrdp / writeConnectInitial

Method writeConnectInitial

pyrdp/parser/mcs.py:285–302  ·  view source on GitHub ↗

Encode a Connect Initial PDU :param stream: The destination stream to write into. :param pdu: the PDU to encode.

(self, stream: BytesIO, pdu: MCSConnectInitialPDU)

Source from the content-addressed store, hash-verified

283 stream.write(substream)
284
285 def writeConnectInitial(self, stream: BytesIO, pdu: MCSConnectInitialPDU):
286 """
287 Encode a Connect Initial PDU
288 :param stream: The destination stream to write into.
289 :param pdu: the PDU to encode.
290 """
291 substream = BytesIO()
292 substream.write(ber.writeOctetString(pdu.callingDomain))
293 substream.write(ber.writeOctetString(pdu.calledDomain))
294 substream.write(ber.writeBoolean(pdu.upward))
295 self.writeDomainParams(substream, pdu.targetParams)
296 self.writeDomainParams(substream, pdu.minParams)
297 self.writeDomainParams(substream, pdu.maxParams)
298 substream.write(ber.writeOctetString(pdu.payload))
299
300 data = substream.getvalue()
301 stream.write(ber.writeLength(len(data)))
302 stream.write(data)
303
304 def writeConnectResponse(self, stream: BytesIO, pdu: MCSConnectResponsePDU):
305 """

Callers

nothing calls this directly

Calls 3

writeDomainParamsMethod · 0.95
writeLengthMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected