summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjha <jha@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-06-30 15:35:28 +0000
committerjha <jha@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-06-30 15:35:28 +0000
commit5ce9ef47a2741413caa701324ba7beaa65b83162 (patch)
tree1a089779993cf43af9abd6a04060e89959780ff2
parentd297b6d4b6aa0a1c38be6c5f562654271bd4fcf5 (diff)
downloadATCD-5ce9ef47a2741413caa701324ba7beaa65b83162.tar.gz
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.
-rw-r--r--ace/SOCK_Acceptor.cpp71
-rw-r--r--ace/SOCK_Acceptor.h10
-rw-r--r--ace/SOCK_Connector.cpp10
-rw-r--r--ace/SOCK_Dgram.cpp5
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 <ACE_OS::accept> 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 <ACE_OS::accept> 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 <open> 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,