Crate nat_traversal [] [src]

nat_traversal

NAT traversal utilities.

Structs

MappedSocketAddr

A socket address obtained through some mapping technique.

MappedTcpSocket

A tcp socket for which we know our external endpoints.

MappedUdpSocket

A bound udp socket for which we know our external endpoints.

MappingContext

You need to create a MappingContext before doing any socket mapping. This MappingContext should ideally be kept throughout the lifetime of the program. Internally it caches a addresses of UPnP servers and hole punching servers.

PrivRendezvousInfo

The local half of a PubRendezvousInfo.

PubRendezvousInfo

Info exchanged by both parties before performing a rendezvous connection.

PunchedUdpSocket

A udp socket that has been hole punched.

SimpleTcpHolePunchServer

RAII type for a hole punch server which speaks the simple hole punching protocol.

SimpleUdpHolePunchServer

RAII type for a hole punch server which speaks the simple hole punching protocol.

Enums

MappedUdpSocketMapError

Errors returned by MappedUdpSocket::map

MappedUdpSocketMapWarning

Warnings raised by MappedUdpSocket::map

MappedUdpSocketNewError

Errors returned by MappedUdpSocket::new

MappingContextNewError
MappingContextNewWarning
SimpleTcpHolePunchServerNewError

Errors returned by SimpleTcpHolePunchServer::new

SimpleUdpHolePunchServerNewError

Errors returned by SimpleUdpHolePunchServer::new

Functions

filter_udp_hole_punch_packet

Returns None if data looks like a hole punching message. Otherwise returns the data it was given.

gen_rendezvous_info

Create a (PrivRendezvousInfo, PubRendezvousInfo) pair from a list of mapped socket addresses.

tcp_punch_hole

Perform a tcp rendezvous connect. socket should have been obtained from a MappedTcpSocket.