Home --> Documentations --> PJNATH Reference
NAT Classification/Detection Tool.
This module provides one function to perform NAT classification and detection. NAT type detection is performed by calling pj_stun_detect_nat_type() function.
Type of callback to be called when the NAT detection function has completed.
This enumeration describes the NAT types, as specified by RFC 3489 Section 5, NAT Variations.
NAT type is unknown because the detection has not been performed.
NAT type is unknown because there is failure in the detection process, possibly because server does not support RFC 3489.
This specifies that the client has open access to Internet (or at least, its behind a firewall that behaves like a full-cone NAT, but without the translation)
This specifies that communication with server has failed, probably because UDP packets are blocked.
Firewall that allows UDP out, and responses have to come back to the source of the request (like a symmetric NAT, but no translation.
A full cone NAT is one where all requests from the same internal IP address and port are mapped to the same external IP address and port. Furthermore, any external host can send a packet to the internal host, by sending a packet to the mapped external address.
A symmetric NAT is one where all requests from the same internal IP address and port, to a specific destination IP address and port, are mapped to the same external IP address and port. If the same host sends a packet with the same source address and port, but to a different destination, a different mapping is used. Furthermore, only the external host that receives a packet can send a UDP packet back to the internal host.
A restricted cone NAT is one where all requests from the same internal IP address and port are mapped to the same external IP address and port. Unlike a full cone NAT, an external host (with IP address X) can send a packet to the internal host only if the internal host had previously sent a packet to IP address X.
A port restricted cone NAT is like a restricted cone NAT, but the restriction includes port numbers. Specifically, an external host can send a packet, with source IP address X and source port P, to the internal host only if the internal host had previously sent a packet to IP address X and port P.
Perform NAT classification function according to the procedures specified in RFC 3489. Once this function returns successfully, the procedure will run in the "background" and will complete asynchronously. Application can register a callback to be notified when such detection has completed.
|server||STUN server address. |
|stun_cfg||A structure containing various STUN configurations, such as the ioqueue and timer heap instance used to receive network I/O and timer events. |
|user_data||Application data, which will be returned back in the callback. |
|cb||Callback to be registered to receive notification about detection result.|
- If this function returns PJ_SUCCESS, the procedure will complete asynchronously and callback will be called when it completes. For other return values, it means that an error has occured and the procedure did not start.
Get the NAT name from the specified NAT type.
- NAT name.
PJNATH - Open Source NAT traversal helper library supporting STUN, TURN, and ICE
Copyright (C) 2006-2009 Teluu Inc.