Browse Source

[1485] Compilation fixes after IOAddress.getAddress() removal

Tomek Mrugalski 11 years ago
parent
commit
4013083662

+ 7 - 7
src/lib/dhcp/iface_mgr.cc

@@ -526,7 +526,7 @@ IfaceMgr::openSockets6(const uint16_t port,
             // with interface with 2 global addresses, we would bind 3 sockets
             // (one for link-local and two for global). That would result in
             // getting each message 3 times.
-            if (!addr->getAddress().to_v6().is_link_local()){
+            if (!addr->isV6LinkLocal()){
                 continue;
             }
 
@@ -742,7 +742,7 @@ int IfaceMgr::openSocketFromRemoteAddress(const IOAddress& remote_addr,
                                           const uint16_t port) {
     try {
         // Get local address to be used to connect to remote location.
-        IOAddress local_address(getLocalAddress(remote_addr, port).getAddress());
+        IOAddress local_address(getLocalAddress(remote_addr, port));
         return openSocketFromAddress(local_address, port);
     } catch (const Exception& e) {
         isc_throw(SocketConfigError, e.what());
@@ -1073,7 +1073,7 @@ uint16_t IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) {
         }
 
         // Sockets bound to multicast address are useless for sending anything.
-        if (s->addr_.getAddress().to_v6().is_multicast()) {
+        if (s->addr_.isV6Multicast()) {
             continue;
         }
 
@@ -1090,10 +1090,10 @@ uint16_t IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) {
             // If we want to send something to link-local and the socket is
             // bound to link-local or we want to send to global and the socket
             // is bound to global, then use it as candidate
-            if ( (pkt.getRemoteAddr().getAddress().to_v6().is_link_local() &&
-                s->addr_.getAddress().to_v6().is_link_local()) ||
-                 (!pkt.getRemoteAddr().getAddress().to_v6().is_link_local() &&
-                  !s->addr_.getAddress().to_v6().is_link_local()) ) {
+            if ( (pkt.getRemoteAddr().isV6LinkLocal() &&
+                s->addr_.isV6LinkLocal()) ||
+                 (!pkt.getRemoteAddr().isV6LinkLocal() &&
+                  !s->addr_.isV6LinkLocal()) ) {
                 candidate = s;
             }
         }

+ 3 - 4
src/lib/dhcp_ddns/ncr_udp.cc

@@ -94,7 +94,7 @@ NameChangeUDPListener::~NameChangeUDPListener() {
 void
 NameChangeUDPListener::open(isc::asiolink::IOService& io_service) {
     // create our endpoint and bind the the low level socket to it.
-    isc::asiolink::UDPEndpoint endpoint(ip_address_.getAddress(), port_);
+    isc::asiolink::UDPEndpoint endpoint(ip_address_, port_);
 
     // Create the low level socket.
     try {
@@ -227,7 +227,7 @@ NameChangeUDPSender::~NameChangeUDPSender() {
 void
 NameChangeUDPSender::open(isc::asiolink::IOService& io_service) {
     // create our endpoint and bind the the low level socket to it.
-    isc::asiolink::UDPEndpoint endpoint(ip_address_.getAddress(), port_);
+    isc::asiolink::UDPEndpoint endpoint(ip_address_, port_);
 
     // Create the low level socket.
     try {
@@ -252,8 +252,7 @@ NameChangeUDPSender::open(isc::asiolink::IOService& io_service) {
 
     // Create the server endpoint
     server_endpoint_.reset(new isc::asiolink::
-                           UDPEndpoint(server_address_.getAddress(),
-                                       server_port_));
+                           UDPEndpoint(server_address_, server_port_));
 
     send_callback_->setDataSource(server_endpoint_);
 }

+ 1 - 1
src/lib/dhcpsrv/cfgmgr.cc

@@ -152,7 +152,7 @@ CfgMgr::getSubnet6(const isc::asiolink::IOAddress& hint) {
     // configuration. Such requirement makes sense in IPv4, but not in IPv6.
     // The server does not need to have a global address (using just link-local
     // is ok for DHCPv6 server) from the pool it serves.
-    if ((subnets6_.size() == 1) && hint.getAddress().to_v6().is_link_local()) {
+    if ((subnets6_.size() == 1) && hint.isV6LinkLocal()) {
         LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE,
                   DHCPSRV_CFGMGR_ONLY_SUBNET6)
                   .arg(subnets6_[0]->toText()).arg(hint.toText());

+ 1 - 1
src/lib/dhcpsrv/d2_client.cc

@@ -37,7 +37,7 @@ D2ClientConfig::D2ClientConfig(const  bool enable_updates,
                                const std::string& generated_prefix,
                                const std::string& qualifying_suffix)
     : enable_updates_(enable_updates),
-    server_ip_(server_ip.getAddress()),
+    server_ip_(server_ip),
     server_port_(server_port),
     ncr_protocol_(ncr_protocol),
     ncr_format_(ncr_format),