diff options
-rw-r--r-- | ace/INET_Addr.cpp | 40 | ||||
-rw-r--r-- | ace/INET_Addr.h | 2 | ||||
-rw-r--r-- | ace/INET_Addr.i | 18 | ||||
-rw-r--r-- | ace/Makefile | 29 | ||||
-rw-r--r-- | ace/OS.h | 7 | ||||
-rw-r--r-- | ace/RMCast/Makefile | 8 | ||||
-rw-r--r-- | ace/SOCK_CODgram.h | 1 | ||||
-rw-r--r-- | ace/SOCK_Dgram.h | 1 | ||||
-rw-r--r-- | protocols/ace/RMCast/Makefile | 8 |
9 files changed, 90 insertions, 24 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index c83733aa09e..0be23d31d77 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -36,17 +36,29 @@ ACE_INET_Addr::protocol_family (void) if (ACE_INET_Addr::protocol_family_ == -1) { int s = socket(PF_INET6,SOCK_DGRAM,0); - if(s == -1) - ACE_INET_Addr::protocol_family_ = PF_INET; - else { + if(s == -1) { +// printf("Setting protocol_family_ to PF_INET\n"); ACE_INET_Addr::protocol_family_ = PF_INET; + } else { +// printf("Setting protocol_family_ to PF_INET6\n"); + ACE_INET_Addr::protocol_family_ = PF_INET6; close(s); } } } +// printf("returning protocol_family %d %s from ACE_INET_Addr\n",ACE_INET_Addr::protocol_family_, ACE_INET_Addr::protocol_family_ == PF_INET ? "PF_INET" : "PF_INET6"); return ACE_INET_Addr::protocol_family_; } +int +ACE_INET_Addr::address_family (void) +{ + if(ACE_INET_Addr::protocol_family() == PF_INET6) + return AF_INET6; + else + return AF_INET; +} + #endif /* ACE_USES_IPV4_IPV6_MIGRATION */ int @@ -118,7 +130,7 @@ ACE_INET_Addr::operator == (const ACE_INET_Addr &sap) const } ACE_INET_Addr::ACE_INET_Addr (void) - : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->addr_size()) + : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->get_addr_size()) { // ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); this->initialize(); @@ -137,9 +149,9 @@ ACE_INET_Addr::set (const ACE_INET_Addr &sa) this->initialize(); else // It's ok to make the copy. - (void) ACE_OS::memcpy ((void *) this->addr_pointer(), - (void *) sa.addr_pointer(), - this->addr_size()); + (void) ACE_OS::memcpy ((void *) this->get_addr(), + (void *) sa.get_addr(), + this->get_addr_size()); return 0; } @@ -198,7 +210,7 @@ ACE_INET_Addr::set (const char address[]) } ACE_INET_Addr::ACE_INET_Addr (const char address[]) - : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->addr_size()) + : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->get_addr_size()) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); this->set (address); @@ -206,7 +218,7 @@ ACE_INET_Addr::ACE_INET_Addr (const char address[]) #if defined (ACE_HAS_WCHAR) ACE_INET_Addr::ACE_INET_Addr (const wchar_t address[]) - : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->addr_size()) + : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->get_addr_size()) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); this->set (address); @@ -217,7 +229,7 @@ ACE_INET_Addr::ACE_INET_Addr (const wchar_t address[]) // Copy constructor. ACE_INET_Addr::ACE_INET_Addr (const ACE_INET_Addr &sa) - : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->addr_size()) + : ACE_Addr (ACE_ADDRESS_FAMILY_INET, this->get_addr_size()) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); this->set (sa); @@ -259,7 +271,7 @@ ACE_INET_Addr::set (u_short port_number, ACE_UINT32 addrv4; - this->ACE_Addr::base_set (ACE_ADDRESS_FAMILY_INET,this->addr_size()); + this->ACE_Addr::base_set (ACE_ADDRESS_FAMILY_INET,this->get_addr_size()); this->initialize(); // Yow, someone gave us a NULL host_name! @@ -703,7 +715,7 @@ int ACE_INET_Addr::set_address (const char *ip_addr, { ACE_TRACE ("ACE_INET_Addr::set"); - this->ACE_Addr::base_set (ACE_ADDRESS_FAMILY_INET, this->addr_size()); + this->ACE_Addr::base_set (ACE_ADDRESS_FAMILY_INET, this->get_addr_size()); #if defined (ACE_HAS_IPV6) #if defined (ACE_USES_IPV4_IPV6_MIGRATION) @@ -867,8 +879,8 @@ size_t ACE_INET_Addr::addr_size(void) const void ACE_INET_Addr::initialize(void) { - (void) ACE_OS::memset ((void *) this->addr_pointer(), - 0, this->addr_size()); + (void) ACE_OS::memset ((void *) this->get_addr(), + 0, this->get_addr_size()); #if defined (ACE_HAS_IPV6) #if defined (ACE_USES_IPV4_IPV6_MIGRATION) diff --git a/ace/INET_Addr.h b/ace/INET_Addr.h index 1cae73fc655..782e1a44982 100644 --- a/ace/INET_Addr.h +++ b/ace/INET_Addr.h @@ -188,6 +188,7 @@ public: /// Return a pointer to the underlying network address. virtual void *get_addr (void) const; + int get_addr_size(void) const; /// Set a pointer to the address. virtual void set_addr (void *, int len); @@ -293,6 +294,7 @@ public: #if defined (ACE_USES_IPV4_IPV6_MIGRATION) static int protocol_family(void); + static int address_family(void); #endif /// Dump the state of an object. diff --git a/ace/INET_Addr.i b/ace/INET_Addr.i index 0abe355d316..b4ebd90d0a8 100644 --- a/ace/INET_Addr.i +++ b/ace/INET_Addr.i @@ -47,6 +47,24 @@ ACE_INET_Addr::get_addr (void) const #endif } +ACE_INLINE int +ACE_INET_Addr::get_addr_size (void) const +{ + ACE_TRACE ("ACE_INET_Addr::get_addr_size"); +#if defined (ACE_HAS_IPV6) + +#if defined (ACE_USES_IPV4_IPV6_MIGRATION) + if(ACE_INET_Addr::protocol_family() == PF_INET) + return sizeof this->inet_addr4_; + else +#endif + return sizeof this->inet_addr6_; +#else + return sizeof this->inet_addr4_; +#endif +} + + ACE_INLINE u_long ACE_INET_Addr::hash (void) const { diff --git a/ace/Makefile b/ace/Makefile index 4fe6c423c2b..097d0c27d59 100644 --- a/ace/Makefile +++ b/ace/Makefile @@ -6132,7 +6132,24 @@ endif # GHS $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ - $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp .obj/IPC_SAP.o .obj/IPC_SAP.so .shobj/IPC_SAP.o .shobj/IPC_SAP.so: IPC_SAP.cpp \ $(ACE_ROOT)/ace/IPC_SAP.h \ @@ -6337,6 +6354,8 @@ endif # GHS $(ACE_ROOT)/ace/SOCK_CODgram.h \ $(ACE_ROOT)/ace/SOCK_IO.h \ $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ $(ACE_ROOT)/ace/SOCK_CODgram.i \ $(ACE_ROOT)/ace/LSOCK_CODgram.i \ $(ACE_ROOT)/ace/Log_Msg.h \ @@ -6458,6 +6477,8 @@ endif # GHS $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/LSOCK.h \ $(ACE_ROOT)/ace/LSOCK.i \ @@ -6697,6 +6718,8 @@ endif # GHS $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ $(ACE_ROOT)/ace/SOCK_CODgram.i \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ @@ -6864,6 +6887,8 @@ endif # GHS $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/Handle_Set.h \ $(ACE_ROOT)/ace/Handle_Set.i \ @@ -6987,9 +7012,9 @@ endif # GHS $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i .obj/SOCK_IO.o .obj/SOCK_IO.so .shobj/SOCK_IO.o .shobj/SOCK_IO.so: SOCK_IO.cpp \ @@ -4160,8 +4160,15 @@ typedef fd_set ACE_FD_SET_TYPE; # endif /* INET6_ADDRSTRLEN */ #if defined (ACE_HAS_IPV6) + +#if defined (ACE_USES_IPV4_IPV6_MIGRATION) +#define ACE_ADDRESS_FAMILY_INET ACE_INET_Addr::address_family() +#define ACE_PROTOCOL_FAMILY_INET ACE_INET_Addr::protocol_family() +#else #define ACE_ADDRESS_FAMILY_INET AF_INET6 #define ACE_PROTOCOL_FAMILY_INET PF_INET6 +#endif /* ACE_USES_IPV4_IPV6_MIGRATION */ + #else #define ACE_ADDRESS_FAMILY_INET AF_INET #define ACE_PROTOCOL_FAMILY_INET PF_INET diff --git a/ace/RMCast/Makefile b/ace/RMCast/Makefile index 6f3b3717f31..2c2c8ae7340 100644 --- a/ace/RMCast/Makefile +++ b/ace/RMCast/Makefile @@ -1476,9 +1476,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ @@ -1617,9 +1617,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ @@ -1889,9 +1889,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ @@ -2025,9 +2025,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ diff --git a/ace/SOCK_CODgram.h b/ace/SOCK_CODgram.h index 2a9c7ffc48c..e275a420031 100644 --- a/ace/SOCK_CODgram.h +++ b/ace/SOCK_CODgram.h @@ -22,6 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Addr.h" +#include "ace/INET_Addr.h" /** * @class ACE_SOCK_CODgram diff --git a/ace/SOCK_Dgram.h b/ace/SOCK_Dgram.h index 1bb4a5647c2..8930926d732 100644 --- a/ace/SOCK_Dgram.h +++ b/ace/SOCK_Dgram.h @@ -16,6 +16,7 @@ #include "ace/pre.h" #include "ace/SOCK.h" +#include "ace/INET_Addr.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/protocols/ace/RMCast/Makefile b/protocols/ace/RMCast/Makefile index 6f3b3717f31..2c2c8ae7340 100644 --- a/protocols/ace/RMCast/Makefile +++ b/protocols/ace/RMCast/Makefile @@ -1476,9 +1476,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ @@ -1617,9 +1617,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ @@ -1889,9 +1889,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ @@ -2025,9 +2025,9 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ace/IPC_SAP.h \ $(ACE_ROOT)/ace/IPC_SAP.i \ $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/INET_Addr.h \ $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ $(ACE_ROOT)/ace/Hash_Map_Manager.h \ $(ACE_ROOT)/ace/Functor.h \ |