4 Commits

Author SHA1 Message Date
julianknodt
66a61e1b32 Move upnp portmap to separate fn
This isolates the upnp portmapping to another function

Signed-off-by: julianknodt <julianknodt@gmail.com>
2021-06-16 22:58:21 -07:00
julianknodt
cb2d9c13fe Enable UPnP portmapping
This actually adds portmapping in UPnP, which is checked after NAT-PMP.

Signed-off-by: julianknodt <julianknodt@gmail.com>
2021-06-16 11:03:24 -07:00
julianknodt
c6b92ddda8 Copy goupnp client into our repo
goupnp is an existing upnp client for go, which provides all the functionality we need, licensed
under BSD-2-Clause, so we can copy it over and modify parts of it for our case.
Specifically, we add contexts to all the methods so we can better handle timeouts, remove the
dependency on large charsets, and (eventually) trim out extra components we don't need.

Signed-off-by: julianknodt <julianknodt@gmail.com>
2021-06-14 13:40:02 -07:00
julianknodt
caceeff374 net/portmapper: add stateful prober
Previously, the prober was stateless, and probe needed to be called manually whenever additional
probes were required. This adds a stateful prober, which can theoretically reuse clients
between runs and have smarter strategies for delays between retries, which may be crucial
depending on how slow UPnP is.

Signed-off-by: julianknodt <julianknodt@gmail.com>
2021-06-14 12:55:03 -07:00