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>
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>
* move probing out of netcheck into new net/portmapper package
* use PCP ANNOUNCE op codes for PCP discovery, rather than causing
short-lived (sub-second) side effects with a 1-second-expiring map +
delete.
* track when we heard things from the router so we can be less wasteful
in querying the router's port mapping services in the future
* use portmapper from magicsock to map a public port
Fixes#1298Fixes#1080Fixes#1001
Updates #864
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>