mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-18 10:49:41 +08:00
configure: Rebuilt.
* configure: Rebuilt. * configure.in: Added inet_ntoa to AC_CHECK_FUNCS. * include/config.h.in: Rebuilt. * java/net/natPlainDatagramSocketImpl.cc: Added header checking. (mcastGrp): Updated FIXME comments. (setOption): Fixed typo. (getOption):Implemented IP_MULTICAST_IF. From-SVN: r27929
This commit is contained in:
parent
5193d0bfa5
commit
6130b0af10
@ -1,3 +1,13 @@
|
||||
1999-07-02 Warren Levy <warrenl@cygnus.com>
|
||||
|
||||
* configure: Rebuilt.
|
||||
* configure.in: Added inet_ntoa to AC_CHECK_FUNCS.
|
||||
* include/config.h.in: Rebuilt.
|
||||
* java/net/natPlainDatagramSocketImpl.cc: Added header checking.
|
||||
(mcastGrp): Updated FIXME comments.
|
||||
(setOption): Fixed typo.
|
||||
(getOption):Implemented IP_MULTICAST_IF.
|
||||
|
||||
1999-07-02 Warren Levy <warrenl@cygnus.com>
|
||||
|
||||
* java/net/PlainDatagramSocketImpl.java (ttl): Removed.
|
||||
|
397
libjava/configure
vendored
397
libjava/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -301,7 +301,7 @@ else
|
||||
AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r)
|
||||
AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath)
|
||||
AC_CHECK_FUNCS(inet_aton inet_addr, break)
|
||||
AC_CHECK_FUNCS(inet_pton uname)
|
||||
AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
|
||||
|
||||
AC_CHECK_FUNCS(gethostbyname_r, [
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
||||
|
@ -145,6 +145,9 @@
|
||||
/* Define if you have the inet_aton function. */
|
||||
#undef HAVE_INET_ATON
|
||||
|
||||
/* Define if you have the inet_ntoa function. */
|
||||
#undef HAVE_INET_NTOA
|
||||
|
||||
/* Define if you have the inet_pton function. */
|
||||
#undef HAVE_INET_PTON
|
||||
|
||||
|
@ -8,11 +8,22 @@ details. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -319,6 +330,7 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
|
||||
opname = join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP;
|
||||
memcpy (&u.mreq.imr_multiaddr, bytes, len);
|
||||
// FIXME: If a non-default interface is set, use it; see Stevens p. 501.
|
||||
// Maybe not, see note in last paragraph at bottom of Stevens p. 497.
|
||||
u.mreq.imr_interface.s_addr = htonl (INADDR_ANY);
|
||||
len = sizeof (struct ip_mreq);
|
||||
ptr = (const char *) &u.mreq;
|
||||
@ -330,6 +342,7 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
|
||||
opname = join ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP;
|
||||
memcpy (&u.mreq6.ipv6mr_multiaddr, bytes, len);
|
||||
// FIXME: If a non-default interface is set, use it; see Stevens p. 501.
|
||||
// Maybe not, see note in last paragraph at bottom of Stevens p. 497.
|
||||
u.mreq6.ipv6mr_interface = 0;
|
||||
len = sizeof (struct ipv6_mreq);
|
||||
ptr = (const char *) &u.mreq6;
|
||||
@ -431,7 +444,7 @@ java::net::PlainDatagramSocketImpl::setOption (jint optID,
|
||||
level = IPPROTO_IPV6;
|
||||
opname = IPV6_MULTICAST_IF;
|
||||
memcpy (&u.addr6, bytes, len);
|
||||
len = sizeof (struct in_addr6);
|
||||
len = sizeof (struct in6_addr);
|
||||
ptr = (const char *) &u.addr6;
|
||||
}
|
||||
#endif
|
||||
@ -524,9 +537,23 @@ java::net::PlainDatagramSocketImpl::getOption (jint optID)
|
||||
#endif
|
||||
break;
|
||||
case _Jv_IP_MULTICAST_IF_ :
|
||||
// FIXME: TODO - Implement IP_MULTICAST_IF.
|
||||
JvThrow (new java::lang::InternalError (
|
||||
JvNewStringUTF ("IP_MULTICAST_IF: option not implemented")));
|
||||
#ifdef HAVE_INET_NTOA
|
||||
struct in_addr inaddr;
|
||||
socklen_t inaddr_len;
|
||||
char *bytes;
|
||||
|
||||
inaddr_len = sizeof(inaddr);
|
||||
if (::getsockopt (fnum, IPPROTO_IP, IP_MULTICAST_IF, (char *) &inaddr,
|
||||
&inaddr_len) != 0)
|
||||
goto error;
|
||||
|
||||
bytes = inet_ntoa (inaddr);
|
||||
|
||||
return java::net::InetAddress::getByName (JvNewStringLatin1 (bytes));
|
||||
#else
|
||||
JvThrow (new java::net::SocketException (
|
||||
JvNewStringUTF ("IP_MULTICAST_IF: not available - no inet_ntoa()")));
|
||||
#endif
|
||||
break;
|
||||
case _Jv_SO_TIMEOUT_ :
|
||||
return new java::lang::Integer (timeout);
|
||||
|
Loading…
Reference in New Issue
Block a user