diff --git a/Socket/Protocols/INet/INet4Address.cc b/Socket/Protocols/INet/INet4Address.cc index d83c034424d49613346b0fe86212e2b5681076ca..33720d30587edc1f9457a39e597e1f30676c2e3f 100644 --- a/Socket/Protocols/INet/INet4Address.cc +++ b/Socket/Protocols/INet/INet4Address.cc @@ -89,15 +89,6 @@ prefix_ senf::INet4Address senf::INet4Address::from_string(std::string const & s reinterpret_cast<in_addr*>(*(ent->h_addr_list))->s_addr); } -prefix_ std::string senf::INet4Address::toString() const { - char buffer[4*4]; - ::in_addr ina; - ina.s_addr = (*this).inaddr(); - ::inet_ntop(AF_INET, & ina , buffer, sizeof(buffer)); - buffer[sizeof(buffer)-1] = 0; - return buffer; -} - prefix_ bool senf::INet4Address::local() const { diff --git a/Socket/Protocols/INet/INet4Address.hh b/Socket/Protocols/INet/INet4Address.hh index b41369aa876bfcf03c994589c4eaa8ba7a80cc6d..4b5f3ec33fa479f94bbceaabec21cfe1c413087e 100644 --- a/Socket/Protocols/INet/INet4Address.hh +++ b/Socket/Protocols/INet/INet4Address.hh @@ -159,9 +159,6 @@ namespace senf { /**< This member returns the address as an integer number in host byte order. This representation allows simple network math operations. */ - std::string toString() const; - ///< get the string representation of this INet4Address - ////@} private: diff --git a/Socket/Protocols/INet/INet6Address.cc b/Socket/Protocols/INet/INet6Address.cc index 9aa52381e30255626bcb4d24a3b2d1d749dbd8a3..94afd473843d499b8dfc60918c1c13a42bc16347 100644 --- a/Socket/Protocols/INet/INet6Address.cc +++ b/Socket/Protocols/INet/INet6Address.cc @@ -91,17 +91,14 @@ prefix_ in6_addr senf:: INet6Address::toin6_addr() const { return ina; } -prefix_ std::string senf::INet6Address::toString() const { - char buffer[5*8]; - ::in6_addr ina = (*this).toin6_addr(); - ::inet_ntop(AF_INET6, & ina , buffer, sizeof(buffer)); - buffer[sizeof(buffer)-1] = 0; - return buffer; -} - prefix_ std::ostream & senf::operator<<(std::ostream & os, INet6Address const & addr) { - os << addr.toString(); + ::in6_addr ina; + char buffer[5*8]; + std::copy(addr.begin(),addr.end(),&ina.s6_addr[0]); + ::inet_ntop(AF_INET6,&ina,buffer,sizeof(buffer)); + buffer[sizeof(buffer)-1] = 0; + os << buffer; return os; } @@ -147,7 +144,7 @@ prefix_ senf::INet6Network::INet6Network(std::string s) #undef prefix_ //#include "INet6Address.mpp" - + // Local Variables: // mode: c++ // fill-column: 100 diff --git a/Socket/Protocols/INet/INet6Address.hh b/Socket/Protocols/INet/INet6Address.hh index e2bad767eb0a86fae95a848f998efe80a5c6e90e..a959837dcdb088fc8fa8fb108f539ed59354a226 100644 --- a/Socket/Protocols/INet/INet6Address.hh +++ b/Socket/Protocols/INet/INet6Address.hh @@ -203,11 +203,7 @@ namespace senf { \par INet4 compatible INet6 addresses are not directly supported, they are deprecated in the RFC. */ - std::string toString() const; - ///< get the string representation of this INet6Address - in6_addr toin6_addr() const; - ///< get the linux in6_addr struct (convinience only) - + in6_addr toin6_addr() const; ///< get the linux in6_addr struct (convinience only) ///@} /////////////////////////////////////////////////////////////////////////// @@ -393,7 +389,7 @@ namespace senf { #include "INet6Address.cti" #endif - + // Local Variables: // mode: c++ // fill-column: 100 diff --git a/Socket/Protocols/Raw/MACAddress.cc b/Socket/Protocols/Raw/MACAddress.cc index 6c36a47777390086377f5be159a7e89ddc1dc03e..e8fb19bf2cd3f2476bc93704f55e2d3ca2b3f289 100644 --- a/Socket/Protocols/Raw/MACAddress.cc +++ b/Socket/Protocols/Raw/MACAddress.cc @@ -57,7 +57,7 @@ namespace { else throw senf::AddressSyntaxException(); } - + template <class Range> boost::uint8_t hexToByte(Range const & range) { @@ -107,11 +107,6 @@ prefix_ senf::MACAddress senf::MACAddress::from_eui64(boost::uint64_t v) senf::MACAddress const senf::MACAddress::Broadcast = senf::MACAddress(0xFFFFFFFFFFFFull); senf::MACAddress const senf::MACAddress::None; -prefix_ std::string senf::MACAddress::toString() const { - std::ostringstream tmp; - tmp << (*this); - return tmp.str(); -} /////////////////////////////////////////////////////////////////////////// // namespace members @@ -146,7 +141,7 @@ prefix_ std::istream & senf::operator>>(std::istream & is, MACAddress & mac) #undef prefix_ //#include "MACAddress.mpp" - + // Local Variables: // mode: c++ // fill-column: 100 diff --git a/Socket/Protocols/Raw/MACAddress.hh b/Socket/Protocols/Raw/MACAddress.hh index 00030c661a66d3bc5f3e0ef0d4109c78dc61e696..64049dd6b6a230ba17a062b158625f88c95fe39c 100644 --- a/Socket/Protocols/Raw/MACAddress.hh +++ b/Socket/Protocols/Raw/MACAddress.hh @@ -42,7 +42,7 @@ namespace senf { /** \brief Ethernet MAC address - + The Ethernet MAC is modelled as a fixed-size container/sequence of 6 bytes. The following statements all create the same MAC address <code>00:1A:2B:3C:4D:5F</code> @@ -85,7 +85,7 @@ namespace senf { \ingroup addr_group */ struct MACAddress - : public boost::array<boost::uint8_t,6>, + : public boost::array<boost::uint8_t,6>, public comparable_safe_bool<MACAddress> { static MACAddress const Broadcast; ///< The broadcast address @@ -103,7 +103,7 @@ namespace senf { accepted as a delimiter. \throws AddressSyntaxException */ - template <class InputIterator> + template <class InputIterator> static MACAddress from_data(InputIterator i); ///< Construct address from raw data /**< Copies the data from \a i into the MAC address. @@ -126,12 +126,9 @@ namespace senf { boost::uint32_t oui() const; ///< Return first 3 bytes of the address boost::uint32_t nic() const; ///< Return last 3 bytes of the address - - boost::uint64_t eui64() const; ///< Build EUI-64 from the MAC address - boost::uint64_t uint64() const; ///< Return MAC address as uint64 value - - std::string toString() const; ///< Return string representation of MAC address like 12:34:56:78:90:ab + boost::uint64_t eui64() const; ///< Build EUI-64 from the MAC address + boost::uint64_t uint64() const; ///< Return MAC address as uint64 value }; /** \brief Output MAC instance as it's string representation @@ -153,7 +150,7 @@ namespace senf { //#include "MACAddress.cti" #endif - + // Local Variables: // mode: c++ // fill-column: 100