Changeset 1080 for pjproject/trunk
- Timestamp:
- Mar 18, 2007 5:39:27 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 8 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/errno.h
r974 r1080 342 342 * - PJSIP_SIMPLE_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*2) 343 343 * - PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3) 344 * - PJNATH_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4) 344 345 */ 345 346 -
pjproject/trunk/pjlib/include/pj/sock.h
r974 r1080 175 175 */ 176 176 #define PJ_INVALID_SOCKET (-1) 177 178 /**179 * Structure describing a generic socket address.180 * If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added181 * to this struct. As far the application is concerned, the value of182 * this member will always be zero. Internally, PJLIB may modify the value183 * before calling OS socket API, and reset the value back to zero before184 * returning the struct to application.185 */186 typedef struct pj_sockaddr187 {188 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0189 pj_uint8_t sa_zero_len;190 pj_uint8_t sa_family;191 #else192 pj_uint16_t sa_family; /**< Common data: address family. */193 #endif194 char sa_data[14]; /**< Address data. */195 } pj_sockaddr;196 197 177 198 178 #undef s_addr … … 277 257 278 258 259 /** 260 * This structure describes common attributes found in transport addresses. 261 * If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added 262 * to this struct. As far the application is concerned, the value of 263 * this member will always be zero. Internally, PJLIB may modify the value 264 * before calling OS socket API, and reset the value back to zero before 265 * returning the struct to application. 266 */ 267 typedef struct pj_addr_hdr 268 { 269 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 270 pj_uint8_t sa_zero_len; 271 pj_uint8_t sa_family; 272 #else 273 pj_uint16_t sa_family; /**< Common data: address family. */ 274 #endif 275 } pj_addr_hdr; 276 277 278 /** 279 * This union describes a generic socket address. 280 */ 281 typedef union pj_sockaddr 282 { 283 pj_addr_hdr addr; /**< Generic transport address. */ 284 pj_sockaddr_in ipv4; /**< IPv4 transport address. */ 285 pj_sockaddr_in6 ipv6; /**< IPv6 transport address. */ 286 } pj_sockaddr; 287 288 279 289 /***************************************************************************** 280 290 * -
pjproject/trunk/pjmedia/build/wince-evc4/pjmedia_wince.vcp
r1001 r1080 77 77 # PROP Use_MFC 0 78 78 # PROP Use_Debug_Libraries 1 79 # PROP Output_Dir " output/pjmedia_emulatorDbg"80 # PROP Intermediate_Dir " output/pjmedia_emulatorDbg"79 # PROP Output_Dir "./output/pjmedia_emulatorDbg" 80 # PROP Intermediate_Dir "./output/pjmedia_emulatorDbg" 81 81 # PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" 82 82 # PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -
pjproject/trunk/pjnath/build/pjnath.dsw
r1062 r1080 16 16 ############################################################################### 17 17 18 Project: "pjlib_ test"=..\..\pjlib\build\pjlib_test.dsp- Package Owner=<4>18 Project: "pjlib_util"="..\..\pjlib-util\build\pjlib_util.dsp" - Package Owner=<4> 19 19 20 20 Package=<5> … … 28 28 ############################################################################### 29 29 30 Project: "pj lib_util"="..\..\pjlib-util\build\pjlib_util.dsp"- Package Owner=<4>30 Project: "pjnath"=.\pjnath.dsp - Package Owner=<4> 31 31 32 32 Package=<5> … … 54 54 Project_Dep_Name pjlib_util 55 55 End Project Dependency 56 Begin Project Dependency 57 Project_Dep_Name pjnath 58 End Project Dependency 56 59 }}} 57 60 … … 72 75 Project_Dep_Name pjlib_util 73 76 End Project Dependency 77 Begin Project Dependency 78 Project_Dep_Name pjnath 79 End Project Dependency 74 80 }}} 75 81 -
pjproject/trunk/pjnath/include/pjnath/stun_auth.h
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ LIB_UTIL_STUN_AUTH_H__20 #define __PJ LIB_UTIL_STUN_AUTH_H__19 #ifndef __PJNATH_STUN_AUTH_H__ 20 #define __PJNATH_STUN_AUTH_H__ 21 21 22 22 /** … … 25 25 */ 26 26 27 #include <pj lib-util/stun_msg.h>27 #include <pjnath/stun_msg.h> 28 28 29 29 … … 33 33 /* **************************************************************************/ 34 34 /** 35 * @defgroup PJ LIB_UTIL_STUN_AUTH STUN Authentication36 * @ingroup PJ LIB_UTIL_STUN35 * @defgroup PJNATH_STUN_AUTH STUN Authentication 36 * @ingroup PJNATH_STUN 37 37 * @{ 38 38 */ … … 272 272 273 273 274 #endif /* __PJ LIB_UTIL_STUN_AUTH_H__ */275 274 #endif /* __PJNATH_STUN_AUTH_H__ */ 275 -
pjproject/trunk/pjnath/include/pjnath/stun_doc.h
r1062 r1080 25 25 26 26 /** 27 * @defgroup PJ LIB_UTIL_STUN STUN and TURN28 * @ingroup PJ LIB_UTIL27 * @defgroup PJNATH_STUN STUN and TURN 28 * @ingroup PJNATH 29 29 30 30 This is the implementation of STUN/TURN in PJLIB-UTIL library. … … 55 55 @subsection stun_msg_sec Messaging and Parsing 56 56 57 The lowest layer of the STUN implementation is the @ref PJ LIB_UTIL_STUN_MSG57 The lowest layer of the STUN implementation is the @ref PJNATH_STUN_MSG 58 58 component. This part is responsible for encoding and decoding STUN messages. 59 59 … … 66 66 @subsection stun_endpt_sec Endpoint 67 67 68 The @ref PJ LIB_UTIL_STUN_ENDPOINT is used by the library to put together68 The @ref PJNATH_STUN_ENDPOINT is used by the library to put together 69 69 common settings for all STUN objects. For example, the STUN endpoint has a 70 70 reference of timer heap to poll all STUN timers, reference to ioqueue to … … 75 75 @subsection stun_clt_tsx_sec Client Transaction 76 76 77 The @ref PJ LIB_UTIL_STUN_TRANSACTION is used to manage outgoing STUN request,77 The @ref PJNATH_STUN_TRANSACTION is used to manage outgoing STUN request, 78 78 for example to retransmit the request and to notify application about the 79 79 completion of the request. 80 80 81 The @ref PJ LIB_UTIL_STUN_TRANSACTION does not use any networking operations,81 The @ref PJNATH_STUN_TRANSACTION does not use any networking operations, 82 82 but instead application must supply the transaction with a callback to 83 83 be used by the transaction to send outgoing requests. This way the STUN … … 89 89 @subsection stun_srv_sec Server Components 90 90 91 The @ref PJ LIB_UTIL_STUN_SERVER is used for:91 The @ref PJNATH_STUN_SERVER is used for: 92 92 - implementing STUN servers, and/or 93 93 - implementing server side STUN handling (for example for ICE). -
pjproject/trunk/pjnath/include/pjnath/stun_endpoint.h
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ LIB_UTIL_STUN_ENDPOINT_H__20 #define __PJ LIB_UTIL_STUN_ENDPOINT_H__19 #ifndef __PJNATH_STUN_CONFIG_H__ 20 #define __PJNATH_STUN_CONFIG_H__ 21 21 22 22 /** 23 * @file stun_ endpoint.h23 * @file stun_config.h 24 24 * @brief STUN endpoint. 25 25 */ 26 26 27 #include <pj lib-util/stun_msg.h>27 #include <pjnath/stun_msg.h> 28 28 29 29 … … 33 33 /* **************************************************************************/ 34 34 /** 35 * @defgroup PJ LIB_UTIL_STUN_ENDPOINT STUN Endpoint35 * @defgroup PJNATH_STUN_ENDPOINT STUN Endpoint 36 36 * @brief Management of incoming and outgoing STUN transactions. 37 * @ingroup PJ LIB_UTIL_STUN37 * @ingroup PJNATH_STUN 38 38 * @{ 39 39 */ … … 44 44 * can send or receive STUN messages. 45 45 */ 46 typedef struct pj_stun_ endpoint46 typedef struct pj_stun_config 47 47 { 48 48 /** … … 87 87 unsigned res_cache_msec; 88 88 89 } pj_stun_ endpoint;89 } pj_stun_config; 90 90 91 91 … … 94 94 * Create a STUN endpoint instance. 95 95 */ 96 PJ_DECL(pj_status_t) pj_stun_ endpoint_create(pj_pool_factory *factory,97 98 99 100 pj_stun_endpoint**p_endpt);96 PJ_DECL(pj_status_t) pj_stun_config_create(pj_pool_factory *factory, 97 unsigned options, 98 pj_ioqueue_t *ioqueue, 99 pj_timer_heap_t *timer_heap, 100 pj_stun_config **p_endpt); 101 101 102 102 /** 103 103 * Destroy STUN endpoint instance. 104 104 */ 105 PJ_DECL(pj_status_t) pj_stun_ endpoint_destroy(pj_stun_endpoint*endpt);105 PJ_DECL(pj_status_t) pj_stun_config_destroy(pj_stun_config *endpt); 106 106 107 107 … … 114 114 115 115 116 #endif /* __PJ LIB_UTIL_STUN_ENDPOINT_H__ */116 #endif /* __PJNATH_STUN_CONFIG_H__ */ 117 117 -
pjproject/trunk/pjnath/include/pjnath/stun_msg.h
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ LIB_UTIL_STUN_MSG_H__20 #define __PJ LIB_UTIL_STUN_MSG_H__19 #ifndef __PJNATH_STUN_MSG_H__ 20 #define __PJNATH_STUN_MSG_H__ 21 21 22 22 /** … … 25 25 */ 26 26 27 #include <pj lib-util/types.h>27 #include <pjnath/types.h> 28 28 #include <pj/sock.h> 29 29 … … 34 34 /* **************************************************************************/ 35 35 /** 36 * @defgroup PJ LIB_UTIL_STUN_MSG STUN Message Representation and Parsing36 * @defgroup PJNATH_STUN_MSG STUN Message Representation and Parsing 37 37 * @brief Low-level representation and parsing of STUN messages. 38 * @ingroup PJ LIB_UTIL_STUN38 * @ingroup PJNATH_STUN 39 39 * @{ 40 40 */ … … 530 530 531 531 /** 532 * The socket address (as a union) 533 */ 534 union { 535 pj_sockaddr addr; /**< Generic socket address. */ 536 pj_sockaddr_in ipv4; /**< IPv4 socket address. */ 537 pj_sockaddr_in6 ipv6; /**< IPv6 socket address. */ 538 } addr; 532 * The socket address 533 */ 534 pj_sockaddr sockaddr; 539 535 540 536 } pj_stun_sockaddr_attr; … … 1536 1532 1537 1533 1538 #endif /* __PJ LIB_UTIL_STUN_MSG_H__ */1539 1534 #endif /* __PJNATH_STUN_MSG_H__ */ 1535 -
pjproject/trunk/pjnath/include/pjnath/stun_session.h
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ LIB_UTIL_STUN_SESSION_H__20 #define __PJ LIB_UTIL_STUN_SESSION_H__21 22 #include <pj lib-util/stun_msg.h>23 #include <pj lib-util/stun_auth.h>24 #include <pj lib-util/stun_endpoint.h>25 #include <pj lib-util/stun_transaction.h>19 #ifndef __PJNATH_STUN_SESSION_H__ 20 #define __PJNATH_STUN_SESSION_H__ 21 22 #include <pjnath/stun_msg.h> 23 #include <pjnath/stun_auth.h> 24 #include <pjnath/stun_endpoint.h> 25 #include <pjnath/stun_transaction.h> 26 26 #include <pj/list.h> 27 27 #include <pj/timer.h> … … 32 32 /* **************************************************************************/ 33 33 /** 34 * @defgroup PJ LIB_UTIL_STUN_SESSION STUN Client/Server Session34 * @defgroup PJNATH_STUN_SESSION STUN Client/Server Session 35 35 * @brief STUN client and server session 36 * @ingroup PJ LIB_UTIL_STUN36 * @ingroup PJNATH_STUN 37 37 * @{ 38 38 */ … … 157 157 * Create a STUN session. 158 158 * 159 * @param endptThe STUN endpoint, to be used to register timers etc.159 * @param cfg The STUN endpoint, to be used to register timers etc. 160 160 * @param name Optional name to be associated with this instance. The 161 161 * name will be used for example for logging purpose. … … 166 166 * @return PJ_SUCCESS on success, or the appropriate error code. 167 167 */ 168 PJ_DECL(pj_status_t) pj_stun_session_create(pj_stun_ endpoint *endpt,168 PJ_DECL(pj_status_t) pj_stun_session_create(pj_stun_config *cfg, 169 169 const char *name, 170 170 const pj_stun_session_cb *cb, … … 369 369 PJ_END_DECL 370 370 371 #endif /* __PJ LIB_UTIL_STUN_SESSION_H__ */372 371 #endif /* __PJNATH_STUN_SESSION_H__ */ 372 -
pjproject/trunk/pjnath/include/pjnath/stun_transaction.h
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ LIB_UTIL_STUN_TRANSACTION_H__20 #define __PJ LIB_UTIL_STUN_TRANSACTION_H__19 #ifndef __PJNATH_STUN_TRANSACTION_H__ 20 #define __PJNATH_STUN_TRANSACTION_H__ 21 21 22 22 /** … … 25 25 */ 26 26 27 #include <pj lib-util/stun_msg.h>28 #include <pj lib-util/stun_endpoint.h>27 #include <pjnath/stun_msg.h> 28 #include <pjnath/stun_endpoint.h> 29 29 30 30 … … 34 34 /* **************************************************************************/ 35 35 /** 36 * @defgroup PJ LIB_UTIL_STUN_TRANSACTION STUN Client Transaction36 * @defgroup PJNATH_STUN_TRANSACTION STUN Client Transaction 37 37 * @brief STUN client transaction 38 * @ingroup PJ LIB_UTIL_STUN38 * @ingroup PJNATH_STUN 39 39 * @{ 40 40 * 41 The @ref PJ LIB_UTIL_STUN_TRANSACTION is used to manage outgoing STUN request,41 The @ref PJNATH_STUN_TRANSACTION is used to manage outgoing STUN request, 42 42 for example to retransmit the request and to notify application about the 43 43 completion of the request. 44 44 45 The @ref PJ LIB_UTIL_STUN_TRANSACTION does not use any networking operations,45 The @ref PJNATH_STUN_TRANSACTION does not use any networking operations, 46 46 but instead application must supply the transaction with a callback to 47 47 be used by the transaction to send outgoing requests. This way the STUN … … 101 101 * the request, if necessary. 102 102 * 103 * @param endptThe STUN endpoint, which will be used to retrieve103 * @param cfg The STUN endpoint, which will be used to retrieve 104 104 * various settings for the transaction. 105 105 * @param pool Pool to be used to allocate memory from. … … 111 111 * @return PJ_SUCCESS on success, or the appropriate error code. 112 112 */ 113 PJ_DECL(pj_status_t) pj_stun_client_tsx_create( pj_stun_ endpoint *endpt,113 PJ_DECL(pj_status_t) pj_stun_client_tsx_create( pj_stun_config *cfg, 114 114 pj_pool_t *pool, 115 115 const pj_stun_tsx_cb *cb, … … 214 214 215 215 216 #endif /* __PJ LIB_UTIL_STUN_TRANSACTION_H__ */217 216 #endif /* __PJNATH_STUN_TRANSACTION_H__ */ 217 -
pjproject/trunk/pjnath/include/pjnath/turn_client.h
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ LIB_UTIL_TURN_CLIENT_H__20 #define __PJ LIB_UTIL_TURN_CLIENT_H__19 #ifndef __PJNATH_TURN_CLIENT_H__ 20 #define __PJNATH_TURN_CLIENT_H__ 21 21 22 22 /** … … 25 25 */ 26 26 27 #include <pj lib-util/stun_msg.h>27 #include <pjnath/stun_msg.h> 28 28 29 29 … … 32 32 33 33 /** 34 * @defgroup PJ LIB_UTIL_TURN_CLIENT TURN Client Session34 * @defgroup PJNATH_TURN_CLIENT TURN Client Session 35 35 * @brief Management of STUN/TURN client session 36 * @ingroup PJ LIB_UTIL_STUN36 * @ingroup PJNATH_STUN 37 37 * @{ 38 38 */ … … 129 129 130 130 131 #endif /* __PJ LIB_UTIL_TURN_CLIENT_H__ */131 #endif /* __PJNATH_TURN_CLIENT_H__ */ 132 132 -
pjproject/trunk/pjnath/src/pjnath/stun_auth.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj lib-util/stun_auth.h>20 #include <pj lib-util/errno.h>19 #include <pjnath/stun_auth.h> 20 #include <pjnath/errno.h> 21 21 #include <pjlib-util/hmac_sha1.h> 22 22 #include <pjlib-util/sha1.h> … … 160 160 &realm, &nonce, p_response); 161 161 } 162 return PJ LIB_UTIL_ESTUNMSGINT;162 return PJNATH_ESTUNMSGINT; 163 163 } 164 164 … … 171 171 &realm, &nonce, p_response); 172 172 } 173 return PJ LIB_UTIL_ESTUNNOUSERNAME;173 return PJNATH_ESTUNNOUSERNAME; 174 174 } 175 175 … … 202 202 &realm, &nonce, p_response); 203 203 } 204 return PJ LIB_UTIL_ESTUNUSERNAME;204 return PJNATH_ESTUNUSERNAME; 205 205 } 206 206 … … 217 217 &realm, &nonce, p_response); 218 218 } 219 return PJ LIB_UTIL_ESTUNNOREALM;219 return PJNATH_ESTUNNOREALM; 220 220 221 221 } else if (realm.slen != 0 && arealm != NULL) { … … 228 228 NULL, &realm, &nonce, p_response); 229 229 } 230 return PJ LIB_UTIL_ESTUNNONCE;230 return PJNATH_ESTUNNONCE; 231 231 } 232 232 … … 238 238 NULL, &realm, &nonce, p_response); 239 239 } 240 return PJ LIB_UTIL_ESTUNNOREALM;240 return PJNATH_ESTUNNOREALM; 241 241 } 242 242 … … 261 261 NULL, &realm, &nonce, p_response); 262 262 } 263 return PJ LIB_UTIL_ESTUNNONCE;263 return PJNATH_ESTUNNONCE; 264 264 } 265 265 } … … 287 287 NULL, &realm, &nonce, p_response); 288 288 } 289 return PJ LIB_UTIL_ESTUNNONCE;289 return PJNATH_ESTUNNONCE; 290 290 } 291 291 } … … 332 332 NULL, &realm, &nonce, p_response); 333 333 } 334 return PJ LIB_UTIL_ESTUNMSGINT;334 return PJNATH_ESTUNMSGINT; 335 335 } 336 336 -
pjproject/trunk/pjnath/src/pjnath/stun_endpoint.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj lib-util/stun_endpoint.h>20 #include <pj lib-util/errno.h>19 #include <pjnath/stun_endpoint.h> 20 #include <pjnath/errno.h> 21 21 #include <pj/assert.h> 22 22 #include <pj/pool.h> … … 26 26 * Create a STUN endpoint instance. 27 27 */ 28 PJ_DEF(pj_status_t) pj_stun_ endpoint_create( pj_pool_factory *factory,29 30 31 32 pj_stun_endpoint**p_endpt)28 PJ_DEF(pj_status_t) pj_stun_config_create( pj_pool_factory *factory, 29 unsigned options, 30 pj_ioqueue_t *ioqueue, 31 pj_timer_heap_t *timer_heap, 32 pj_stun_config **p_endpt) 33 33 { 34 34 pj_pool_t *pool; 35 pj_stun_ endpoint*endpt;35 pj_stun_config *endpt; 36 36 37 37 PJ_ASSERT_RETURN(factory && p_endpt, PJ_EINVAL); … … 41 41 return PJ_ENOMEM; 42 42 43 endpt = PJ_POOL_ZALLOC_T(pool, pj_stun_ endpoint);43 endpt = PJ_POOL_ZALLOC_T(pool, pj_stun_config); 44 44 endpt->pool = pool; 45 45 endpt->pf = factory; … … 59 59 * Destroy STUN endpoint instance. 60 60 */ 61 PJ_DEF(pj_status_t) pj_stun_ endpoint_destroy(pj_stun_endpoint*endpt)61 PJ_DEF(pj_status_t) pj_stun_config_destroy(pj_stun_config *endpt) 62 62 { 63 63 PJ_ASSERT_RETURN(endpt, PJ_EINVAL); -
pjproject/trunk/pjnath/src/pjnath/stun_msg.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pjlib-util/stun_msg.h> 19 #include <pjnath/stun_msg.h> 20 #include <pjnath/errno.h> 20 21 #include <pjlib-util/crc32.h> 21 #include <pjlib-util/errno.h>22 22 #include <pjlib-util/hmac_sha1.h> 23 23 #include <pjlib-util/md5.h> … … 559 559 INIT_ATTR(attr, attr_type, STUN_GENERIC_IP_ADDR_LEN); 560 560 561 pj_memcpy(&attr-> addr, addr, addr_len);561 pj_memcpy(&attr->sockaddr, addr, addr_len); 562 562 attr->xor_ed = xor_ed; 563 563 … … 607 607 /* Check that the attribute length is valid */ 608 608 if (attr->hdr.length != STUN_GENERIC_IP_ADDR_LEN) 609 return PJ LIB_UTIL_ESTUNINATTRLEN;609 return PJNATH_ESTUNINATTRLEN; 610 610 611 611 /* Check address family */ … … 614 614 /* Check address family is valid (only supports ipv4 for now) */ 615 615 if (val != 1) 616 return PJ LIB_UTIL_ESTUNIPV6NOTSUPP;616 return PJNATH_ESTUNIPV6NOTSUPP; 617 617 618 618 /* Get port and address */ 619 pj_sockaddr_in_init(&attr-> addr.ipv4, NULL, 0);620 pj_memcpy(&attr-> addr.ipv4.sin_port, buf+ATTR_HDR_LEN+2, 2);621 pj_memcpy(&attr-> addr.ipv4.sin_addr, buf+ATTR_HDR_LEN+4, 4);619 pj_sockaddr_in_init(&attr->sockaddr.ipv4, NULL, 0); 620 pj_memcpy(&attr->sockaddr.ipv4.sin_port, buf+ATTR_HDR_LEN+2, 2); 621 pj_memcpy(&attr->sockaddr.ipv4.sin_addr, buf+ATTR_HDR_LEN+4, 4); 622 622 623 623 /* Done */ … … 645 645 /* Check that the attribute length is valid */ 646 646 if (attr->hdr.length != STUN_GENERIC_IP_ADDR_LEN) 647 return PJ LIB_UTIL_ESTUNINATTRLEN;647 return PJNATH_ESTUNINATTRLEN; 648 648 649 649 /* Check address family */ … … 652 652 /* Check address family is valid (only supports ipv4 for now) */ 653 653 if (val != 1) 654 return PJ LIB_UTIL_ESTUNIPV6NOTSUPP;654 return PJNATH_ESTUNIPV6NOTSUPP; 655 655 656 656 /* Get port and address */ 657 pj_sockaddr_in_init(&attr-> addr.ipv4, NULL, 0);658 pj_memcpy(&attr-> addr.ipv4.sin_port, buf+ATTR_HDR_LEN+2, 2);659 pj_memcpy(&attr-> addr.ipv4.sin_addr, buf+ATTR_HDR_LEN+4, 4);660 661 attr-> addr.ipv4.sin_port ^= 0x2112;662 attr-> addr.ipv4.sin_addr.s_addr ^= pj_htonl(0x2112A442);657 pj_sockaddr_in_init(&attr->sockaddr.ipv4, NULL, 0); 658 pj_memcpy(&attr->sockaddr.ipv4.sin_port, buf+ATTR_HDR_LEN+2, 2); 659 pj_memcpy(&attr->sockaddr.ipv4.sin_addr, buf+ATTR_HDR_LEN+4, 4); 660 661 attr->sockaddr.ipv4.sin_port ^= pj_htons(0x2112); 662 attr->sockaddr.ipv4.sin_addr.s_addr ^= pj_htonl(0x2112A442); 663 663 664 664 /* Done */ … … 694 694 695 695 /* Family (IPv4 only for now) */ 696 PJ_ASSERT_RETURN(ca-> addr.addr.sa_family == PJ_AF_INET, PJ_EINVAL);696 PJ_ASSERT_RETURN(ca->sockaddr.addr.sa_family == PJ_AF_INET, PJ_EINVAL); 697 697 *buf++ = 1; 698 698 … … 701 701 pj_uint16_t port; 702 702 703 addr = ca-> addr.ipv4.sin_addr.s_addr;704 port = ca-> addr.ipv4.sin_port;705 706 port ^= 0x2112;703 addr = ca->sockaddr.ipv4.sin_addr.s_addr; 704 port = ca->sockaddr.ipv4.sin_port; 705 706 port ^= pj_htons(0x2112); 707 707 addr ^= pj_htonl(0x2112A442); 708 708 … … 717 717 } else { 718 718 /* Port */ 719 pj_memcpy(buf, &ca-> addr.ipv4.sin_port, 2);719 pj_memcpy(buf, &ca->sockaddr.ipv4.sin_port, 2); 720 720 buf += 2; 721 721 722 722 /* Address */ 723 pj_memcpy(buf, &ca-> addr.ipv4.sin_addr, 4);723 pj_memcpy(buf, &ca->sockaddr.ipv4.sin_addr, 4); 724 724 buf += 4; 725 725 } … … 893 893 /* Check that the attribute length is valid */ 894 894 if (attr->hdr.length != ATTR_HDR_LEN) 895 return PJ LIB_UTIL_ESTUNINATTRLEN;895 return PJNATH_ESTUNINATTRLEN; 896 896 897 897 /* Done */ … … 993 993 /* Check that the attribute length is valid */ 994 994 if (attr->hdr.length != STUN_UINT_LEN) 995 return PJ LIB_UTIL_ESTUNINATTRLEN;995 return PJNATH_ESTUNINATTRLEN; 996 996 997 997 /* Done */ … … 1089 1089 /* Check that the attribute length is valid */ 1090 1090 if (attr->hdr.length != STUN_MSG_INTEGRITY_LEN) 1091 return PJ LIB_UTIL_ESTUNINATTRLEN;1091 return PJNATH_ESTUNINATTRLEN; 1092 1092 1093 1093 /* Done */ … … 1564 1564 1565 1565 if (pdu_len < sizeof(pj_stun_msg_hdr)) 1566 return PJ LIB_UTIL_ESTUNINMSGLEN;1566 return PJNATH_ESTUNINMSGLEN; 1567 1567 1568 1568 /* First byte of STUN message is always 0x00 or 0x01. */ 1569 1569 if (*pdu != 0x00 && *pdu != 0x01) 1570 return PJ LIB_UTIL_ESTUNINMSGTYPE;1570 return PJNATH_ESTUNINMSGTYPE; 1571 1571 1572 1572 /* Check the PDU length */ … … 1575 1575 ((options & PJ_STUN_IS_DATAGRAM) && msg_len + 20 != pdu_len)) 1576 1576 { 1577 return PJ LIB_UTIL_ESTUNINMSGLEN;1577 return PJNATH_ESTUNINMSGLEN; 1578 1578 } 1579 1579 … … 1590 1590 1591 1591 if (attr_len != 4) 1592 return PJ LIB_UTIL_ESTUNINATTRLEN;1592 return PJNATH_ESTUNINATTRLEN; 1593 1593 1594 1594 crc = pj_crc32_calc(pdu, msg_len + 20); … … 1596 1596 1597 1597 if (crc != fingerprint) 1598 return PJ LIB_UTIL_ESTUNFINGERPRINT;1598 return PJNATH_ESTUNFINGERPRINT; 1599 1599 } 1600 1600 } … … 1619 1619 1620 1620 PJ_ASSERT_RETURN(PJ_STUN_IS_REQUEST(msg_type), 1621 PJ LIB_UTIL_ESTUNINMSGTYPE);1621 PJNATH_ESTUNINMSGTYPE); 1622 1622 1623 1623 /* Create response or error response */ … … 1729 1729 &err_msg, p_response); 1730 1730 } 1731 return PJ LIB_UTIL_ESTUNINATTRLEN;1731 return PJNATH_ESTUNINATTRLEN; 1732 1732 } 1733 1733 … … 1758 1758 } 1759 1759 1760 return PJ LIB_UTIL_ESTUNUNKNOWNATTR;1760 return PJNATH_ESTUNUNKNOWNATTR; 1761 1761 } 1762 1762 … … 1806 1806 NULL, p_response); 1807 1807 } 1808 return PJ LIB_UTIL_ESTUNDUPATTR;1808 return PJNATH_ESTUNDUPATTR; 1809 1809 } 1810 1810 has_msg_int = PJ_TRUE; … … 1820 1820 NULL, p_response); 1821 1821 } 1822 return PJ LIB_UTIL_ESTUNDUPATTR;1822 return PJNATH_ESTUNDUPATTR; 1823 1823 } 1824 1824 has_fingerprint = PJ_TRUE; … … 1834 1834 NULL, p_response); 1835 1835 } 1836 return has_fingerprint ? PJ LIB_UTIL_ESTUNFINGERPOS :1837 PJ LIB_UTIL_ESTUNMSGINTPOS;1836 return has_fingerprint ? PJNATH_ESTUNFINGERPOS : 1837 PJNATH_ESTUNMSGINTPOS; 1838 1838 } 1839 1839 } … … 1849 1849 &e, p_response); 1850 1850 } 1851 return PJ LIB_UTIL_ESTUNTOOMANYATTR;1851 return PJNATH_ESTUNTOOMANYATTR; 1852 1852 } 1853 1853 … … 2028 2028 2029 2029 /* There mustn't any attribute after FINGERPRINT */ 2030 PJ_ASSERT_RETURN(afingerprint == NULL, PJ LIB_UTIL_ESTUNFINGERPOS);2030 PJ_ASSERT_RETURN(afingerprint == NULL, PJNATH_ESTUNFINGERPOS); 2031 2031 2032 2032 if (attr_hdr->type == PJ_STUN_ATTR_MESSAGE_INTEGRITY) { 2033 2033 /* There mustn't be MESSAGE-INTEGRITY before */ 2034 2034 PJ_ASSERT_RETURN(amsgint == NULL, 2035 PJ LIB_UTIL_ESTUNMSGINTPOS);2035 PJNATH_ESTUNMSGINTPOS); 2036 2036 amsgint = (pj_stun_msgint_attr*) attr_hdr; 2037 2037 … … 2071 2071 /* Should not happen for message generated by us */ 2072 2072 pj_assert(PJ_FALSE); 2073 return PJ LIB_UTIL_ESTUNMSGINTPOS;2073 return PJNATH_ESTUNMSGINTPOS; 2074 2074 2075 2075 } else if (i == msg->attr_count-2) { … … 2077 2077 /* Should not happen for message generated by us */ 2078 2078 pj_assert(PJ_FALSE); 2079 return PJ LIB_UTIL_ESTUNMSGINTPOS;2079 return PJNATH_ESTUNMSGINTPOS; 2080 2080 } else { 2081 2081 afingerprint = (pj_stun_fingerprint_attr*) msg->attr[i+1]; … … 2087 2087 /* Should not happen for message generated by us */ 2088 2088 pj_assert(PJ_FALSE); 2089 return PJ LIB_UTIL_ESTUNNOUSERNAME;2089 return PJNATH_ESTUNNOUSERNAME; 2090 2090 } 2091 2091 -
pjproject/trunk/pjnath/src/pjnath/stun_msg_dump.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj lib-util/stun_msg.h>20 #include <pj lib-util/errno.h>19 #include <pjnath/stun_msg.h> 20 #include <pjnath/errno.h> 21 21 #include <pj/assert.h> 22 22 #include <pj/string.h> … … 81 81 attr = (const pj_stun_sockaddr_attr*)ahdr; 82 82 83 if (attr-> addr.addr.sa_family == PJ_AF_INET) {83 if (attr->sockaddr.addr.sa_family == PJ_AF_INET) { 84 84 len = pj_ansi_snprintf(p, end-p, 85 85 ", IPv4 addr=%s:%d\n", 86 pj_inet_ntoa(attr-> addr.ipv4.sin_addr),87 pj_ntohs(attr-> addr.ipv4.sin_port));88 89 } else if (attr-> addr.addr.sa_family == PJ_AF_INET6) {86 pj_inet_ntoa(attr->sockaddr.ipv4.sin_addr), 87 pj_ntohs(attr->sockaddr.ipv4.sin_port)); 88 89 } else if (attr->sockaddr.addr.sa_family == PJ_AF_INET6) { 90 90 len = pj_ansi_snprintf(p, end-p, 91 91 ", IPv6 addr present\n"); -
pjproject/trunk/pjnath/src/pjnath/stun_session.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj lib-util/stun_session.h>19 #include <pjnath/stun_session.h> 20 20 #include <pjlib.h> 21 21 22 22 struct pj_stun_session 23 23 { 24 pj_stun_ endpoint *endpt;24 pj_stun_config *cfg; 25 25 pj_pool_t *pool; 26 26 pj_mutex_t *mutex; … … 120 120 121 121 /* Create pool and initialize basic tdata attributes */ 122 pool = pj_pool_create(sess-> endpt->pf, "tdata%p",122 pool = pj_pool_create(sess->cfg->pf, "tdata%p", 123 123 TDATA_POOL_SIZE, TDATA_POOL_INC, NULL); 124 124 PJ_ASSERT_RETURN(pool, PJ_ENOMEM); … … 171 171 } 172 172 if (tdata->res_timer.id != PJ_FALSE) { 173 pj_timer_heap_cancel(tdata->sess-> endpt->timer_heap,173 pj_timer_heap_cancel(tdata->sess->cfg->timer_heap, 174 174 &tdata->res_timer); 175 175 tdata->res_timer.id = PJ_FALSE; … … 224 224 225 225 /* The server SHOULD include a SERVER attribute in all responses */ 226 if ( PJ_STUN_IS_RESPONSE(msg->hdr.type) ||227 PJ_STUN_IS_ERROR_RESPONSE(msg->hdr.type))226 if (sess->srv_name.slen && (PJ_STUN_IS_RESPONSE(msg->hdr.type) || 227 PJ_STUN_IS_ERROR_RESPONSE(msg->hdr.type))) 228 228 { 229 229 pj_stun_msg_add_string_attr(pool, msg, PJ_STUN_ATTR_SERVER, … … 301 301 /* **************************************************************************/ 302 302 303 PJ_DEF(pj_status_t) pj_stun_session_create( pj_stun_ endpoint *endpt,303 PJ_DEF(pj_status_t) pj_stun_session_create( pj_stun_config *cfg, 304 304 const char *name, 305 305 const pj_stun_session_cb *cb, … … 311 311 pj_status_t status; 312 312 313 PJ_ASSERT_RETURN( endpt&& cb && p_sess, PJ_EINVAL);313 PJ_ASSERT_RETURN(cfg && cb && p_sess, PJ_EINVAL); 314 314 315 315 if (name==NULL) 316 316 name = "sess%p"; 317 317 318 pool = pj_pool_create( endpt->pf, name, 4000, 4000, NULL);318 pool = pj_pool_create(cfg->pf, name, 4000, 4000, NULL); 319 319 PJ_ASSERT_RETURN(pool, PJ_ENOMEM); 320 320 321 321 sess = PJ_POOL_ZALLOC_T(pool, pj_stun_session); 322 sess-> endpt = endpt;322 sess->cfg = cfg; 323 323 sess->pool = pool; 324 324 pj_memcpy(&sess->cb, cb, sizeof(*cb)); … … 384 384 const pj_str_t *srv_name) 385 385 { 386 PJ_ASSERT_RETURN(sess && srv_name, PJ_EINVAL); 387 pj_strdup(sess->pool, &sess->srv_name, srv_name); 386 PJ_ASSERT_RETURN(sess, PJ_EINVAL); 387 if (srv_name) 388 pj_strdup(sess->pool, &sess->srv_name, srv_name); 389 else 390 sess->srv_name.slen = 0; 388 391 return PJ_SUCCESS; 389 392 } … … 490 493 char buf[512]; 491 494 492 if (dst->sa_family == PJ_AF_INET) { 493 const pj_sockaddr_in *dst4 = (const pj_sockaddr_in*)dst; 494 dst_name = pj_inet_ntoa(dst4->sin_addr); 495 dst_port = pj_ntohs(dst4->sin_port); 496 } else if (dst->sa_family == PJ_AF_INET6) { 497 const pj_sockaddr_in6 *dst6 = (const pj_sockaddr_in6*)dst; 495 if (dst->addr.sa_family == PJ_AF_INET) { 496 dst_name = pj_inet_ntoa(dst->ipv4.sin_addr); 497 dst_port = pj_ntohs(dst->ipv4.sin_port); 498 } else if (dst->addr.sa_family == PJ_AF_INET6) { 498 499 dst_name = "IPv6"; 499 dst_port = pj_ntohs(dst 6->sin6_port);500 dst_port = pj_ntohs(dst->ipv6.sin6_port); 500 501 } else { 501 502 LOG_ERR_(sess, "Invalid address family", PJ_EINVAL); … … 559 560 560 561 /* Create STUN client transaction */ 561 status = pj_stun_client_tsx_create(sess-> endpt, tdata->pool,562 status = pj_stun_client_tsx_create(sess->cfg, tdata->pool, 562 563 &tsx_cb, &tdata->client_tsx); 563 564 PJ_ASSERT_RETURN(status==PJ_SUCCESS, status); … … 593 594 &on_cache_timeout); 594 595 595 timeout.sec = sess-> endpt->res_cache_msec / 1000;596 timeout.msec = sess-> endpt->res_cache_msec % 1000;597 598 status = pj_timer_heap_schedule(sess-> endpt->timer_heap,596 timeout.sec = sess->cfg->res_cache_msec / 1000; 597 timeout.msec = sess->cfg->res_cache_msec % 1000; 598 599 status = pj_timer_heap_schedule(sess->cfg->timer_heap, 599 600 &tdata->res_timer, 600 601 &timeout); … … 830 831 PJ_ASSERT_RETURN(sess && packet && pkt_size, PJ_EINVAL); 831 832 832 tmp_pool = pj_pool_create(sess-> endpt->pf, "tmpstun", 1024, 1024, NULL);833 tmp_pool = pj_pool_create(sess->cfg->pf, "tmpstun", 1024, 1024, NULL); 833 834 if (!tmp_pool) 834 835 return PJ_ENOMEM; -
pjproject/trunk/pjnath/src/pjnath/stun_transaction.c
r1062 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj lib-util/stun_transaction.h>20 #include <pj lib-util/errno.h>19 #include <pjnath/stun_transaction.h> 20 #include <pjnath/errno.h> 21 21 #include <pj/assert.h> 22 22 #include <pj/log.h> … … 32 32 { 33 33 char obj_name[PJ_MAX_OBJ_NAME]; 34 pj_stun_ endpoint *endpt;34 pj_stun_config *cfg; 35 35 pj_stun_tsx_cb cb; 36 36 void *user_data; … … 64 64 * Create a STUN client transaction. 65 65 */ 66 PJ_DEF(pj_status_t) pj_stun_client_tsx_create(pj_stun_ endpoint *endpt,66 PJ_DEF(pj_status_t) pj_stun_client_tsx_create(pj_stun_config *cfg, 67 67 pj_pool_t *pool, 68 68 const pj_stun_tsx_cb *cb, … … 71 71 pj_stun_client_tsx *tsx; 72 72 73 PJ_ASSERT_RETURN( endpt&& cb && p_tsx, PJ_EINVAL);73 PJ_ASSERT_RETURN(cfg && cb && p_tsx, PJ_EINVAL); 74 74 PJ_ASSERT_RETURN(cb->on_send_msg, PJ_EINVAL); 75 75 76 76 tsx = PJ_POOL_ZALLOC_T(pool, pj_stun_client_tsx); 77 tsx-> endpt = endpt;77 tsx->cfg = cfg; 78 78 pj_memcpy(&tsx->cb, cb, sizeof(*cb)); 79 79 … … 98 98 99 99 if (tsx->timer.id != 0) { 100 pj_timer_heap_cancel(tsx-> endpt->timer_heap, &tsx->timer);100 pj_timer_heap_cancel(tsx->cfg->timer_heap, &tsx->timer); 101 101 tsx->timer.id = 0; 102 102 } … … 150 150 if (tsx->transmit_count == 0) { 151 151 tsx->retransmit_time.sec = 0; 152 tsx->retransmit_time.msec = tsx-> endpt->rto_msec;152 tsx->retransmit_time.msec = tsx->cfg->rto_msec; 153 153 154 154 } else if (tsx->transmit_count < PJ_STUN_MAX_RETRANSMIT_COUNT-1) { … … 169 169 * cancel transmission). 170 170 */; 171 status = pj_timer_heap_schedule(tsx-> endpt->timer_heap, &tsx->timer,171 status = pj_timer_heap_schedule(tsx->cfg->timer_heap, &tsx->timer, 172 172 &tsx->retransmit_time); 173 173 if (status != PJ_SUCCESS) { … … 183 183 if (status != PJ_SUCCESS) { 184 184 if (tsx->timer.id != 0) { 185 pj_timer_heap_cancel(tsx-> endpt->timer_heap, &tsx->timer);185 pj_timer_heap_cancel(tsx->cfg->timer_heap, &tsx->timer); 186 186 tsx->timer.id = 0; 187 187 } … … 236 236 tsx->complete = PJ_TRUE; 237 237 if (tsx->cb.on_complete) { 238 tsx->cb.on_complete(tsx, PJ LIB_UTIL_ESTUNNOTRESPOND, NULL);238 tsx->cb.on_complete(tsx, PJNATH_ESTUNNOTRESPOND, NULL); 239 239 } 240 240 return; … … 269 269 PJ_LOG(4,(tsx->obj_name, 270 270 "STUN rx_msg() error: not response message")); 271 return PJ LIB_UTIL_ESTUNNOTRESPONSE;271 return PJNATH_ESTUNNOTRESPONSE; 272 272 } 273 273 … … 277 277 */ 278 278 if (tsx->timer.id) { 279 pj_timer_heap_cancel(tsx-> endpt->timer_heap, &tsx->timer);279 pj_timer_heap_cancel(tsx->cfg->timer_heap, &tsx->timer); 280 280 tsx->timer.id = 0; 281 281 } … … 301 301 status = PJ_SUCCESS; 302 302 } else { 303 status = PJ LIB_UTIL_ESTUNTSXFAILED;303 status = PJNATH_ESTUNTSXFAILED; 304 304 } 305 305 -
pjproject/trunk/pjnath/src/pjstun-client/client_main.c
r1054 r1080 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pjnath.h> 19 20 #include <pjlib-util.h> 20 21 #include <pjlib.h> -
pjproject/trunk/pjnath/src/pjstun-srv-test/bind_usage.c
r1054 r1080 86 86 sess_cb.on_send_msg = &sess_on_send_msg; 87 87 sess_cb.on_rx_request = &sess_on_rx_request; 88 status = pj_stun_session_create(si-> endpt, "bind%p", &sess_cb, PJ_FALSE,88 status = pj_stun_session_create(si->cfg, "bind%p", &sess_cb, PJ_FALSE, 89 89 &bu->session); 90 90 if (status != PJ_SUCCESS) { -
pjproject/trunk/pjnath/src/pjstun-srv-test/server.c
r1049 r1080 84 84 goto on_error; 85 85 86 status = pj_stun_ endpoint_create(srv->si.pf, 0, srv->si.ioqueue,87 srv->si.timer_heap, &srv->si. endpt);86 status = pj_stun_config_create(srv->si.pf, 0, srv->si.ioqueue, 87 srv->si.timer_heap, &srv->si.cfg); 88 88 if (status != PJ_SUCCESS) 89 89 goto on_error; … … 175 175 } 176 176 177 pj_stun_ endpoint_destroy(srv->si.endpt);177 pj_stun_config_destroy(srv->si.cfg); 178 178 pj_timer_heap_destroy(srv->si.timer_heap); 179 179 pj_ioqueue_destroy(srv->si.ioqueue); -
pjproject/trunk/pjnath/src/pjstun-srv-test/server.h
r1054 r1080 20 20 #define __STUN_SERVER_H__ 21 21 22 #include <pjnath.h> 22 23 #include <pjlib-util.h> 23 24 #include <pjlib.h> … … 31 32 { 32 33 pj_pool_factory *pf; 33 pj_stun_ endpoint *endpt;34 pj_stun_config *cfg; 34 35 pj_ioqueue_t *ioqueue; 35 36 pj_timer_heap_t *timer_heap; -
pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
r1054 r1080 70 70 { 71 71 pj_pool_factory *pf; 72 pj_stun_ endpoint *endpt;72 pj_stun_config *cfg; 73 73 pj_ioqueue_t *ioqueue; 74 74 pj_timer_heap_t *timer_heap; … … 166 166 tu->type = type; 167 167 tu->pf = si->pf; 168 tu-> endpt = si->endpt;168 tu->cfg = si->cfg; 169 169 tu->ioqueue = si->ioqueue; 170 170 tu->timer_heap = si->timer_heap; … … 198 198 sess_cb.on_send_msg = &tu_sess_on_send_msg; 199 199 sess_cb.on_rx_request = &tu_sess_on_rx_request; 200 status = pj_stun_session_create(si-> endpt, "turns%p", &sess_cb, PJ_FALSE,200 status = pj_stun_session_create(si->cfg, "turns%p", &sess_cb, PJ_FALSE, 201 201 &tu->default_session); 202 202 if (status != PJ_SUCCESS) { … … 208 208 sd->tu = tu; 209 209 pj_stun_session_set_user_data(tu->default_session, sd); 210 211 pj_stun_session_set_server_name(tu->default_session, NULL); 210 212 211 213 /* Create mutex */ … … 621 623 sess_cb.on_rx_request = &client_sess_on_rx_msg; 622 624 sess_cb.on_rx_indication = &client_sess_on_rx_msg; 623 status = pj_stun_session_create(tu-> endpt, client->obj_name,625 status = pj_stun_session_create(tu->cfg, client->obj_name, 624 626 &sess_cb, PJ_FALSE, 625 627 &client->session); -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r974 r1080 568 568 pj_memcpy(&tdata->tp_info.dst_addr, addr, addr_len); 569 569 tdata->tp_info.dst_addr_len = addr_len; 570 if (((pj_sockaddr*)addr)-> sa_family == PJ_AF_INET) {570 if (((pj_sockaddr*)addr)->addr.sa_family == PJ_AF_INET) { 571 571 const char *str_addr; 572 572 str_addr = pj_inet_ntoa(((pj_sockaddr_in*)addr)->sin_addr); … … 1362 1362 */ 1363 1363 else if ((flag & PJSIP_TRANSPORT_DATAGRAM) && 1364 (remote_addr-> sa_family == PJ_AF_INET))1364 (remote_addr->addr.sa_family == PJ_AF_INET)) 1365 1365 { 1366 1366 pj_sockaddr_in *addr = (pj_sockaddr_in*)&key.addr; -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r974 r1080 787 787 788 788 /* Check that address is a sockaddr_in */ 789 PJ_ASSERT_RETURN(rem_addr-> sa_family == PJ_AF_INET &&789 PJ_ASSERT_RETURN(rem_addr->addr.sa_family == PJ_AF_INET && 790 790 addr_len == sizeof(pj_sockaddr_in), PJ_EINVAL); 791 791 -
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r974 r1080 470 470 471 471 /* Remote address is left zero (except the family) */ 472 tp->base.key.rem_addr. sa_family = PJ_AF_INET;472 tp->base.key.rem_addr.addr.sa_family = PJ_AF_INET; 473 473 474 474 /* Type name. */
Note: See TracChangeset
for help on using the changeset viewer.