// $Id$ // // Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) // Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Definition of inline non-template functions // Custom includes #include #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// prefix_ senf::INet4Address::INet4Address() { clear(); } prefix_ senf::INet4Address::INet4Address(char const * address) { assignString(address); } prefix_ senf::INet4Address::INet4Address(std::string address) { assignString(address); } prefix_ bool senf::INet4Address::operator==(INet4Address const & other) const { return addr_.sin_port == other.addr_.sin_port && addr_.sin_addr.s_addr == other.addr_.sin_addr.s_addr; } prefix_ std::string senf::INet4Address::host() const { /** \fixme thread safety? */ return std::string(::inet_ntoa(addr_.sin_addr)); } prefix_ unsigned senf::INet4Address::port() const { return ntohs(addr_.sin_port); } prefix_ struct sockaddr * senf::INet4Address::sockaddr_p() { return reinterpret_cast(&addr_); } prefix_ struct sockaddr const * senf::INet4Address::sockaddr_p() const { return reinterpret_cast(&addr_); } prefix_ unsigned senf::INet4Address::sockaddr_len() const { return sizeof(addr_); } prefix_ std::ostream & senf::operator<<(std::ostream & os, INet4Address const & addr) { os << addr.str(); return os; } ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ // Local Variables: // mode: c++ // c-file-style: "senf" // End: