On 28/10/2008 16:01:43, Mark Rogers wrote:
I want to (a) listen on port 10000 on my desktop, (b) configure the server to think the device is my desktop, (c) forward any data I get on port 10000 to port 10000 on the device, and send any replies back whilst (d) logging everything going to/from the device.
I remember many years ago I wrote something to do this. It ran under inetd which means when the program concerned gets started the connection to the client (in your case the device) is stdin/stdout so the rest of the code did socket/bind/connect to the real server, forked into two processes each in a read/write/log loop, one reading stdin and forwarding to the server the other reading from the server and sending to stdout.
I could look but this was a long time ago so I may not have the code now.
If I was in your situation these days I would first see if I could work out what was going on by getting the device and my desktop on a common LAN and then use wireshark (previously ethereal) on the desktop to sniff in promiscous mode to see what is happenning. If that failed then I'd have to try the man in the middle that you describe.
Regards, Steve.