In a nutshell, I’m developing an embedded system that requires, amongst other things, a bridge from a USB host port to a device port (this is just a first step, later the information transmitted will be filtered and altered).
Considering that this is basically a USB snooper/sniffer I figured that someone should have written a module capable of this, but my search has proven futile.
So, to the question: What’s the simplest way to redirect a USB host to a USB device in Linux? The data must be identical, all descriptors and endpoints must match. It must be Linux friendly, I can code in C/C++ and have some experience with coding kernel modules, drivers, etc.
I found previous work at http://www.elinux.org/BeagleBoard/GSoC/2010_Projects/USBSniffer
The simplest way to redirect a USB host to a USB device in Linux is in my opinion to use both the Linux’ peripheral USB stack and Linux’ gadget USB stack. Those stacks take care of the low level, so your code should only concern high level interfacing between those two stacks. Added bonus is that the sniffer (via usbmon) will come for almost free.
As that way will be dealing with the Linux kernel, it must be Linux friendly. The interface to both stacks is (at least) available in C. So, your conditions are met.