diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-09-16 16:11:44 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-09-16 16:11:44 +0000 |
commit | 9c41f0a3aadb8ca284613dd552128338af16dc2e (patch) | |
tree | caafaaf6ef961ee3364b234810d88c2a036ca267 /pjlib/include | |
parent | bb6a559857e1fe679c156042dd6e979701dcf6a9 (diff) |
Ticket #629: Added IGMPv2 multicast socket options (thanks David Parker for the patch).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2283 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r-- | pjlib/include/pj/compat/socket.h | 4 | ||||
-rw-r--r-- | pjlib/include/pj/sock.h | 54 |
2 files changed, 56 insertions, 2 deletions
diff --git a/pjlib/include/pj/compat/socket.h b/pjlib/include/pj/compat/socket.h index eb0f870e..d234aca2 100644 --- a/pjlib/include/pj/compat/socket.h +++ b/pjlib/include/pj/compat/socket.h @@ -53,14 +53,14 @@ * These VS uses Microsoft Platform SDK for Windows Server 2003 SP1, and * it has built-in IPv6 support. */ -#if defined(_MSC_VER) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 +#if defined(_MSC_VER) # ifndef s_addr # define s_addr S_un.S_addr # endif # include <ws2tcpip.h> -# ifndef IPPROTO_IPV6 +# if !defined(IPPROTO_IPV6) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 /* Need to download and install IPv6Kit for this platform. * Please see the comments above about Visual Studio 6. */ diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h index b9deb3d6..f700e192 100644 --- a/pjlib/include/pj/sock.h +++ b/pjlib/include/pj/sock.h @@ -289,6 +289,21 @@ extern const pj_uint16_t PJ_SO_RCVBUF; /** Buffer size for send. @see pj_SO_SNDBUF() */ extern const pj_uint16_t PJ_SO_SNDBUF; +/** IP multicast interface. @see pj_IP_MULTICAST_IF() */ +extern const pj_uint16_t PJ_IP_MULTICAST_IF; + +/** IP multicast ttl. @see pj_IP_MULTICAST_TTL() */ +extern const pj_uint16_t PJ_IP_MULTICAST_TTL; + +/** IP multicast loopback. @see pj_IP_MULTICAST_LOOP() */ +extern const pj_uint16_t PJ_IP_MULTICAST_LOOP; + +/** Add an IP group membership. @see pj_IP_ADD_MEMBERSHIP() */ +extern const pj_uint16_t PJ_IP_ADD_MEMBERSHIP; + +/** Drop an IP group membership. @see pj_IP_DROP_MEMBERSHIP() */ +extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP; + #if defined(PJ_DLL) /** Get #PJ_SO_TYPE constant */ @@ -299,6 +314,21 @@ extern const pj_uint16_t PJ_SO_SNDBUF; /** Get #PJ_SO_SNDBUF constant */ PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void); + + /** Get #PJ_IP_MULTICAST_IF constant */ + PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_IF(void); + + /** Get #PJ_IP_MULTICAST_TTL constant */ + PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_TTL(void); + + /** Get #PJ_IP_MULTICAST_LOOP constant */ + PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_LOOP(void); + + /** Get #PJ_IP_ADD_MEMBERSHIP constant */ + PJ_DECL(pj_uint16_t) pj_IP_ADD_MEMBERSHIP(void); + + /** Get #PJ_IP_DROP_MEMBERSHIP constant */ + PJ_DECL(pj_uint16_t) pj_IP_DROP_MEMBERSHIP(void); #else /** Get #PJ_SO_TYPE constant */ # define pj_SO_TYPE() PJ_SO_TYPE @@ -308,6 +338,21 @@ extern const pj_uint16_t PJ_SO_SNDBUF; /** Get #PJ_SO_SNDBUF constant */ # define pj_SO_SNDBUF() PJ_SO_SNDBUF + + /** Get #PJ_IP_MULTICAST_IF constant */ +# define pj_IP_MULTICAST_IF() PJ_IP_MULTICAST_IF + + /** Get #PJ_IP_MULTICAST_TTL constant */ +# define pj_IP_MULTICAST_TTL() PJ_IP_MULTICAST_TTL + + /** Get #PJ_IP_MULTICAST_LOOP constant */ +# define pj_IP_MULTICAST_LOOP() PJ_IP_MULTICAST_LOOP + + /** Get #PJ_IP_ADD_MEMBERSHIP constant */ +# define pj_IP_ADD_MEMBERSHIP() PJ_IP_ADD_MEMBERSHIP + + /** Get #PJ_IP_DROP_MEMBERSHIP constant */ +# define pj_IP_DROP_MEMBERSHIP() PJ_IP_DROP_MEMBERSHIP #endif @@ -515,6 +560,15 @@ typedef union pj_sockaddr } pj_sockaddr; +/** + * This structure provides multicast group information for IPv4 addresses. + */ +typedef struct pj_ip_mreq { + pj_in_addr imr_multiaddr; /**< IP multicast address of group. */ + pj_in_addr imr_interface; /**< local IP address of interface. */ +} pj_ip_mreq; + + /***************************************************************************** * * SOCKET ADDRESS MANIPULATION. |