uPNP router port forwarding

500 Views Asked by At

I made a upnp mini client (c++, no libraries) that open a port on the modem/router. It send the "AddPortMapping" when it sees a "urn:schemas-upnp-org:service:WANIPConnection:" device.

The question is, what other device class should I send the "AddPortMapping" ? What other device can have the internet connection (and support the addport command) ?

I tryed to read the documentation, but its very confusing. Thanks

Bonus question: Is there any trending new tech to do that?

1

There are 1 best solutions below

1
On

The question is, what other device class should I send the "AddPortMapping" ? What other device can have the internet connection (and support the addport command) ?

I wonder if there's a misunderstanding of concepts here: Devices implement services (in programming languages services would be called interfaces). Services are a way for devices to promise to provide a specific API.

AddPortMapping() is part of the WANIPConnection service definition. All kinds of devices might support the method but you find all of these devices by looking for the WANIPConnection service.