doc_stun.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. @defgroup PJNATH_STUN STUN: Session Traversal Utilities for NAT
  20. @ingroup PJNATH
  21. @brief Open source STUN library
  22. */
  23. /**
  24. @defgroup PJNATH_STUN_SOCK STUN-aware socket transport
  25. @brief STUN aware UDP socket transport
  26. @ingroup PJNATH_STUN
  27. */
  28. /**
  29. @defgroup PJNATH_STUN_SESSION STUN session
  30. @brief STUN client and server session
  31. @ingroup PJNATH_STUN
  32. */
  33. /**
  34. @defgroup PJNATH_STUN_BASE Base STUN objects
  35. @ingroup PJNATH_STUN
  36. @brief STUN data structures, objects, and configurations
  37. These section contains STUN base data structures as well as
  38. configurations. Among other things it contains STUN message
  39. representation and parsing, transactions, authentication
  40. framework, as well as compile-time and run-time configurations.
  41. */
  42. /**
  43. @addtogroup PJNATH_STUN
  44. This module contains implementation of STUN library in PJNATH -
  45. the open source NAT helper containing STUN and ICE.
  46. \section stun_org_sec Library organizations
  47. The STUN part of PJNATH consists of the the following sections (see
  48. <b>Table of Contents</b> below).
  49. \section stun_using_sec Using the STUN transport
  50. The \ref PJNATH_STUN_SOCK is a ready to use object which provides
  51. send and receive interface for communicating UDP packets as well as
  52. means to communicate with the STUN server and manage the STUN mapped
  53. address.
  54. Some features of the \ref PJNATH_STUN_SOCK:
  55. - API to send and receive UDP packets,
  56. - interface to query the STUN mapped address info,
  57. - multiplex STUN and non-STUN incoming packets and distinguish between
  58. STUN responses that belong to internal requests with application data
  59. (the application data may be STUN packets as well),
  60. - resolution of the STUN server with DNS SRV query (if wanted),
  61. - maintaining STUN keep-alive, and
  62. - handle changes in STUN mapped address binding.
  63. Please see \ref PJNATH_STUN_SOCK for more information.
  64. \section stun_advanced_sec Advanced use of the STUN components
  65. The rest of the STUN part of the library provides lower level objects
  66. which can be used to build your own STUN based transport or
  67. protocols (officially called STUN usages). These will be explained
  68. briefly below.
  69. \subsection stun_sess_sec The STUN session
  70. A STUN session is interactive information exchange between two STUN
  71. endpoints that lasts for some period of time. It is typically started by
  72. an outgoing or incoming request, and consists of several requests,
  73. responses, and indications. All requests and responses within the session
  74. typically share a same credential.
  75. The \ref PJNATH_STUN_SESSION is a transport-independent object to
  76. manage a client or server STUN session. It is one of the core object in
  77. PJNATH, and it is used by several higher level objects including the
  78. \ref PJNATH_STUN_SOCK, \ref PJNATH_TURN_SESSION, and \ref PJNATH_ICE_SESSION.
  79. The \ref PJNATH_STUN_SESSION has the following features:
  80. - transport independent
  81. - authentication management
  82. - static or dynamic credential
  83. - client transaction management
  84. - server transaction management
  85. For more information, including how to use it please see
  86. \ref PJNATH_STUN_SESSION.
  87. \subsection stun_extending_sec Extending STUN to support other usages
  88. At present, the STUN subsystem in PJNATH supports STUN Binding, TURN, and
  89. ICE usages. If other usages are to be supported, typically you would need
  90. to add new STUN methods (and the corresponding request and response message
  91. types), attributes, and error codes to \ref PJNATH_STUN_MSG subsystem of
  92. PJNATH, as well as implementing the logic for the STUN usage.
  93. \section stunsamples_sec STUN samples
  94. The \ref turn_client_sample sample application also contains sample
  95. code to use \ref PJNATH_STUN_SOCK.
  96. Also see <b>\ref samples_page</b> for other samples.
  97. */