diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-03-18 17:39:27 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-03-18 17:39:27 +0000 |
commit | 25c436a6432ebac429285c81f990653a4c52dd3c (patch) | |
tree | 8f145c79bd09aa7bd7390100f809ca72bf2f069b /pjlib | |
parent | 331af12f95e6c79555ce45e5ea9c387fd70915dc (diff) |
Changed pj_sockaddr structure and added pjnath project for ICE/STUN stuffs
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1080 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/errno.h | 1 | ||||
-rw-r--r-- | pjlib/include/pj/sock.h | 50 |
2 files changed, 31 insertions, 20 deletions
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h index 6ff304d6..71ba69fd 100644 --- a/pjlib/include/pj/errno.h +++ b/pjlib/include/pj/errno.h @@ -341,6 +341,7 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, * - PJMEDIA_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE) * - PJSIP_SIMPLE_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*2) * - PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3) + * - PJNATH_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4) */ diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h index e7bcee13..d2da570c 100644 --- a/pjlib/include/pj/sock.h +++ b/pjlib/include/pj/sock.h @@ -175,26 +175,6 @@ typedef enum pj_socket_sd_type */ #define PJ_INVALID_SOCKET (-1) -/** - * Structure describing a generic socket address. - * If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added - * to this struct. As far the application is concerned, the value of - * this member will always be zero. Internally, PJLIB may modify the value - * before calling OS socket API, and reset the value back to zero before - * returning the struct to application. - */ -typedef struct pj_sockaddr -{ -#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 - pj_uint8_t sa_zero_len; - pj_uint8_t sa_family; -#else - pj_uint16_t sa_family; /**< Common data: address family. */ -#endif - char sa_data[14]; /**< Address data. */ -} pj_sockaddr; - - #undef s_addr /** @@ -276,6 +256,36 @@ typedef struct pj_sockaddr_in6 } pj_sockaddr_in6; +/** + * This structure describes common attributes found in transport addresses. + * If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added + * to this struct. As far the application is concerned, the value of + * this member will always be zero. Internally, PJLIB may modify the value + * before calling OS socket API, and reset the value back to zero before + * returning the struct to application. + */ +typedef struct pj_addr_hdr +{ +#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 + pj_uint8_t sa_zero_len; + pj_uint8_t sa_family; +#else + pj_uint16_t sa_family; /**< Common data: address family. */ +#endif +} pj_addr_hdr; + + +/** + * This union describes a generic socket address. + */ +typedef union pj_sockaddr +{ + pj_addr_hdr addr; /**< Generic transport address. */ + pj_sockaddr_in ipv4; /**< IPv4 transport address. */ + pj_sockaddr_in6 ipv6; /**< IPv6 transport address. */ +} pj_sockaddr; + + /***************************************************************************** * * SOCKET ADDRESS MANIPULATION. |