apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r157601 - in apr/apr/branches/1.1.x: CHANGES build/apr_network.m4 configure.in include/apr_network_io.h network_io/unix/multicast.c
Date Tue, 15 Mar 2005 22:41:03 GMT
Author: pquerna
Date: Tue Mar 15 14:41:02 2005
New Revision: 157601

URL: http://svn.apache.org/viewcvs?view=rev&rev=157601
Log:
Backport r153917 and r153932 from trunk. Build fixes for multicast on Tru64 and HP-UX.

Modified:
    apr/apr/branches/1.1.x/CHANGES
    apr/apr/branches/1.1.x/build/apr_network.m4
    apr/apr/branches/1.1.x/configure.in
    apr/apr/branches/1.1.x/include/apr_network_io.h
    apr/apr/branches/1.1.x/network_io/unix/multicast.c

Modified: apr/apr/branches/1.1.x/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/CHANGES?view=diff&r1=157600&r2=157601
==============================================================================
--- apr/apr/branches/1.1.x/CHANGES (original)
+++ apr/apr/branches/1.1.x/CHANGES Tue Mar 15 14:41:02 2005
@@ -1,5 +1,7 @@
 Changes for APR 1.1.1
 
+  *) Build fix for Multicast support on HP-UX 11.00 and Tru64 [Joe Orton]
+
   *) Fix libapr.rc for Win32 builds [William Rowe]
 
   *) Rewrite apr_file_writev_full using apr_file_write_full. [Paul Querna]

Modified: apr/apr/branches/1.1.x/build/apr_network.m4
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/build/apr_network.m4?view=diff&r1=157600&r2=157601
==============================================================================
--- apr/apr/branches/1.1.x/build/apr_network.m4 (original)
+++ apr/apr/branches/1.1.x/build/apr_network.m4 Tue Mar 15 14:41:02 2005
@@ -667,6 +667,22 @@
 fi
 ])
 
+dnl APR_CHECK_MCAST: check for multicast interfaces
+AC_DEFUN([APR_CHECK_MCAST], [
+AC_CACHE_CHECK([for struct ip_mreq], [apr_cv_struct_ipmreq], [
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <netinet/in.h>
+], [
+    struct ip_mreq mip;
+    mip.imr_interface.s_addr = INADDR_ANY;
+], [apr_cv_struct_ipmreq=yes], [apr_cv_struct_ipmreq=no], [apr_cv_struct_ipmreq=yes])])
+
+if test $apr_cv_struct_ipmreq = yes; then
+   AC_DEFINE([HAVE_STRUCT_IPMREQ], 1, [Define if struct impreq was found])
+fi
+])
+
 dnl
 dnl APR_CHECK_H_ERRNO_FLAG
 dnl

Modified: apr/apr/branches/1.1.x/configure.in
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/configure.in?view=diff&r1=157600&r2=157601
==============================================================================
--- apr/apr/branches/1.1.x/configure.in (original)
+++ apr/apr/branches/1.1.x/configure.in Tue Mar 15 14:41:02 2005
@@ -1902,6 +1902,7 @@
 fi
 
 APR_CHECK_SCTP
+APR_CHECK_MCAST
 
 AC_SUBST(apr_tcp_nopush_flag)
 AC_SUBST(have_corkable_tcp)

Modified: apr/apr/branches/1.1.x/include/apr_network_io.h
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/include/apr_network_io.h?view=diff&r1=157600&r2=157601
==============================================================================
--- apr/apr/branches/1.1.x/include/apr_network_io.h (original)
+++ apr/apr/branches/1.1.x/include/apr_network_io.h Tue Mar 15 14:41:02 2005
@@ -770,14 +770,14 @@
  * Leave a Multicast Group.  All arguments must be the same as
  * apr_mcast_join.
  * @param sock The socket to leave a multicast group
- * @param leave The address of the multicast group to leave
+ * @param addr The address of the multicast group to leave
  * @param iface Address of the interface to use.  If NULL is passed, the 
  *              default multicast interface will be used. (OS Dependent)
  * @param source Source Address to accept transmissions from (non-NULL 
  *               implies Source-Specific Multicast)
  */
 APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
-                                          apr_sockaddr_t *leave,
+                                          apr_sockaddr_t *addr,
                                           apr_sockaddr_t *iface,
                                           apr_sockaddr_t *source);
 

Modified: apr/apr/branches/1.1.x/network_io/unix/multicast.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/network_io/unix/multicast.c?view=diff&r1=157600&r2=157601
==============================================================================
--- apr/apr/branches/1.1.x/network_io/unix/multicast.c (original)
+++ apr/apr/branches/1.1.x/network_io/unix/multicast.c Tue Mar 15 14:41:02 2005
@@ -24,6 +24,7 @@
 #include <ifaddrs.h>
 #endif
 
+#ifdef HAVE_STRUCT_IPMREQ
 /* Only UDP and Raw Sockets can be used for Multicast */
 static apr_status_t mcast_check_type(apr_socket_t *sock)
 {
@@ -254,13 +255,14 @@
 
     return rv;
 }
+#endif
 
 APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
                                          apr_sockaddr_t *join,
                                          apr_sockaddr_t *iface,
                                          apr_sockaddr_t *source)
 {
-#ifdef IP_ADD_MEMBERSHIP
+#if defined(IP_ADD_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, source);
 #else
     return APR_ENOTIMPL;
@@ -268,12 +270,12 @@
 }
 
 APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
-                                          apr_sockaddr_t *leave,
+                                          apr_sockaddr_t *addr,
                                           apr_sockaddr_t *iface,
                                           apr_sockaddr_t *source)
 {
-#ifdef IP_DROP_MEMBERSHIP
-    return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, source);
+#if defined(IP_DROP_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ)
+    return do_mcast(IP_DROP_MEMBERSHIP, sock, addr, iface, source);
 #else
     return APR_ENOTIMPL;
 #endif
@@ -281,7 +283,7 @@
 
 APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl)
 {
-#ifdef IP_MULTICAST_TTL
+#if defined(IP_MULTICAST_TTL) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl);
 #else
     return APR_ENOTIMPL;
@@ -291,7 +293,7 @@
 APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock,
                                              apr_byte_t opt)
 {
-#ifdef IP_MULTICAST_LOOP
+#if defined(IP_MULTICAST_LOOP) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast_opt(IP_MULTICAST_LOOP, sock, opt);
 #else
     return APR_ENOTIMPL;
@@ -301,7 +303,7 @@
 APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,
                                               apr_sockaddr_t *iface)
 {
-#ifdef IP_MULTICAST_IF
+#if defined(IP_MULTICAST_IF) && defined(HAVE_STRUCT_IPMREQ)
     apr_status_t rv = APR_SUCCESS;
 
     if (sock_is_ipv4(sock)) {



Mime
View raw message