From 5ce9ef47a2741413caa701324ba7beaa65b83162 Mon Sep 17 00:00:00 2001 From: jha Date: Sat, 30 Jun 2001 15:35:28 +0000 Subject: Removed all the switches for ACE_HAS_IPV6 and PF_INET6. This is all handled by the ACE_PROTOCOL_FAMILY_INET and ACE_ADDRESS_FAMILY_INET defines in OS.h. --- ace/SOCK_Acceptor.cpp | 71 ++++++++++++++++++++------------------------------ ace/SOCK_Acceptor.h | 10 +++---- ace/SOCK_Connector.cpp | 10 ------- ace/SOCK_Dgram.cpp | 5 ---- 4 files changed, 33 insertions(+), 63 deletions(-) diff --git a/ace/SOCK_Acceptor.cpp b/ace/SOCK_Acceptor.cpp index 20e44d1debd..37e2cef3c61 100644 --- a/ace/SOCK_Acceptor.cpp +++ b/ace/SOCK_Acceptor.cpp @@ -209,34 +209,34 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, ACE_TRACE ("ACE_SOCK_Acceptor::shared_open"); int error = 0; - #if defined (ACE_HAS_IPV6) - if (protocol_family == PF_INET6) - { - sockaddr_in6 local_inet6_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet6_addr), - 0, - sizeof local_inet6_addr); - - if (local_sap == ACE_Addr::sap_any) - { - local_inet6_addr.sin6_family = AF_INET6; - local_inet6_addr.sin6_port = 0; - local_inet6_addr.sin6_addr = in6addr_any; - } - else - local_inet6_addr = *ACE_reinterpret_cast (sockaddr_in6 *, - local_sap.get_addr ()); - - // We probably don't need a bind_port written here. - // There are currently no supported OS's that define ACE_LACKS_WILDCARD_BIND. - if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet6_addr), - sizeof local_inet6_addr) == -1) - error = 1; - } else - #endif +#if defined (ACE_HAS_IPV6) + if (protocol_family == PF_INET6) + { + sockaddr_in6 local_inet6_addr; + ACE_OS::memset (ACE_reinterpret_cast (void *, + &local_inet6_addr), + 0, + sizeof local_inet6_addr); + + if (local_sap == ACE_Addr::sap_any) + { + local_inet6_addr.sin6_family = AF_INET6; + local_inet6_addr.sin6_port = 0; + local_inet6_addr.sin6_addr = in6addr_any; + } + else + local_inet6_addr = *ACE_reinterpret_cast (sockaddr_in6 *, + local_sap.get_addr ()); + + // We probably don't need a bind_port written here. + // There are currently no supported OS's that define ACE_LACKS_WILDCARD_BIND. + if (ACE_OS::bind (this->get_handle (), + ACE_reinterpret_cast (sockaddr *, + &local_inet6_addr), + sizeof local_inet6_addr) == -1) + error = 1; + } else +#endif if (protocol_family == PF_INET) { sockaddr_in local_inet_addr; @@ -293,15 +293,6 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, { ACE_TRACE ("ACE_SOCK_Acceptor::open"); - // For AF_INET6 addresses we need PF_INET6 sockets in order to - // properly bind to IPv6 addresses. -#if defined (ACE_HAS_IPV6) - if(local_sap.get_type() == AF_INET6 || - local_sap.get_type() == AF_ANY) { - protocol_family = PF_INET6; - } -#endif - if (ACE_SOCK::open (SOCK_STREAM, protocol_family, protocol, @@ -350,12 +341,6 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, { ACE_TRACE ("ACE_SOCK_Acceptor::open"); -#if defined (ACE_HAS_IPV6) - if(local_sap.get_type() == AF_INET6 || - local_sap.get_type() == AF_ANY) - protocol_family = PF_INET6; -#endif - if (ACE_SOCK::open (SOCK_STREAM, protocol_family, protocol, diff --git a/ace/SOCK_Acceptor.h b/ace/SOCK_Acceptor.h index c728fc2e8c8..234ebdf2917 100644 --- a/ace/SOCK_Acceptor.h +++ b/ace/SOCK_Acceptor.h @@ -120,7 +120,7 @@ public: * and vice versa. */ int accept (ACE_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, + ACE_Accept_QoS_Params qos_params, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, int restart = 1, @@ -140,14 +140,14 @@ protected: /// Perform operations that must occur before is /// called. int shared_accept_start (ACE_Time_Value *timeout, - int restart, - int &in_blocking_mode) const; + int restart, + int &in_blocking_mode) const; /// Perform operations that must occur after is /// called. int shared_accept_finish (ACE_SOCK_Stream new_stream, - int in_blocking_mode, - int reset_new_handle) const; + int in_blocking_mode, + int reset_new_handle) const; /** * This method factors out the common code and is called by diff --git a/ace/SOCK_Connector.cpp b/ace/SOCK_Connector.cpp index 0bb183e0dd9..8fd1e42ec0d 100644 --- a/ace/SOCK_Connector.cpp +++ b/ace/SOCK_Connector.cpp @@ -149,11 +149,6 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, { ACE_TRACE ("ACE_SOCK_Connector::connect"); -#if defined (ACE_HAS_IPV6) - if(remote_sap.get_type() == AF_INET6) - protocol_family = PF_INET6; -#endif - if (this->shared_open (new_stream, protocol_family, protocol, @@ -190,11 +185,6 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, { ACE_TRACE ("ACE_SOCK_Connector::connect"); -#if defined (ACE_HAS_IPV6) - if(remote_sap.get_type() == AF_INET6) - protocol_family = PF_INET6; -#endif - if (this->shared_open (new_stream, protocol_family, protocol, diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index 98aadbe1f41..42ade947bc5 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -152,11 +152,6 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local, { ACE_TRACE ("ACE_SOCK_Dgram::open"); -#if defined (ACE_HAS_IPV6) - if(local.get_type() == AF_INET6) - protocol_family = PF_INET6; -#endif - if (ACE_SOCK::open (SOCK_DGRAM, protocol_family, protocol, -- cgit v1.2.1