Ignore:
Timestamp:
Dec 2, 2007 3:36:46 PM (16 years ago)
Author:
bennylp
Message:

More ticket #415: Added pj_sockaddr_get_len() and pj_inet_ntop2(), and fixed Symbian combilation warnings with gcce

File:
1 edited

Legend:

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

    r1601 r1608  
    609609 *              for IPv4, PJ_INET6_ADDRSTRLEN characters for IPv6). 
    610610 * 
    611  * @return      PJ_SUCCESS if conversion was successful.. 
     611 * @return      PJ_SUCCESS if conversion was successful. 
    612612 */ 
    613613PJ_DECL(pj_status_t) pj_inet_ntop(int af, const void *src, 
    614614                                  char *dst, int size); 
     615 
     616/** 
     617 * Converts numeric address into its text string representation. 
     618 * 
     619 * @param af    Specify the family of the address. This can be PJ_AF_INET 
     620 *              or PJ_AF_INET6. 
     621 * @param src   Points to a buffer holding an IPv4 address if the af argument 
     622 *              is PJ_AF_INET, or an IPv6 address if the af argument is 
     623 *              PJ_AF_INET6; the address must be in network byte order.   
     624 * @param dst   Points to a buffer where the function stores the resulting 
     625 *              text string; it shall not be NULL.   
     626 * @param size  Specifies the size of this buffer, which shall be large  
     627 *              enough to hold the text string (PJ_INET_ADDRSTRLEN characters 
     628 *              for IPv4, PJ_INET6_ADDRSTRLEN characters for IPv6). 
     629 * 
     630 * @return      The address string or NULL if failed. 
     631 */ 
     632PJ_DECL(char*) pj_inet_ntop2(int af, const void *src, 
     633                             char *dst, int size); 
     634 
    615635 
    616636/** 
     
    708728 * @param addr      Socket address. 
    709729 * 
    710  * @return          Port number, in host byte order. 
     730 * @return          Length in bytes. 
    711731 */ 
    712732PJ_DECL(unsigned) pj_sockaddr_get_addr_len(const pj_sockaddr_t *addr); 
     733 
     734/** 
     735 * Get the socket address length, based on its address 
     736 * family. For PJ_AF_INET, the length will be sizeof(pj_sockaddr_in), and 
     737 * for PJ_AF_INET6, the length will be sizeof(pj_sockaddr_in6). 
     738 *  
     739 * @param addr      Socket address. 
     740 * 
     741 * @return          Length in bytes. 
     742 */ 
     743PJ_DECL(unsigned) pj_sockaddr_get_len(const pj_sockaddr_t *addr); 
    713744 
    714745/** 
Note: See TracChangeset for help on using the changeset viewer.