Structs§
- The values that must be explicitly defined for all PCP single-port and peer mapping requests.
- A mapping to a peer’s socket address through the gateway (i.e., the PCP server).
- A port mapping on the gateway using PCP to map all ports to our client through the PCP server.
Enums§
- The range of port mappings to drop. Either a
Single
port for a given protocol orAll
ports for a single protocols, or all protocols ifNone
. - Errors that may occur when trying to map a port on the gateway, categorized by the root of the issue.
- Operation codes for NAT-PMP.
- Valid result codes from a PCP response. See https://www.rfc-editor.org/rfc/rfc6887#section-7.4
Constants§
- The RFC states that the first response timeout “SHOULD be 3 seconds.” https://www.rfc-editor.org/rfc/rfc6887#section-8.1.1 However, this can be very long for modern applications. Using a 1 second default as a compromise.
- PCP has a maximum size of 1100 bytes, see https://www.rfc-editor.org/rfc/rfc6887#section-7.
- The RFC states that the maximum response timeout “SHOULD be 1024 seconds.” https://www.rfc-editor.org/rfc/rfc6887#section-8.1.1
- The default
TimeoutConfig
for PCP requests.
Functions§
- Attempts to remove PCP port mappings for our client from the gateway.
- Attempts to open a mapping to a remote peer’s socket address.
- Attempts to map a port on the gateway using PCP. Will try to use the given external port if it is
Some
, otherwise it will let the gateway choose. - Attempts to map all ports on the gateway to the corresponding port on our client using PCP. If the protocol is
None
, it will try to map all ports for all protocols. Otherwise, only the specified protocol will be mapped.
Type Aliases§
- A unqie session identifier for a PCP client.