IPv6 detection.

parent a1ce035e
......@@ -2669,14 +2669,31 @@ fi
done
cat > conftest.$ac_ext <<EOF
#line 2674 "configure"
#include "confdefs.h"
#include <netinet/in.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "in6_addr" >/dev/null 2>&1; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IPV6 1
EOF
fi
rm -f conftest*
echo $ac_n "checking whether setsockopt accepts SO_BINDTODEVICE""... $ac_c" 1>&6
echo "configure:2674: checking whether setsockopt accepts SO_BINDTODEVICE" >&5
echo "configure:2691: checking whether setsockopt accepts SO_BINDTODEVICE" >&5
if eval "test \"`echo '$''{'ac_cv_c_so_bindtodevice'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
CFLAGS="${save_CFLAGS} -Wall -Werror"
cat > conftest.$ac_ext <<EOF
#line 2680 "configure"
#line 2697 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
......@@ -2684,7 +2701,7 @@ int main() {
int optname(void) { return SO_BINDTODEVICE; }
; return 0; }
EOF
if { (eval echo configure:2688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_so_bindtodevice=yes
else
......@@ -2705,20 +2722,20 @@ EOF
fi
echo $ac_n "checking if \$CXX accepts -shared""... $ac_c" 1>&6
echo "configure:2709: checking if \$CXX accepts -shared" >&5
echo "configure:2726: checking if \$CXX accepts -shared" >&5
if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
CFLAGS="${save_CFLAGS} -shared"
cat > conftest.$ac_ext <<EOF
#line 2715 "configure"
#line 2732 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_ld_plugins=yes
else
......@@ -2736,20 +2753,20 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
fi
echo $ac_n "checking if \$CXX accepts -rdynamic""... $ac_c" 1>&6
echo "configure:2740: checking if \$CXX accepts -rdynamic" >&5
echo "configure:2757: checking if \$CXX accepts -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_ld_rdynamic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
CFLAGS="${save_CFLAGS} -rdynamic"
cat > conftest.$ac_ext <<EOF
#line 2746 "configure"
#line 2763 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_ld_rdynamic=yes
else
......@@ -2771,12 +2788,12 @@ LDFLAGS="${save_LDFLAGS}"
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2775: checking for ANSI C header files" >&5
echo "configure:2792: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2780 "configure"
#line 2797 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
......@@ -2784,7 +2801,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2801,7 +2818,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2805 "configure"
#line 2822 "configure"
#include "confdefs.h"
#include <string.h>
EOF
......@@ -2819,7 +2836,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2823 "configure"
#line 2840 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
......@@ -2840,7 +2857,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 2844 "configure"
#line 2861 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
......@@ -2851,7 +2868,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:2855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
......@@ -2875,12 +2892,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2879: checking for size_t" >&5
echo "configure:2896: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2884 "configure"
#line 2901 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
......@@ -2908,12 +2925,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:2912: checking whether time.h and sys/time.h may both be included" >&5
echo "configure:2929: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2917 "configure"
#line 2934 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
......@@ -2922,7 +2939,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:2926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
......@@ -2985,17 +3002,17 @@ if test x$enable_dvd != xno
then
ac_safe=`echo "dvdread/dvd_reader.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dvdread/dvd_reader.h""... $ac_c" 1>&6
echo "configure:2989: checking for dvdread/dvd_reader.h" >&5
echo "configure:3006: checking for dvdread/dvd_reader.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2994 "configure"
#line 3011 "configure"
#include "confdefs.h"
#include <dvdread/dvd_reader.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -3040,17 +3057,17 @@ then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3044: checking for $ac_hdr" >&5
echo "configure:3061: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3049 "configure"
#line 3066 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -3093,17 +3110,17 @@ if test ${NEEDSRC_mpegmux} = 1
then
ac_safe=`echo "dvbpsi/dvbpsi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dvbpsi/dvbpsi.h""... $ac_c" 1>&6
echo "configure:3097: checking for dvbpsi/dvbpsi.h" >&5
echo "configure:3114: checking for dvbpsi/dvbpsi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3102 "configure"
#line 3119 "configure"
#include "confdefs.h"
#include <dvbpsi/dvbpsi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -3557,16 +3574,16 @@ test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
echo "
global configuration
--------------------
system : ${SYS}
architecture : ${ARCH}
debug : ${DEBUG}
profiling : ${PROFILING}
system : ${SYS}
architecture : ${ARCH}
debug : ${DEBUG}
profiling : ${PROFILING}
vls configuration
-----------------
vls version : ${VLS_VERSION}
debug mode : ${DEBUG}
built-in modules :${BUILTINS}
plug-in modules :${PLUGINS}
vls version : ${VLS_VERSION}
debug mode : ${DEBUG}
built-in modules :${BUILTINS}
plug-in modules :${PLUGINS}
"
......@@ -165,6 +165,10 @@ AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
dnl IPv6 support
AC_EGREP_HEADER(in6_addr,netinet/in.h,[
AC_DEFINE(HAVE_IPV6, 1, Define if the system have IPv6 structures.)])
dnl Check for SO_BINDTODEVICE
AC_CACHE_CHECK([whether setsockopt accepts SO_BINDTODEVICE],
[ac_cv_c_so_bindtodevice],
......@@ -339,16 +343,16 @@ AC_OUTPUT([Makefile.opts src/server/config.h])
echo "
global configuration
--------------------
system : ${SYS}
architecture : ${ARCH}
debug : ${DEBUG}
profiling : ${PROFILING}
system : ${SYS}
architecture : ${ARCH}
debug : ${DEBUG}
profiling : ${PROFILING}
vls configuration
-----------------
vls version : ${VLS_VERSION}
debug mode : ${DEBUG}
built-in modules :${BUILTINS}
plug-in modules :${PLUGINS}
vls version : ${VLS_VERSION}
debug mode : ${DEBUG}
built-in modules :${BUILTINS}
plug-in modules :${PLUGINS}
"
......@@ -106,6 +106,9 @@
/* Define if <netdb.h> defines getprotobyname. */
#undef GETPROTOBYNAME_IN_NETDB_H
/* Define if the system have IPv6 structures. */
#undef HAVE_IPV6
/* Define if setsockopt accepts SO_BINDTODEVICE. */
#undef HAVE_SO_BINDTODEVICE
......@@ -2,7 +2,7 @@
* socket.cpp: socket management
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: socket.cpp,v 1.6 2002/03/25 12:39:52 asmax Exp $
* $Id: socket.cpp,v 1.7 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -281,7 +281,7 @@ void C_Inet4Addr::Build(const C_String& strHost, const C_String& strPort)
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
#ifndef _WIN32
#ifdef HAVE_IPV6
void C_Inet6Addr::Build(const C_String& strHost, const C_String& strPort,
int iType)
{
......@@ -424,7 +424,7 @@ void C_Socket::Bind(const C_String& strIntf, const C_String& strPort)
pAddr = (struct sockaddr*)cIntfAddr.GetInetAddr();
iAddrLen = sizeof(*cIntfAddr.GetInetAddr());
}
#ifndef _WIN32
#ifdef HAVE_IPV6
else if(m_iDomain == AF_INET6)
{
C_Inet6Addr cIntfAddr;
......@@ -483,7 +483,7 @@ void C_Socket::Connect(const C_String& strPeer, const C_String& strPort)
pAddr = (struct sockaddr*)cPeerAddr.GetInetAddr();
iAddrLen = sizeof(*cPeerAddr.GetInetAddr());
}
#ifndef _WIN32
#ifdef HAVE_IPV6
else if(m_iDomain == AF_INET6)
{
C_Inet6Addr cPeerAddr;
......@@ -546,7 +546,7 @@ C_Socket* C_Socket::Accept()
iRc = accept(m_hSocket, (struct sockaddr*)&sPeer, &iAddrLen);
}
#ifndef _WIN32
#ifdef HAVE_IPV6
else if(m_iDomain == AF_INET6)
{
struct sockaddr_in6 sPeer;
......@@ -738,7 +738,7 @@ int C_Socket::WriteTo(C_Inet4Addr& cPeerAddr,
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
#ifndef _WIN32
#ifdef HAVE_IPV6
int C_Socket::WriteTo(C_Inet6Addr& cPeerAddr,
const byte* pBuff, int iBuffLen, int iFlags)
{
......
......@@ -2,7 +2,7 @@
* socket.h: Socket class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: socket.h,v 1.4 2002/03/24 18:54:10 asmax Exp $
* $Id: socket.h,v 1.5 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -127,7 +127,7 @@ class C_Inet4Addr
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
#ifndef _WIN32
#ifdef HAVE_IPV6
class C_Inet6Addr
{
public:
......@@ -178,7 +178,7 @@ class C_Socket
int Write(const byte* pBuff, int iBuffLen, int iFlags = 0);
int WriteTo(C_Inet4Addr& cPeerAddr,
const byte* pBuff, int iBuffLen, int iFlags = 0);
#ifndef _WIN32
#ifdef HAVE_IPV6
int WriteTo(C_Inet6Addr& cPeerAddr,
const byte* pBuff, int iBuffLen, int iFlags = 0);
#endif
......
......@@ -2,7 +2,7 @@
* netchannel.cpp: network channel
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netchannel.cpp,v 1.5 2002/03/24 18:54:10 asmax Exp $
* $Id: netchannel.cpp,v 1.6 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -81,7 +81,7 @@ C_NetChannel::C_NetChannel(C_Module* pModule,
if(strDomain == "inet4")
m_pOutput = new C_Net4Output(m_strName);
#ifndef _WIN32
#ifdef HAVE_IPV6
else if(strDomain == "inet6")
m_pOutput = new C_Net6Output(m_strName);
#endif
......
......@@ -2,7 +2,7 @@
* netoutput.cpp: network output
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netoutput.cpp,v 1.6 2002/03/24 18:54:10 asmax Exp $
* $Id: netoutput.cpp,v 1.7 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -336,10 +336,11 @@ int C_Net4Output::PrivateWriteTo(int iBuffLen)
//
//******************************************************************************
#ifdef HAVE_IPV6
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
#ifndef _WIN32
C_Net6Output::C_Net6Output(const C_String& strChannelName) :
C_NetOutput(strChannelName)
{
......@@ -426,4 +427,6 @@ int C_Net6Output::PrivateWriteTo(int iBuffLen)
}
#endif
#endif
......@@ -2,7 +2,7 @@
* netoutput.h: network output
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netoutput.h,v 1.5 2002/03/24 18:54:10 asmax Exp $
* $Id: netoutput.h,v 1.6 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -98,7 +98,7 @@ class C_Net4Output : public C_NetOutput
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
#ifndef _WIN32
#ifdef HAVE_IPV6
class C_Net6Output : public C_NetOutput
{
public:
......@@ -117,6 +117,7 @@ class C_Net6Output : public C_NetOutput
};
#endif
#else
#error "Multiple inclusions of netoutput.h"
#endif
......
......@@ -2,7 +2,7 @@
* ts.h: TsPacket class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: ts.h,v 1.3 2002/03/21 14:09:19 bozo Exp $
* $Id: ts.h,v 1.4 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -35,6 +35,7 @@
class C_TsPacket
{
public:
C_TsPacket::C_TsPacket() { m_iRefCount = 0; };
// Direct access to the buffer. Provided only for efficiency reasons
operator byte* ();
......
......@@ -2,7 +2,7 @@
* nativeadmin.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: nativeadmin.cpp,v 1.2 2002/03/04 01:55:50 bozo Exp $
* $Id: nativeadmin.cpp,v 1.3 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -368,11 +368,13 @@ int C_NativeAdmin::Init()
iDomain = AF_INET;
strDefaultHost = "0.0.0.0";
}
#ifdef HAVE_IPV6
else if(strDomain == "inet6")
{
iDomain = AF_INET6;
strDefaultHost = "0::0";
}
#endif
else
{
Log(m_hLog, LOG_ERROR, "Unknown domain:\n" + strDomain);
......
......@@ -2,7 +2,7 @@
* telnet.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: telnet.cpp,v 1.4 2002/03/04 01:55:50 bozo Exp $
* $Id: telnet.cpp,v 1.5 2002/03/25 14:49:33 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -720,11 +720,13 @@ int C_Telnet::Init()
iDomain = AF_INET;
strDefaultHost = "0.0.0.0";
}
#ifdef HAVE_IPV6
else if(strDomain == "inet6")
{
iDomain = AF_INET6;
strDefaultHost = "0::0";
}
#endif
else
{
Log(m_hLog, LOG_ERROR, "Unknown domain:\n" + strDomain);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment