<div dir="ltr">Hi<br clear="all"><div><div><br></div><div>Just to let you know that I started a usbredir binding to Rust: <a href="https://gitlab.freedesktop.org/elmarco/usbredir-rs">https://gitlab.freedesktop.org/elmarco/usbredir-rs</a></div><div><br></div><div>Atm, it compiles with a custom rusb. I have some MR there (<a href="https://github.com/a1ien/rusb/pull/97">https://github.com/a1ien/rusb/pull/97</a> & <a href="https://github.com/a1ien/rusb/pull/101">https://github.com/a1ien/rusb/pull/101</a>)</div><div><br></div><div>See the example: <a href="https://gitlab.freedesktop.org/elmarco/usbredir-rs/-/blob/main/usbredirhost/examples/usbredir.rs">https://gitlab.freedesktop.org/elmarco/usbredir-rs/-/blob/main/usbredirhost/examples/usbredir.rs</a></div><div><br></div><div>Atm, I pass an open fd with bash for testing, ex:</div><div>exec 3<>/dev/tcp/localhost/7777</div><div>target/debug/examples/usbredir '1050:0407' --fd 3</div><div><br></div><div>Next, it could be extended this with [--tcp host:port], [--unix path], [-l|--listen]. Then I suppose it will be close to <a href="https://gitlab.freedesktop.org/spice/usbredir/-/blob/master/tools/usbredirect.c">https://gitlab.freedesktop.org/spice/usbredir/-/blob/master/tools/usbredirect.c</a></div></div><div><br></div><div>(Note that the Rust code doesn't use poll(), since it isn't portable. See <a href="https://libusb.sourceforge.io/api-1.0/group__libusb__poll.html#libusb_pollmain">https://libusb.sourceforge.io/api-1.0/group__libusb__poll.html#libusb_pollmain</a>. The libusb/usbredir APIs don't make it easy to handle events..)</div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Marc-AndrĂ© Lureau<br></div></div></div>