From 26d7402affe1df587f00c9f6ca54ebb7acfa21a3 Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Thu, 6 Sep 2012 03:32:53 +0000 Subject: [PATCH] SF# 3560807: Deprecate setPeerAddress() as this is now done in getifaddrs --- Net/src/NetworkInterface.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index 1a772f9b5..b8bbc7167 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -134,7 +134,6 @@ public: void setType(Type type); void setIndex(unsigned index); void setPhyParams(); - void setPeerAddress(); protected: ~NetworkInterfaceImpl(); @@ -180,7 +179,6 @@ NetworkInterfaceImpl::NetworkInterfaceImpl(const std::string& name, const std::s { _addressList.push_back(AddressTuple(address, IPAddress(), IPAddress())); setPhyParams(); - if (_pointToPoint) setPeerAddress(); } @@ -197,7 +195,6 @@ NetworkInterfaceImpl::NetworkInterfaceImpl(const std::string& name, const std::s _mtu(0) { setPhyParams(); - if (_pointToPoint) setPeerAddress(); } @@ -215,7 +212,6 @@ NetworkInterfaceImpl::NetworkInterfaceImpl(const std::string& name, const std::s { _addressList.push_back(AddressTuple(address, subnetMask, broadcastAddress)); setPhyParams(); - if (_pointToPoint) setPeerAddress(); } @@ -235,30 +231,6 @@ void NetworkInterfaceImpl::setPhyParams() } -void NetworkInterfaceImpl::setPeerAddress() -{ - AddressList::iterator it = _addressList.begin(); - AddressList::iterator end = _addressList.end(); - for (; it != end; ++it) - { - IPAddress::Family family = it->get().family(); - DatagramSocket ds(family); -#if !defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_VXWORKS) - struct ifreq ifr; - std::strncpy(ifr.ifr_name, _name.c_str(), IFNAMSIZ); - ds.impl()->ioctl(SIOCGIFDSTADDR, &ifr); - // for PPP-type connections, broadcastAddress member holds the peer address - if (ifr.ifr_dstaddr.sa_family == AF_INET) - it->set(IPAddress(ifr.ifr_dstaddr)); - else - it->set(IPAddress(&reinterpret_cast(&ifr.ifr_dstaddr)->sin6_addr, sizeof(struct in6_addr), _index)); -#else - //TODO -#endif - } -} - - NetworkInterfaceImpl::~NetworkInterfaceImpl() { }