I'm in the process of making a DLL-free script that uses the port mapping (forwarding) feature of UPnP-enabled Internet Gateways (routers) for Identd and DCC.

It's already working with Identd (with my NETGEAR router, at least) by opening the Identd port on ^LOGIN and closing it on CONNECT.

The thing is that I need some ideas on how to make it work with DCC sends, since I need to know the port that mIRC is listening on (to open it) before the connection is established, and then which port was used (to close it) after the connection ends or fails.

Thanks to the fact that $send doesn't have a "localport" property, so far, I've only thought of capturing the DCC Send PRIVMSG with a "/debug" window to extract the port mIRC is listening on and then close the port on FILESENT or SENDFAIL (somehow finding out which port was used), but this doesn't convince me entirely.

Can somebody give me a better DLL-free idea?