Remove NatStrategy upnp and pmp

This commit is contained in:
Arnaud 2026-05-08 17:20:04 +04:00
parent 3460a3b266
commit 6a99e218d7
No known key found for this signature in database
GPG Key ID: A6C7C781817146FA
3 changed files with 2 additions and 7 deletions

View File

@ -158,7 +158,7 @@ type
nat* {.
desc:
"Specify method to use for determining public address. " &
"Must be one of: auto, upnp, pmp, extip:<IP>.",
"Must be one of: auto, extip:<IP>.",
defaultValue: defaultNatConfig(),
defaultValueDesc: "auto",
name: "nat"
@ -419,10 +419,6 @@ func parse*(T: type NatConfig, p: string): Result[NatConfig, string] =
case p.toLowerAscii
of "auto":
return ok(NatConfig(hasExtIp: false, nat: NatStrategy.NatAuto))
of "upnp":
return ok(NatConfig(hasExtIp: false, nat: NatStrategy.NatUpnp))
of "pmp":
return ok(NatConfig(hasExtIp: false, nat: NatStrategy.NatPmp))
else:
if p.startsWith("extip:"):
try:

View File

@ -15,8 +15,6 @@ const NATPMP_LIFETIME* = 60 * 60 # seconds
type NatStrategy* = enum
NatAuto
NatUpnp
NatPmp
type NatIpProtocol* = enum
Tcp

View File

@ -143,6 +143,7 @@ suite "NAT - UPnP port mapping (requires NAT_TEST_UPNP=1)":
test "mapPorts and cleanup":
if getEnv("NAT_TEST_UPNP") != "1":
skip()
return
let res = UpnpDevice.init()
check res.isOk