#include <IpAddress.h>
Inheritance diagram for IpAddress::
Public Methods | |
IpAddress () | |
IpAddress (unsigned long) | |
IpAddress (const char *) | |
IpAddress (std::string) | |
IpAddress (struct in_addr) | |
IpAddress (const IpAddress &) | |
virtual | ~IpAddress () |
unsigned long | getUnsignedLongForm () |
string | getHostname () |
IpVersion | getVersion () |
bool | isLanIp () |
Returns true if this IP address is for a local area network. More... | |
bool | isLoopback () |
Returns true if this is the loopback address (127.0.0.1). More... | |
bool | isZero () |
Return true if the IP address is zero. More... | |
bool | isInAddrAny () |
Returns true if the IP address is equal to INADDR_ANY. More... | |
void | setIpAddress (unsigned long ipAddr) |
void | setIpAddress (const char *) |
Set the IP address given a pointer to a C string. More... | |
void | setIpAddress (std::string) |
void | setIpAddress (struct in_addr) |
void | setIpAddress (const IpAddress &) |
void | setVersion (IpVersion) |
bool | equals (IpAddress) |
bool | equals (unsigned long) |
bool | equals (const char *) |
Returns true if the IP address given is equal to the one stored internally. More... | |
bool | equals (std::string) |
bool | equals (struct in_addr) |
bool | read (std::istream &) |
Return true on success, false on error or EOF. More... | |
virtual void | toStream (std::ostream &) |
Print the dotted decimal form of the IP address to the output stream. More... | |
const char * | toCStr () |
Private Attributes | |
IpVersion | m_version |
unsigned long | m_ipAddr |
char | m_cstr [MAX_IP_ADDR_STR] |
string | m_hostname |
(Not IP address and port - for that see the "SocketAddress" class.) Allows you to convert from all different types into an IP address.
Definition at line 11 of file IpAddress.h.
|
Definition at line 10 of file IpAddress.cpp. |
|
Definition at line 16 of file IpAddress.cpp. |
|
Definition at line 22 of file IpAddress.cpp. |
|
Definition at line 28 of file IpAddress.cpp. |
|
Definition at line 34 of file IpAddress.cpp. |
|
Definition at line 40 of file IpAddress.cpp. |
|
Definition at line 45 of file IpAddress.cpp. |
|
Definition at line 185 of file IpAddress.cpp. |
|
Definition at line 178 of file IpAddress.cpp. |
|
Returns true if the IP address given is equal to the one stored internally. This function will automatically figure out if the string is a dotted decimal or a hostname. If it is a hostname, it will look it up and compare the IP addresses. Note: this means servers with multiple IP addresses could be a problem. Definition at line 171 of file IpAddress.cpp. |
|
Definition at line 158 of file IpAddress.cpp. |
|
Definition at line 152 of file IpAddress.cpp. Referenced by Node::equals(), and TcpConnection::isConnectedTo().
|
|
Definition at line 57 of file IpAddress.cpp. |
|
Definition at line 51 of file IpAddress.cpp. Referenced by ImHerePacket::getRawData(), ConnectionPacket::getRawData(), SocketAddress::setIpAddress(), and SocketAddress::setPort().
|
|
Definition at line 140 of file IpAddress.cpp. Referenced by ImHerePacket::getRawData(), and ConnectionPacket::getRawData().
|
|
Returns true if the IP address is equal to INADDR_ANY.
Definition at line 270 of file IpAddress.cpp. |
|
Returns true if this IP address is for a local area network. This is true if the address is one of the following: (from RFC1918)
Definition at line 204 of file IpAddress.cpp. Referenced by WebServer::handleConnection(), and Interface::toStream().
|
|
Returns true if this is the loopback address (127.0.0.1).
Definition at line 243 of file IpAddress.cpp. Referenced by WebServer::handleConnection().
|
|
Return true if the IP address is zero.
Definition at line 261 of file IpAddress.cpp. Referenced by SocketAddress::isZero().
|
|
Return true on success, false on error or EOF.
Definition at line 279 of file IpAddress.cpp. |
|
Definition at line 130 of file IpAddress.cpp. |
|
Definition at line 116 of file IpAddress.cpp. |
|
Definition at line 110 of file IpAddress.cpp. |
|
Set the IP address given a pointer to a C string. The C string may be either a dotted decimal or a hostname, this function will figure it out for you. If the name is unable to be resolved, the IP address will be zero. Definition at line 82 of file IpAddress.cpp. |
|
Definition at line 67 of file IpAddress.cpp. Referenced by ConnectionPacket::ConnectionPacket(), ImHerePacket::ImHerePacket(), IpAddress(), read(), setIpAddress(), and SocketAddress::setSocketAddress().
|
|
Definition at line 146 of file IpAddress.cpp. Referenced by ConnectionPacket::ConnectionPacket(), ImHerePacket::ImHerePacket(), and IpAddress().
|
|
Definition at line 304 of file IpAddress.cpp. Referenced by LinkLayerInterface::accept(), getHostname(), setIpAddress(), SocketAddress::toCStr(), and toStream().
|
|
Print the dotted decimal form of the IP address to the output stream.
Reimplemented from BasicObject. Definition at line 291 of file IpAddress.cpp. |
|
Definition at line 56 of file IpAddress.h. |
|
Definition at line 57 of file IpAddress.h. |
|
Definition at line 55 of file IpAddress.h. |
|
Definition at line 54 of file IpAddress.h. |