std::function< void(const PortMapResult &)> PortMapCallback
Callback invoked whenever a mapping is established, refreshed, removed or fails.
PortMapTransport
Which NAT traversal backend produced a result.
PortMapProtocol
Transport protocol of a port mapping.
const char * to_string(PortMapProtocol p)
Human readable protocol name ("TCP"/"UDP").
Result of a port mapping attempt.
uint16_t internal_port
Local (LAN) port that was mapped.
uint16_t external_port
Public (WAN) port assigned by the router.
std::string error
Human readable error when !success.
PortMapTransport transport
Backend that produced this result.
bool success
Whether the mapping is currently active.
std::string external_ip
Discovered public IP (may be empty)
PortMapProtocol protocol
Protocol of the mapping.
Configuration for automatic port forwarding (see PortMappingService).
bool enable_upnp
Use the UPnP IGD backend.
bool enable_natpmp
Use the NAT-PMP backend.
bool enabled
Master switch for automatic port forwarding.
uint32_t lease_duration_seconds
Requested lease duration.