ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
nat_upnp_context Struct Reference

Handle to UPnP context. More...

#include <include/ascii-chat/network/nat/upnp.h>

Data Fields

char external_ip [16]
 Detected external/public IP (e.g., "203.0.113.42").
uint16_t mapped_port
 External port that was mapped (may differ from internal).
uint16_t internal_port
 Internal port we're binding to.
char device_description [256]
 Archer C7").
bool is_natpmp
 true if NAT-PMP was used, false if UPnP
char internal_ip [16]
 LAN address used by the gateway to reach us.
char * control_url
 Owned UPnP control URL.
char service_type [128]
 UPnP service used to create the mapping.
char description [128]
 Mapping description reused on renewal.
uint32_t gateway
 NAT-PMP gateway, in network byte order.
uint32_t lease_seconds
 Granted/requested lease duration.
uint64_t expires_at_ns
 Monotonic lease expiry.
uint64_t refresh_at_ns
 Next renewal or retry deadline.
bool is_mapped
 true if port mapping is currently active
nat_upnp_protocol_t protocol
 Transport of this mapping.
bool external_is_private
 Gateway reported an upstream NAT; mapping remains locally usable.

Detailed Description

Handle to UPnP context.

Definition at line 30 of file upnp.h.

Field Documentation

◆ control_url

char* nat_upnp_context::control_url

Owned UPnP control URL.

Definition at line 38 of file upnp.h.

◆ description

char nat_upnp_context::description[128]

Mapping description reused on renewal.

Definition at line 40 of file upnp.h.

◆ device_description

char nat_upnp_context::device_description[256]

Archer C7").

Device name for logging (e.g., "TP-Link

Definition at line 34 of file upnp.h.

◆ expires_at_ns

uint64_t nat_upnp_context::expires_at_ns

Monotonic lease expiry.

Definition at line 43 of file upnp.h.

Referenced by nat_upnp_is_active().

◆ external_ip

char nat_upnp_context::external_ip[16]

Detected external/public IP (e.g., "203.0.113.42").

Definition at line 31 of file upnp.h.

Referenced by nat_upnp_get_address(), nat_upnp_get_endpoint(), nat_upnp_is_active(), and nat_upnp_refresh().

◆ external_is_private

bool nat_upnp_context::external_is_private

Gateway reported an upstream NAT; mapping remains locally usable.

Definition at line 47 of file upnp.h.

◆ gateway

uint32_t nat_upnp_context::gateway

NAT-PMP gateway, in network byte order.

Definition at line 41 of file upnp.h.

◆ internal_ip

char nat_upnp_context::internal_ip[16]

LAN address used by the gateway to reach us.

Definition at line 37 of file upnp.h.

Referenced by nat_upnp_matches_bind_address().

◆ internal_port

uint16_t nat_upnp_context::internal_port

Internal port we're binding to.

Definition at line 33 of file upnp.h.

◆ is_mapped

bool nat_upnp_context::is_mapped

true if port mapping is currently active

Definition at line 45 of file upnp.h.

Referenced by nat_upnp_is_active(), and nat_upnp_refresh().

◆ is_natpmp

bool nat_upnp_context::is_natpmp

true if NAT-PMP was used, false if UPnP

Definition at line 36 of file upnp.h.

Referenced by nat_upnp_refresh().

◆ lease_seconds

uint32_t nat_upnp_context::lease_seconds

Granted/requested lease duration.

Definition at line 42 of file upnp.h.

◆ mapped_port

uint16_t nat_upnp_context::mapped_port

External port that was mapped (may differ from internal).

Definition at line 32 of file upnp.h.

Referenced by nat_upnp_get_address(), nat_upnp_get_endpoint(), and nat_upnp_refresh().

◆ protocol

nat_upnp_protocol_t nat_upnp_context::protocol

Transport of this mapping.

Definition at line 46 of file upnp.h.

◆ refresh_at_ns

uint64_t nat_upnp_context::refresh_at_ns

Next renewal or retry deadline.

Definition at line 44 of file upnp.h.

Referenced by mcp_http_run(), and nat_upnp_refresh().

◆ service_type

char nat_upnp_context::service_type[128]

UPnP service used to create the mapping.

Definition at line 39 of file upnp.h.


The documentation for this struct was generated from the following file: