summaryrefslogtreecommitdiff
path: root/pjnath/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-09-18 19:33:33 +0000
committerBenny Prijono <bennylp@teluu.com>2007-09-18 19:33:33 +0000
commit41234fb3ea6190fdf7bebf0d11bc41d578b66934 (patch)
tree845b6ba62a1477e77501189b0221b638cae67af9 /pjnath/include
parent0b5b5d6d0b9e0c0362c15126bd74176aa1ce5161 (diff)
Ticket #374: Update STUN specification from rfc3489bis-06 to rfc3489bis-10
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1439 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/include')
-rw-r--r--pjnath/include/pjnath/config.h15
-rw-r--r--pjnath/include/pjnath/stun_msg.h30
-rw-r--r--pjnath/include/pjnath/types.h4
3 files changed, 35 insertions, 14 deletions
diff --git a/pjnath/include/pjnath/config.h b/pjnath/include/pjnath/config.h
index 3b24b944..25eb5b73 100644
--- a/pjnath/include/pjnath/config.h
+++ b/pjnath/include/pjnath/config.h
@@ -49,7 +49,7 @@
/* **************************************************************************
- * STUN CLIENT CONFIGURATION
+ * STUN CONFIGURATION
*/
/**
@@ -80,10 +80,10 @@
* After the last retransmission is sent and if no response is received
* after this time, the STUN transaction will be considered to have failed.
*
- * The default value is 1600 miliseconds (as per RFC 3489-bis).
+ * The default value is 16x RTO (as per RFC 3489-bis).
*/
#ifndef PJ_STUN_TIMEOUT_VALUE
-# define PJ_STUN_TIMEOUT_VALUE 1600
+# define PJ_STUN_TIMEOUT_VALUE (16 * PJ_STUN_RTO_VALUE)
#endif
@@ -121,6 +121,15 @@
#define PJ_STUN_PORT 3478
+/**
+ * Padding character for string attributes.
+ *
+ * Default: ASCII 0
+ */
+#ifndef PJ_STUN_STRING_ATTR_PAD_CHR
+# define PJ_STUN_STRING_ATTR_PAD_CHR 0
+#endif
+
/* **************************************************************************
* ICE CONFIGURATION
diff --git a/pjnath/include/pjnath/stun_msg.h b/pjnath/include/pjnath/stun_msg.h
index f977e8eb..9fc16f1c 100644
--- a/pjnath/include/pjnath/stun_msg.h
+++ b/pjnath/include/pjnath/stun_msg.h
@@ -280,7 +280,7 @@ typedef enum pj_stun_attr_type
PJ_STUN_ATTR_SOURCE_ADDR = 0x0004,/**< SOURCE-ADDRESS (deprecated)*/
PJ_STUN_ATTR_CHANGED_ADDR = 0x0005,/**< CHANGED-ADDRESS (deprecatd)*/
PJ_STUN_ATTR_USERNAME = 0x0006,/**< USERNAME attribute. */
- PJ_STUN_ATTR_PASSWORD = 0x0007,/**< PASSWORD attribute. */
+ PJ_STUN_ATTR_PASSWORD = 0x0007,/**< was PASSWORD attribute. */
PJ_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008,/**< MESSAGE-INTEGRITY. */
PJ_STUN_ATTR_ERROR_CODE = 0x0009,/**< ERROR-CODE. */
PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000A,/**< UNKNOWN-ATTRIBUTES. */
@@ -329,14 +329,17 @@ typedef enum pj_stun_status
PJ_STUN_SC_BAD_REQUEST = 400, /**< Bad Request */
PJ_STUN_SC_UNAUTHORIZED = 401, /**< Unauthorized */
PJ_STUN_SC_UNKNOWN_ATTRIBUTE = 420, /**< Unknown Attribute */
- PJ_STUN_SC_STALE_CREDENTIALS = 430, /**< Stale Credentials */
- PJ_STUN_SC_INTEGRITY_CHECK_FAILURE = 431, /**< Integrity Chk Fail */
- PJ_STUN_SC_MISSING_USERNAME = 432, /**< Missing Username */
- PJ_STUN_SC_USE_TLS = 433, /**< Use TLS */
- PJ_STUN_SC_MISSING_REALM = 434, /**< Missing Realm */
- PJ_STUN_SC_MISSING_NONCE = 435, /**< Missing Nonce */
- PJ_STUN_SC_UNKNOWN_USERNAME = 436, /**< Unknown Username */
- PJ_STUN_SC_NO_BINDING = 437, /**< No Binding. */
+#if 0
+ /* These were obsolete in recent rfc3489bis */
+ //PJ_STUN_SC_STALE_CREDENTIALS = 430, /**< Stale Credentials */
+ //PJ_STUN_SC_INTEGRITY_CHECK_FAILURE= 431, /**< Integrity Chk Fail */
+ //PJ_STUN_SC_MISSING_USERNAME = 432, /**< Missing Username */
+ //PJ_STUN_SC_USE_TLS = 433, /**< Use TLS */
+ //PJ_STUN_SC_MISSING_REALM = 434, /**< Missing Realm */
+ //PJ_STUN_SC_MISSING_NONCE = 435, /**< Missing Nonce */
+ //PJ_STUN_SC_UNKNOWN_USERNAME = 436, /**< Unknown Username */
+ //PJ_STUN_SC_NO_BINDING = 437, /**< No Binding. */
+#endif
PJ_STUN_SC_STALE_NONCE = 438, /**< Stale Nonce */
PJ_STUN_SC_TRANSITIONING = 439, /**< Transitioning. */
PJ_STUN_SC_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or
@@ -1091,6 +1094,15 @@ PJ_DECL(pj_str_t) pj_stun_get_err_reason(int err_code);
/**
+ * Internal: set the padding character for string attribute.
+ * The default padding character is PJ_STUN_STRING_ATTR_PAD_CHR.
+ *
+ * @return The previous padding character.
+ */
+PJ_DECL(int) pj_stun_set_padding_char(int chr);
+
+
+/**
* Create a generic STUN message.
*
* @param pool Pool to create the STUN message.
diff --git a/pjnath/include/pjnath/types.h b/pjnath/include/pjnath/types.h
index 10544d22..0714c4c3 100644
--- a/pjnath/include/pjnath/types.h
+++ b/pjnath/include/pjnath/types.h
@@ -142,8 +142,8 @@ PJ_END_DECL
*
* References for STUN:
*
- * - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-rfc3489bis-06.txt">
- * <B>draft-ietf-behave-rfc3489bis-06</b></A>: Session Traversal
+ * - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-rfc3489bis-10.txt">
+ * <B>draft-ietf-behave-rfc3489bis-10</b></A>: Session Traversal
* Utilities for (NAT) (STUN),
* - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-turn-03.txt">
* <B>draft-ietf-behave-turn-03</B></A>: Obtaining Relay Addresses