1
/* $Id: doc_stun.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
@defgroup PJNATH_STUN STUN: Session Traversal Utilities for NAT
24
@brief Open source STUN library
28
@defgroup PJNATH_STUN_SOCK STUN-aware socket transport
29
@brief STUN aware UDP socket transport
35
@defgroup PJNATH_STUN_SESSION STUN session
36
@brief STUN client and server session
41
@defgroup PJNATH_STUN_BASE Base STUN objects
43
@brief STUN data structures, objects, and configurations
45
These section contains STUN base data structures as well as
46
configurations. Among other things it contains STUN message
47
representation and parsing, transactions, authentication
48
framework, as well as compile-time and run-time configurations.
53
@addtogroup PJNATH_STUN
55
This module contains implementation of STUN library in PJNATH -
56
the open source NAT helper containing STUN and ICE.
58
\section stun_org_sec Library organizations
60
The STUN part of PJNATH consists of the the following sections (see
61
<b>Table of Contents</b> below).
64
\section stun_using_sec Using the STUN transport
66
The \ref PJNATH_STUN_SOCK is a ready to use object which provides
67
send and receive interface for communicating UDP packets as well as
68
means to communicate with the STUN server and manage the STUN mapped
71
Some features of the \ref PJNATH_STUN_SOCK:
72
- API to send and receive UDP packets,
73
- interface to query the STUN mapped address info,
74
- multiplex STUN and non-STUN incoming packets and distinguish between
75
STUN responses that belong to internal requests with application data
76
(the application data may be STUN packets as well),
77
- resolution of the STUN server with DNS SRV query (if wanted),
78
- maintaining STUN keep-alive, and
79
- handle changes in STUN mapped address binding.
81
Please see \ref PJNATH_STUN_SOCK for more information.
84
\section stun_advanced_sec Advanced use of the STUN components
86
The rest of the STUN part of the library provides lower level objects
87
which can be used to build your own STUN based transport or
88
protocols (officially called STUN usages). These will be explained
92
\subsection stun_sess_sec The STUN session
94
A STUN session is interactive information exchange between two STUN
95
endpoints that lasts for some period of time. It is typically started by
96
an outgoing or incoming request, and consists of several requests,
97
responses, and indications. All requests and responses within the session
98
typically share a same credential.
100
The \ref PJNATH_STUN_SESSION is a transport-independent object to
101
manage a client or server STUN session. It is one of the core object in
102
PJNATH, and it is used by several higher level objects including the
103
\ref PJNATH_STUN_SOCK, \ref PJNATH_TURN_SESSION, and \ref PJNATH_ICE_SESSION.
105
The \ref PJNATH_STUN_SESSION has the following features:
106
- transport independent
107
- authentication management
108
- static or dynamic credential
109
- client transaction management
110
- server transaction management
112
For more information, including how to use it please see
113
\ref PJNATH_STUN_SESSION.
116
\subsection stun_extending_sec Extending STUN to support other usages
118
At present, the STUN subsystem in PJNATH supports STUN Binding, TURN, and
119
ICE usages. If other usages are to be supported, typically you would need
120
to add new STUN methods (and the corresponding request and response message
121
types), attributes, and error codes to \ref PJNATH_STUN_MSG subsystem of
122
PJNATH, as well as implementing the logic for the STUN usage.
125
\section stunsamples_sec STUN samples
127
The \ref turn_client_sample sample application also contains sample
128
code to use \ref PJNATH_STUN_SOCK.
130
Also see <b>\ref samples_page</b> for other samples.