diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2007-05-29 21:18:14 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2007-05-29 21:18:14 +0000 |
commit | bcc5eef71340e9fca269c4cd4face6717dae0f26 (patch) | |
tree | d31382538829c0d71499c2b877d5db72edab6323 | |
parent | 7beec4027b3205501c202a30441cb8b29de9416c (diff) | |
download | ATCD-bcc5eef71340e9fca269c4cd4face6717dae0f26.tar.gz |
Tue May 29 21:02:08 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r-- | CIAO/ChangeLog | 7 | ||||
-rw-r--r-- | CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp | 50 | ||||
-rw-r--r-- | CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h | 11 |
3 files changed, 43 insertions, 25 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 7505a47a447..ab6bf1d73f5 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,10 @@ +Tue May 29 21:02:08 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com> + + * ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h: + * ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp: + + Added code to support the new IPv4/IPv6 capable address server. + Sun May 27 16:20:10 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> * ciao/Object_Set_T.cpp: diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp b/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp index cdce7218291..87e878aff27 100644 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp +++ b/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp @@ -4,34 +4,46 @@ #include <ace/INET_Addr.h> #include <ace/OS_NS_string.h> -SimpleAddressServer::SimpleAddressServer (const ACE_INET_Addr& address) { - this->address_.ipaddr = address.get_ip_address (); - this->address_.port = address.get_port_number (); +SimpleAddressServer::SimpleAddressServer (const ACE_INET_Addr& address) +{ +#if defined (ACE_HAS_IPV6) + if (address.get_type() == PF_INET6) + { + RtecUDPAdmin::UDP_Addr_v6 v6; + sockaddr_in6 *in6 = + reinterpret_cast<sockaddr_in6 *>(address.get_addr()); + ACE_OS::memcpy (v6.ipaddr,&in6->sin6_addr,16); + v6.port = address.get_port_number(); + this->address_.v6_addr (v6); + return; + } +#endif /* ACE_HAS_IPV6 */ + RtecUDPAdmin::UDP_Addr v4; + v4.ipaddr = address.get_ip_address (); + v4.port = address.get_port_number (); + this->address_.v4_addr (v4); } SimpleAddressServer::SimpleAddressServer (const RtecUDPAdmin::UDP_Addr& addr) - : address_ (addr) { + this->address_.v4_addr (addr); } void SimpleAddressServer::get_addr (const RtecEventComm::EventHeader&, RtecUDPAdmin::UDP_Addr& address) - throw (CORBA::SystemException) { - address = this->address_; + throw (CORBA::SystemException) +{ + if (this->address_._d() == RtecUDPAdmin::INET6) + throw CORBA::DATA_CONVERSION(0, CORBA::COMPLETED_YES); + address = this->address_.v4_addr(); } -/* -void -SimpleAddressServer::get_ip_address (const RtecEventComm::EventHeader&, - RtecUDPAdmin::UDP_IP_Address_out address) - throw (CORBA::SystemException) { - address = new RtecUDPAdmin::UDP_IP_Address; - ACE_INET_Addr x (this->address_.port, - static_cast<ACE_UINT32>(this->address_.ipaddr)); - address->length (x.get_addr_size ()); - ACE_OS::memcpy (address->get_buffer (), - x.get_addr (), - x.get_addr_size ()); + +void +SimpleAddressServer::get_address (const RtecEventComm::EventHeader&, + RtecUDPAdmin::UDP_Address_out address) + throw (CORBA::SystemException) +{ + address = this->address_; } -*/ diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h b/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h index 5a69d3171dc..8cf33378900 100644 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h +++ b/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h @@ -25,14 +25,13 @@ public: RtecUDPAdmin::UDP_Addr& address) throw (CORBA::SystemException); - -/* - virtual void get_ip_address (const RtecEventComm::EventHeader& header, - RtecUDPAdmin::UDP_IP_Address_out address) + virtual void get_address (const RtecEventComm::EventHeader& header, + RtecUDPAdmin::UDP_Address_out address) throw (CORBA::SystemException); -*/ + private: - RtecUDPAdmin::UDP_Addr address_; + RtecUDPAdmin::UDP_Address address_; + }; #endif |