Skip to content

feat(rdpeusb): implement urbdrc server processors#1394

Merged
Benoît Cortier (CBenoit) merged 7 commits into
Devolutions:masterfrom
uchouT:urbdrc-server
Jul 1, 2026
Merged

feat(rdpeusb): implement urbdrc server processors#1394
Benoît Cortier (CBenoit) merged 7 commits into
Devolutions:masterfrom
uchouT:urbdrc-server

Conversation

@uchouT

Copy link
Copy Markdown
Contributor

Part of #1138

  • Implement control and per-device urbdrc server processors, similar to the urbdrc client, maintaining a request_id -> pending_io at the state machine layer.
  • introduce backend-facing rdpeusb::io request and completion types shared by client and server implementations.
  • Refactor TsUrb variants, the rationale is documented in the 0d3d553 commit message.
  • As a follow-up to feat(rdpeusb): implement urbdrc client #1365, handle no-ack OUT transfers through a dedicated client backend method.

Note

Types in rdpeusb::io define a system boundary, worth good design.

cc Marc-Andre Lureau (@elmarco)

Signed-off-by: uchouT <i@uchout.moe>
Remove `TsUrbHeader` from each `TsUrb` variant so that `TsUrb` can
become a composable `TsUrbInKind` / `TsUrbOutKind`. This is useful for
creating `request id`-agnostic `TsUrbOutPacket` / `TsUrbOutPacket`
types.

By doing so, it prevents the backend from assigning an invalid request
id, cleanly delegating the responsibility of request id allocation
entirely to the server state machine.

Signed-off-by: uchouT <i@uchout.moe>
Signed-off-by: uchouT <i@uchout.moe>
Signed-off-by: uchouT <i@uchout.moe>
Signed-off-by: uchouT <i@uchout.moe>
@uchouT uchouT (uchouT) force-pushed the urbdrc-server branch 2 times, most recently from 437e06c to 762283a Compare June 30, 2026 23:34
@elmarco

Copy link
Copy Markdown
Contributor

lgtm, it could use more doc comments and tests, but I suppose this will come next.

How to trigger copilot checks? Benoît Cortier (@CBenoit)

@CBenoit Benoît Cortier (CBenoit) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m sorry, I need to trigger it manually for now, but I’m discussing internally about having them automatically

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the server-side RDPEUSB (URBDRC) protocol processors to ironrdp-rdpeusb, introduces a backend-facing rdpeusb::io data model shared by client/server, and refactors TS_URB representations to better separate headers from payload variants.

Changes:

  • Implement UrbdrcControlServer and UrbdrcDeviceServer state machines with request tracking (request_id -> pending_io) and completion dispatching.
  • Introduce crates/ironrdp-rdpeusb::io as a backend boundary for requests/completions used by both client and server.
  • Refactor TS_URB types and related PDU utilities, plus adjust testsuite imports and the client backend trait to support no-ack OUT transfers.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/ironrdp-testsuite-core/tests/rdpeusb/mod.rs Update testsuite imports to new rdpeusb::io::device types.
crates/ironrdp-testsuite-core/tests/rdpeusb/device.rs Switch device test helpers to rdpeusb::io::device module.
crates/ironrdp-testsuite-core/tests/rdpeusb/client.rs Align test backend with new io::* request/completion types and no-ack OUT API.
crates/ironrdp-rdpeusb/src/lib.rs Export new io module and server module.
crates/ironrdp-rdpeusb/src/io/mod.rs Add shared backend-facing request/completion types and server IO request wrapper.
crates/ironrdp-rdpeusb/src/io/device.rs Document and expose backend-neutral USB device descriptor/config information.
crates/ironrdp-rdpeusb/src/client.rs Refactor client backend boundary to use io::* types; add no-ack OUT handler.
crates/ironrdp-rdpeusb/src/server.rs New URBDRC server control/device processors with pending-IO tracking and completion routing.
crates/ironrdp-rdpeusb/src/pdu/utils.rs Improve decode error typing for transfer request IDs.
crates/ironrdp-rdpeusb/src/pdu/completion/mod.rs Adopt new RequestIdTransferInOut decode error type usage.
crates/ironrdp-rdpeusb/src/pdu/iface_manipulation.rs Add DvcEncode impl for InterfaceRelease to support DVC message dispatch.
crates/ironrdp-rdpeusb/src/pdu/usb_dev/mod.rs Update TS_URB access patterns and add DvcEncode impl for IoControl.
crates/ironrdp-rdpeusb/src/pdu/usb_dev/ts_urb/utils.rs Update TS_URB utility imports and make TsUrbHeader Copy.
crates/ironrdp-rdpeusb/src/pdu/usb_dev/ts_urb/mod.rs Refactor TS_URB in/out into {header, kind} structs and separate *Kind enums.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/ironrdp-rdpeusb/src/server.rs Outdated
Comment thread crates/ironrdp-rdpeusb/src/server.rs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@CBenoit Benoît Cortier (CBenoit) enabled auto-merge (squash) July 1, 2026 13:28
@CBenoit Benoît Cortier (CBenoit) merged commit 38980fc into Devolutions:master Jul 1, 2026
22 checks passed
@uchouT uchouT (uchouT) deleted the urbdrc-server branch July 1, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants