[p2p-hackers] Re: Getting started with UPnP on Win32
Scott C. Best
sbest at best.com
Fri Jul 8 21:06:50 UTC 2005
David:
Any mention in there how it handles multiple WinXP PC's
on the LAN in contention for the same port-forwarding adjustment?
cheers,
Scott
> Ah, I'll answer my own question:
>
> It appears WinXP has another API in the Platform SDK named "Network
> Address Translation". It's a wrapper over the UPnP NAT functionality
> (thus you don't touch the UPnP API directly). Rather, you use these
> basic steps:
>
> 1) Create a UPnPNAT COM object and get its IUPnPNAT interface
> 2) Call IUPnPNAT::get_StaticPortMappingCollection( )
> 3) IStaticPortMappingCollection::Add( ) to add configure a port forward
>
> At least, that's the theory. A C++ file showing it in action is here:
>
> http://cvs.sourceforge.net/viewcvs.py/dcplusplus/dcplusplus/windows/UPnP.cpp?rev=1.3
>
> Not sure how well the whole thing works and it only appears to work
> under XP, but it's a place to start.
>
> -david
<snip>
More information about the P2p-hackers
mailing list