Ignore:
Timestamp:
Mar 18, 2007 5:39:27 PM (14 years ago)
Author:
bennylp
Message:

Changed pj_sockaddr structure and added pjnath project for ICE/STUN stuffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/sock.h

    r974 r1080  
    175175 */ 
    176176#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 added 
    181  * to this struct. As far the application is concerned, the value of 
    182  * this member will always be zero. Internally, PJLIB may modify the value 
    183  * before calling OS socket API, and reset the value back to zero before 
    184  * returning the struct to application. 
    185  */ 
    186 typedef struct pj_sockaddr 
    187 { 
    188 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 
    189     pj_uint8_t  sa_zero_len; 
    190     pj_uint8_t  sa_family; 
    191 #else 
    192     pj_uint16_t sa_family;      /**< Common data: address family.   */ 
    193 #endif 
    194     char        sa_data[14];    /**< Address data.                  */ 
    195 } pj_sockaddr; 
    196  
    197177 
    198178#undef s_addr 
     
    277257 
    278258 
     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 */ 
     267typedef 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 */ 
     281typedef 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 
    279289/***************************************************************************** 
    280290 * 
Note: See TracChangeset for help on using the changeset viewer.