Upstream tarball 10013
[amule.git] / src / amuleIPV4Address.h
blobc0c1200f956271f292797ecedb07b29c2549ec7c
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2004-2008 Carlo Wood ( carlo@alinoe.com )
5 // Copyright (c) 2004-2008 aMule Team ( admin@amule.org / http://www.amule.org )
6 //
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
9 // respective authors.
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #ifndef AMULEIPV4ADDRESS_H
27 #define AMULEIPV4ADDRESS_H
29 #include <wx/object.h> // Needed by wx/sckaddr.h
31 #include "NetworkFunctions.h" // Needed for StringIPtoUint32
33 class amuleIPV4Address : public wxIPV4address
35 public:
36 amuleIPV4Address() {}
37 amuleIPV4Address(const wxIPV4address &a) : wxIPV4address(a) {}
39 virtual bool Hostname(const wxString& name)
41 // Some people are sometimes fools.
42 if (name.IsEmpty()) {
43 return false;
46 return wxIPV4address::Hostname(name);
49 virtual bool Hostname(uint32 ip)
51 // Some people are sometimes fools.
52 if (!ip) {
53 return false;
56 return wxIPV4address::Hostname(Uint32toStringIP(ip));
60 #endif // AMULEIPV4ADDRESS_H
61 // File_checked_for_headers