feat(connector,session): dispatch multitransport PDUs on IO channel#1108
feat(connector,session): dispatch multitransport PDUs on IO channel#1108Greg Lamberson (glamberson) wants to merge 1 commit intoDevolutions:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Surfaces server “Initiate Multitransport Request” PDUs received on the IO channel up through the session layer (and FFI) so applications can react during the active stage, using a fast discrimination path between ShareControlHeader and BasicSecurityHeader.
Changes:
- Update IO-channel decoding to opportunistically decode
MultitransportRequestPdubefore falling back toShareControlHeader. - Propagate and improve visibility of multitransport request events through
ProcessorOutput/ActiveStageOutput(incl. structured logging). - Adjust FFI-facing documentation around deferred exposure of the security cookie.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/ironrdp-connector/src/legacy.rs |
Adds/encapsulates multitransport discrimination logic in IO-channel decode path. |
crates/ironrdp-session/src/x224/mod.rs |
Improves docs and emits structured debug fields when receiving multitransport requests. |
crates/ironrdp-session/src/active_stage.rs |
Updates ActiveStageOutput docs for multitransport request propagation. |
ffi/src/session/mod.rs |
Updates diplomat-exposed docs for multitransport request field availability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add MultitransportRequest variant to IoChannelPdu, ActiveStageOutput, and ProcessorOutput to surface server-initiated multitransport requests through the session layer. Applications receive MultitransportRequest events and can establish sideband UDP transports. Discriminate BasicSecurityHeader from ShareControlHeader by checking bytes [2..4]: ShareControl always has pduType | PROTOCOL_VERSION (>= 0x11) at that offset, while BasicSecurityHeader has flagsHi == 0. Changes: - ironrdp-connector: add multitransport discriminant to decode_io_channel - ironrdp-session: propagate MultitransportRequest through x224 processor - ffi: expose MultitransportRequest type via diplomat bindings
1f3e3f4 to
57fefac
Compare
|
Of course, as 1098 evolves the importance of this PR will change. It looks like it my only be relevant for reconnect scnarios per MS-RDPBCGR 2.2.15.1 . |
|
Closing this: the IO channel dispatch logic is fully covered by #1096, which was merged on Feb 13. Rebasing this branch onto current master produces zero diff, confirming everything here is already upstream. The session-layer multitransport question (whether to surface MultitransportRequest during active sessions for reconnect scenarios per MS-RDPBCGR 2.2.15.1) is tracked as a design question on #1098 instead. |
Companion to #1098 — surfaces multitransport request PDUs through the session layer so applications can respond.
What this does
After licensing, the server may send Initiate Multitransport Request PDUs on the IO channel. These use a
BasicSecurityHeaderrather than the usualShareControlHeader, so they need special discrimination indecode_io_channel.This PR:
MultitransportRequestvariant toIoChannelPduand discriminates it fromShareControlHeaderby checking bytes[2..4]—ShareControlalways haspduType | PROTOCOL_VERSION(≥0x11) at that offset, whileBasicSecurityHeaderhasflagsHi == 0.MultitransportRequestthroughProcessorOutput→ActiveStageOutputso applications receive the event.Discrimination approach
The key insight is that
ShareControlHeaderencodespduType | PROTOCOL_VERSIONat bytes[2..4], which is always>= 0x11. ABasicSecurityHeaderwithTRANSPORT_REQflag hasflagsHi == 0at that same offset. This lets us cheaply distinguish the two header types without backtracking.The discriminant logic uses an inner function (
try_decode_multitransport) per the project's style guide preference for inner functions over single-use closures.Relationship to #1098
MultitransportBootstrapping).Both are needed for full multitransport support, but they're independent — each modifies different files and can be reviewed/merged in either order.
Builds on: #1091
Related: #1098, #140