var searchIndex = {}; searchIndex["nat_traversal"] = {"doc":"# `nat_traversal`\nNAT traversal utilities.","items":[[3,"MappingContext","nat_traversal","You need to create a `MappingContext` before doing any socket mapping. This\n`MappingContext` should ideally be kept throughout the lifetime of the\nprogram. Internally it caches a addresses of UPnP servers and hole punching\nservers.",null,null],[3,"MappedSocketAddr","","A socket address obtained through some mapping technique.",null,null],[12,"addr","","The mapped address",0,null],[12,"nat_restricted","","Indicated that hole punching needs to be used for an external client to connect to this\naddress. `nat_restricted` will not be set if this is a fully mapped address such as the\nexternal address of a full-cone NAT or one obtained through UPnP.",0,null],[3,"PrivRendezvousInfo","","The local half of a `PubRendezvousInfo`.",null,null],[3,"PubRendezvousInfo","","Info exchanged by both parties before performing a rendezvous connection.",null,null],[3,"MappedUdpSocket","","A bound udp socket for which we know our external endpoints.",null,null],[12,"socket","","The socket.",1,null],[12,"endpoints","","The known endpoints of this socket.",1,null],[3,"PunchedUdpSocket","","A udp socket that has been hole punched.",null,null],[12,"socket","","The UDP socket.",2,null],[12,"peer_addr","","The remote address that this socket is able to send messages to and receive messages from.",2,null],[3,"MappedTcpSocket","","A tcp socket for which we know our external endpoints.",null,null],[12,"socket","","A bound, but neither listening or connected tcp socket. The socket is\nbound to be reuseable (ie. SO_REUSEADDR is set as is SO_REUSEPORT on\nunix).",3,null],[12,"endpoints","","The known endpoints of this socket.",3,null],[3,"SimpleUdpHolePunchServer","","RAII type for a hole punch server which speaks the simple hole punching protocol.",null,null],[3,"SimpleTcpHolePunchServer","","RAII type for a hole punch server which speaks the simple hole punching protocol.",null,null],[4,"MappingContextNewError","","",null,null],[13,"ListInterfaces","","Failed to list the local machine's network interfaces.",4,null],[12,"err","nat_traversal::MappingContextNewError","",4,null],[13,"SpawnThread","nat_traversal","Failed to spawn a thread.",4,null],[12,"err","nat_traversal::MappingContextNewError","",4,null],[4,"MappingContextNewWarning","nat_traversal","",null,null],[13,"SearchGateway","","Error finding IGD gateway. `if_name` and `if_addr` indicate the network interface being\nsearched from when this error was raised.",5,null],[12,"if_name","nat_traversal::MappingContextNewWarning","",5,null],[12,"if_addr","","",5,null],[12,"err","","",5,null],[4,"MappedUdpSocketMapError","nat_traversal","Errors returned by MappedUdpSocket::map",null,null],[13,"SocketLocalAddr","","Error getting the local address of the socket.",6,null],[12,"err","nat_traversal::MappedUdpSocketMapError","",6,null],[13,"RecvError","nat_traversal","IO error receiving data on the socket.",6,null],[12,"err","nat_traversal::MappedUdpSocketMapError","",6,null],[13,"SendError","nat_traversal","IO error sending data on the socket.",6,null],[12,"err","nat_traversal::MappedUdpSocketMapError","",6,null],[4,"MappedUdpSocketMapWarning","nat_traversal","Warnings raised by MappedUdpSocket::map",null,null],[13,"FindGateway","","Error searching for IGD gateway",7,null],[12,"err","nat_traversal::MappedUdpSocketMapWarning","",7,null],[13,"GetExternalPort","nat_traversal","Error mapping external address and port through IGD gateway. `gateway_addr` is the\naddress of the IGD gateway that we requested a port mapping from.",7,null],[12,"gateway_addr","nat_traversal::MappedUdpSocketMapWarning","",7,null],[12,"err","","",7,null],[4,"MappedUdpSocketNewError","nat_traversal","Errors returned by MappedUdpSocket::new",null,null],[13,"CreateSocket","","Error creating new udp socket bound to 0.0.0.0:0",8,null],[12,"err","nat_traversal::MappedUdpSocketNewError","",8,null],[13,"MapSocket","nat_traversal","Error mapping udp socket.",8,null],[12,"err","nat_traversal::MappedUdpSocketNewError","",8,null],[4,"SimpleUdpHolePunchServerNewError","nat_traversal","Errors returned by SimpleUdpHolePunchServer::new",null,null],[13,"CreateMappedSocket","","Error creating a mapped udp socket to listen on.",9,null],[12,"err","nat_traversal::SimpleUdpHolePunchServerNewError","",9,null],[13,"SetSocketTimeout","nat_traversal","Error setting the timeout on the server's listening socket.",9,null],[12,"err","nat_traversal::SimpleUdpHolePunchServerNewError","",9,null],[4,"SimpleTcpHolePunchServerNewError","nat_traversal","Errors returned by SimpleTcpHolePunchServer::new",null,null],[13,"CreateMappedSocket","","Error creating a mapped tcp socket to listen on.",10,null],[12,"err","nat_traversal::SimpleTcpHolePunchServerNewError","",10,null],[13,"Listen","nat_traversal","",10,null],[12,"err","nat_traversal::SimpleTcpHolePunchServerNewError","",10,null],[13,"SocketLocalAddr","nat_traversal","",10,null],[12,"err","nat_traversal::SimpleTcpHolePunchServerNewError","",10,null],[5,"gen_rendezvous_info","nat_traversal","Create a `(PrivRendezvousInfo, PubRendezvousInfo)` pair from a list of\nmapped socket addresses.",null,null],[5,"filter_udp_hole_punch_packet","","Returns `None` if `data` looks like a hole punching message. Otherwise returns the data it was\ngiven.",null,null],[5,"tcp_punch_hole","","Perform a tcp rendezvous connect. `socket` should have been obtained from a\n`MappedTcpSocket`.",null,{"inputs":[{"name":"tcpbuilder"},{"name":"privrendezvousinfo"},{"name":"pubrendezvousinfo"}],"output":{"name":"wresult"}}],[11,"fmt","","",4,null],[11,"fmt","","",4,null],[11,"description","","",4,null],[11,"cause","","",4,null],[11,"fmt","","",5,null],[11,"fmt","","",5,null],[11,"description","","",5,null],[11,"cause","","",5,null],[11,"new","","Create a new mapping context. This will block breifly while it searches\nthe network for UPnP servers.",11,{"inputs":[],"output":{"name":"wresult"}}],[11,"add_simple_udp_servers","","Inform the context about external servers that speak the UDP simple hole punch server\nprotocol.",11,null],[11,"add_simple_tcp_servers","","Inform the context about external servers that speak the TCP simple hole punch server\nprotocol.",11,null],[11,"decode","","",0,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",0,null],[11,"clone","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"decode","","",12,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",12,null],[11,"eq","","",12,null],[11,"ne","","",12,null],[11,"clone","","",12,null],[11,"fmt","","",12,null],[11,"eq","","",13,null],[11,"ne","","",13,null],[11,"clone","","",13,null],[11,"fmt","","",13,null],[11,"fmt","","",6,null],[11,"fmt","","",6,null],[11,"description","","",6,null],[11,"cause","","",6,null],[11,"fmt","","",7,null],[11,"fmt","","",7,null],[11,"description","","",7,null],[11,"cause","","",7,null],[11,"fmt","","",8,null],[11,"fmt","","",8,null],[11,"description","","",8,null],[11,"cause","","",8,null],[11,"map","","Map an existing `UdpSocket`.",1,{"inputs":[{"name":"udpsocket"},{"name":"mappingcontext"}],"output":{"name":"wresult"}}],[11,"new","","Create a new `MappedUdpSocket`",1,{"inputs":[{"name":"mappingcontext"}],"output":{"name":"wresult"}}],[11,"punch_hole","","Punch a udp socket using a mapped socket and the peer's rendezvous info.",2,{"inputs":[{"name":"udpsocket"},{"name":"privrendezvousinfo"},{"name":"pubrendezvousinfo"}],"output":{"name":"wresult"}}],[11,"map","","Map an existing tcp socket. The socket must bound but not connected. It must have been\nbound with SO_REUSEADDR and SO_REUSEPORT options (or equivalent) set.",3,{"inputs":[{"name":"tcpbuilder"},{"name":"mappingcontext"}],"output":{"name":"wresult"}}],[11,"new","","Create a new `MappedTcpSocket`",3,{"inputs":[{"name":"mappingcontext"}],"output":{"name":"wresult"}}],[11,"fmt","","",9,null],[11,"fmt","","",9,null],[11,"description","","",9,null],[11,"cause","","",9,null],[11,"new","","Create a new server. This will spawn a background thread which will serve requests until\nthe server is dropped.",14,{"inputs":[{"name":"mappingcontext"}],"output":{"name":"wresult"}}],[11,"addresses","","Get the external addresses of this server to be shared with peers.",14,null],[11,"drop","","",14,null],[11,"fmt","","",10,null],[11,"fmt","","",10,null],[11,"description","","",10,null],[11,"cause","","",10,null],[11,"new","","Create a new server. This will spawn a background thread which will serve requests until\nthe server is dropped.",15,{"inputs":[{"name":"mappingcontext"}],"output":{"name":"wresult"}}],[11,"addresses","","Get the external addresses of this server to be shared with peers.",15,null],[11,"drop","","",15,null]],"paths":[[3,"MappedSocketAddr"],[3,"MappedUdpSocket"],[3,"PunchedUdpSocket"],[3,"MappedTcpSocket"],[4,"MappingContextNewError"],[4,"MappingContextNewWarning"],[4,"MappedUdpSocketMapError"],[4,"MappedUdpSocketMapWarning"],[4,"MappedUdpSocketNewError"],[4,"SimpleUdpHolePunchServerNewError"],[4,"SimpleTcpHolePunchServerNewError"],[3,"MappingContext"],[3,"PubRendezvousInfo"],[3,"PrivRendezvousInfo"],[3,"SimpleUdpHolePunchServer"],[3,"SimpleTcpHolePunchServer"]]}; initSearch(searchIndex);