diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2013-02-07 09:35:34 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2013-02-07 09:35:34 +0000 |
commit | cdb0f86fac81b206ee8e260d2b344e36cb3ac0aa (patch) | |
tree | a9d4aa8d94fc7e0ccfce07ff99d4e078008bb14d /pjlib/include | |
parent | 7b7c7c8b42a8c25b30b07a8cd524cccbb60173b3 (diff) |
Close #1602: configurable local port range for ICE transport.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4343 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r-- | pjlib/include/pj/sock.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h index 83d35db9..4011f21a 100644 --- a/pjlib/include/pj/sock.h +++ b/pjlib/include/pj/sock.h @@ -1166,6 +1166,24 @@ PJ_DECL(pj_status_t) pj_sock_bind_in( pj_sock_t sockfd, pj_uint32_t addr, pj_uint16_t port); +/** + * Bind the IP socket sockfd to the given address and a random port in the + * specified range. + * + * @param sockfd The socket desriptor. + * @param addr The local address and port to bind the socket to. + * @param port_range The port range, relative the to start port number + * specified in port field in #addr. Note that if the + * port is zero, this param will be ignored. + * @param max_try Maximum retries. + * + * @return Zero on success. + */ +PJ_DECL(pj_status_t) pj_sock_bind_random( pj_sock_t sockfd, + const pj_sockaddr_t *addr, + pj_uint16_t port_range, + pj_uint16_t max_try); + #if PJ_HAS_TCP /** * Listen for incoming connection. This function only applies to connection |