Changeset 2283 for pjproject/trunk


Ignore:
Timestamp:
Sep 16, 2008 4:11:44 PM (16 years ago)
Author:
nanang
Message:

Ticket #629: Added IGMPv2 multicast socket options (thanks David Parker for the patch).

Location:
pjproject/trunk/pjlib
Files:
5 edited

Legend:

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

    r2190 r2283  
    5454 * it has built-in IPv6 support. 
    5555 */ 
    56 #if defined(_MSC_VER) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
     56#if defined(_MSC_VER) 
    5757#   ifndef s_addr 
    5858#       define s_addr  S_un.S_addr 
     
    6161#   include <ws2tcpip.h> 
    6262 
    63 #   ifndef IPPROTO_IPV6 
     63#   if !defined(IPPROTO_IPV6) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    6464        /* Need to download and install IPv6Kit for this platform. 
    6565         * Please see the comments above about Visual Studio 6. 
  • pjproject/trunk/pjlib/include/pj/sock.h

    r2039 r2283  
    290290extern const pj_uint16_t PJ_SO_SNDBUF; 
    291291 
     292/** IP multicast interface. @see pj_IP_MULTICAST_IF() */ 
     293extern const pj_uint16_t PJ_IP_MULTICAST_IF; 
     294  
     295/** IP multicast ttl. @see pj_IP_MULTICAST_TTL() */ 
     296extern const pj_uint16_t PJ_IP_MULTICAST_TTL; 
     297 
     298/** IP multicast loopback. @see pj_IP_MULTICAST_LOOP() */ 
     299extern const pj_uint16_t PJ_IP_MULTICAST_LOOP; 
     300 
     301/** Add an IP group membership. @see pj_IP_ADD_MEMBERSHIP() */ 
     302extern const pj_uint16_t PJ_IP_ADD_MEMBERSHIP; 
     303 
     304/** Drop an IP group membership. @see pj_IP_DROP_MEMBERSHIP() */ 
     305extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP; 
     306 
    292307 
    293308#if defined(PJ_DLL) 
     
    300315    /** Get #PJ_SO_SNDBUF constant */ 
    301316    PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void); 
     317 
     318    /** Get #PJ_IP_MULTICAST_IF constant */ 
     319    PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_IF(void); 
     320 
     321    /** Get #PJ_IP_MULTICAST_TTL constant */ 
     322    PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_TTL(void); 
     323 
     324    /** Get #PJ_IP_MULTICAST_LOOP constant */ 
     325    PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_LOOP(void); 
     326 
     327    /** Get #PJ_IP_ADD_MEMBERSHIP constant */ 
     328    PJ_DECL(pj_uint16_t) pj_IP_ADD_MEMBERSHIP(void); 
     329 
     330    /** Get #PJ_IP_DROP_MEMBERSHIP constant */ 
     331    PJ_DECL(pj_uint16_t) pj_IP_DROP_MEMBERSHIP(void); 
    302332#else 
    303333    /** Get #PJ_SO_TYPE constant */ 
     
    309339    /** Get #PJ_SO_SNDBUF constant */ 
    310340#   define pj_SO_SNDBUF()   PJ_SO_SNDBUF 
     341 
     342    /** Get #PJ_IP_MULTICAST_IF constant */ 
     343#   define pj_IP_MULTICAST_IF()    PJ_IP_MULTICAST_IF 
     344 
     345    /** Get #PJ_IP_MULTICAST_TTL constant */ 
     346#   define pj_IP_MULTICAST_TTL()   PJ_IP_MULTICAST_TTL 
     347 
     348    /** Get #PJ_IP_MULTICAST_LOOP constant */ 
     349#   define pj_IP_MULTICAST_LOOP()  PJ_IP_MULTICAST_LOOP 
     350 
     351    /** Get #PJ_IP_ADD_MEMBERSHIP constant */ 
     352#   define pj_IP_ADD_MEMBERSHIP()  PJ_IP_ADD_MEMBERSHIP 
     353 
     354    /** Get #PJ_IP_DROP_MEMBERSHIP constant */ 
     355#   define pj_IP_DROP_MEMBERSHIP() PJ_IP_DROP_MEMBERSHIP 
    311356#endif 
    312357 
     
    516561 
    517562 
     563/** 
     564 * This structure provides multicast group information for IPv4 addresses. 
     565 */ 
     566typedef struct pj_ip_mreq { 
     567    pj_in_addr imr_multiaddr;   /**< IP multicast address of group. */ 
     568    pj_in_addr imr_interface;   /**< local IP address of interface. */ 
     569} pj_ip_mreq; 
     570 
     571 
    518572/***************************************************************************** 
    519573 * 
  • pjproject/trunk/pjlib/src/pj/sock_bsd.c

    r2039 r2283  
    116116const pj_uint16_t PJ_SO_RCVBUF  = SO_RCVBUF; 
    117117const pj_uint16_t PJ_SO_SNDBUF  = SO_SNDBUF; 
     118const pj_uint16_t pj_IP_MULTICAST_IF    = IP_MULTICAST_IF; 
     119const pj_uint16_t pj_IP_MULTICAST_TTL   = IP_MULTICAST_TTL; 
     120const pj_uint16_t pj_IP_MULTICAST_LOOP  = IP_MULTICAST_LOOP; 
     121const pj_uint16_t pj_IP_ADD_MEMBERSHIP  = IP_ADD_MEMBERSHIP; 
     122const pj_uint16_t pj_IP_DROP_MEMBERSHIP = IP_DROP_MEMBERSHIP; 
    118123 
    119124 
  • pjproject/trunk/pjlib/src/pj/sock_common.c

    r2207 r2283  
    687687} 
    688688 
     689PJ_DEF(pj_uint16_t) pj_IP_MULTICAST_IF(void) 
     690{ 
     691    return PJ_IP_MULTICAST_IF; 
     692} 
     693 
     694PJ_DEF(pj_uint16_t) pj_IP_MULTICAST_TTL(void) 
     695{ 
     696    return PJ_IP_MULTICAST_TTL; 
     697} 
     698 
     699PJ_DEF(pj_uint16_t) pj_IP_MULTICAST_LOOP(void) 
     700{ 
     701    return PJ_IP_MULTICAST_LOOP; 
     702} 
     703 
     704PJ_DEF(pj_uint16_t) pj_IP_ADD_MEMBERSHIP(void) 
     705{ 
     706    return PJ_IP_ADD_MEMBERSHIP; 
     707} 
     708 
     709PJ_DEF(pj_uint16_t) pj_IP_DROP_MEMBERSHIP(void) 
     710{ 
     711    return PJ_IP_DROP_MEMBERSHIP; 
     712} 
     713 
    689714PJ_DEF(int) pj_MSG_OOB(void) 
    690715{ 
  • pjproject/trunk/pjlib/src/pj/sock_symbian.cpp

    r2039 r2283  
    6565const pj_uint16_t PJ_SO_RCVBUF  = 0xFFFF; 
    6666const pj_uint16_t PJ_SO_SNDBUF  = 0xFFFF; 
     67 
     68/* IP multicast is also not supported. */ 
     69const pj_uint16_t pj_IP_MULTICAST_IF    = 0xFFFF; 
     70const pj_uint16_t pj_IP_MULTICAST_TTL   = 0xFFFF; 
     71const pj_uint16_t pj_IP_MULTICAST_LOOP  = 0xFFFF; 
     72const pj_uint16_t pj_IP_ADD_MEMBERSHIP  = 0xFFFF; 
     73const pj_uint16_t pj_IP_DROP_MEMBERSHIP = 0xFFFF; 
    6774 
    6875/* Flags */ 
Note: See TracChangeset for help on using the changeset viewer.