Open source STUN library. More...
This module contains implementation of STUN library in PJNATH - the open source NAT helper containing STUN and ICE.
The STUN part of PJNATH consists of the the following sections (see Table of Contents below).
The STUN-aware socket transport is a ready to use object which provides send and receive interface for communicating UDP packets as well as means to communicate with the STUN server and manage the STUN mapped address.
Some features of the PJNATH_STUN_SOCK:
Please see STUN-aware socket transport for more information.
The rest of the STUN part of the library provides lower level objects which can be used to build your own STUN based transport or protocols (officially called STUN usages). These will be explained briefly below.
A STUN session is interactive information exchange between two STUN endpoints that lasts for some period of time. It is typically started by an outgoing or incoming request, and consists of several requests, responses, and indications. All requests and responses within the session typically share a same credential.
The STUN session is a transport-independent object to manage a client or server STUN session. It is one of the core object in PJNATH, and it is used by several higher level objects including the STUN-aware socket transport, TURN client session, and ICE Session.
The STUN session has the following features:
For more information, including how to use it please see STUN session.
At present, the STUN subsystem in PJNATH supports STUN Binding, TURN, and ICE usages. If other usages are to be supported, typically you would need to add new STUN methods (and the corresponding request and response message types), attributes, and error codes to STUN Message Representation and Parsing subsystem of PJNATH, as well as implementing the logic for the STUN usage.
Also see PJNATH Samples and screenshots for other samples.