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