cebix/macemu — pull request #13 by clehner (2012-10-30 12:39:56+00:00)
Title: Port forwarding in slirp

This code parses a preference option `redir` for redirecting TCP and UDP ports. It is adapted from code in QEMU that does something similar.
This takes advantage of the `slirp_redir` function which is already in the codebase.

Using the `redir` option, servers running in Basilisk II can be accessed from outside the virtual network. The change could probably be applied to SheepShaver as well.

The form the option takes is `redir tcp:8000:10.0.2.15:80` to forward port 8000 in to port 80 on the guest OS. I'm not sure if it is useful for the client address to be specified though, since there is only one client. Is the address always 10.0.2.15?

Also, there seems to be a delay of 16 seconds when the guest machine starts listening on a TCP socket. I'm not sure where that is coming from or what to do about it.