version 1.1.2.3, 2007/06/18 09:10:40
|
version 1.1.4.3, 2007/06/25 21:10:34
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
#ifdef INET_ADDRSTRLEN |
|
#define PEGASUS_INET_ADDRSTR_LEN INET_ADDRSTRLEN |
|
#else |
#define PEGASUS_INET_ADDRSTR_LEN 16 | #define PEGASUS_INET_ADDRSTR_LEN 16 |
|
#endif |
|
|
|
#ifdef INET6_ADDRSTRLEN |
|
#define PEGASUS_INET6_ADDRSTR_LEN INET6_ADDRSTRLEN |
|
#else |
#define PEGASUS_INET6_ADDRSTR_LEN 46 | #define PEGASUS_INET6_ADDRSTR_LEN 46 |
|
#endif |
| |
#define PEGASUS_IPV4_LOOPBACK_ADDRESS "127.0.0.1" |
#ifdef IN6ADDR_LOOPBACK_INIT |
#define PEGASUS_IPV6_LOOPBACK_ADDRESS "::1" |
#define PEGASUS_IPV6_LOOPBACK_INIT IN6ADDR_LOOPBACK_INIT |
|
#else |
#define PEGASUS_IPV6_LOOPBACK_INIT {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1} | #define PEGASUS_IPV6_LOOPBACK_INIT {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1} |
|
#endif |
|
|
|
|
|
#ifdef INADDR_LOOPBACK |
|
#define PEGASUS_IPV4_LOOPBACK_INIT INADDR_LOOPBACK |
|
#else |
#define PEGASUS_IPV4_LOOPBACK_INIT 0x7F000001 | #define PEGASUS_IPV4_LOOPBACK_INIT 0x7F000001 |
|
#endif |
| |
|
#ifdef PEGASUS_ENABLE_IPV6 |
|
#define PEGASUS_IN6_ADDR_SIZE (sizeof (struct in6_addr)) |
|
#else |
|
#define PEGASUS_IN6_ADDR_SIZE 0x10 |
|
#endif |
| |
/** | /** |
This class is used to store the host address. HostAddress can be Hostname or | This class is used to store the host address. HostAddress can be Hostname or |
|
|
| |
/** | /** |
Constructor. addrStr can be HostName or IPv4Address or | Constructor. addrStr can be HostName or IPv4Address or |
IPv6Address. |
IPv6Address (without brackets). |
*/ | */ |
HostAddress(const String &addrStr); | HostAddress(const String &addrStr); |
HostAddress(const HostAddress &rhs); | HostAddress(const HostAddress &rhs); |
|
|
void setHostAddress(const String &addrStr); | void setHostAddress(const String &addrStr); |
| |
/** | /** |
Returns true if the address is valid. If vaild it can be HostName |
Returns true if the constructed HostAddress is valid. |
or IPv4Address or IPv6Address. |
If valid it can be HostName or IPv4Address or IPv6Address. |
|
Check if HostAddress is valid by using isValid() method |
|
before making any calls on HostAddress object. |
*/ | */ |
Boolean isValid(); | Boolean isValid(); |
| |
/** | /** |
Verifies given ipv4Address and returns true if it is valid. |
Verifies given IPv4Address and returns true if it is valid. |
*/ | */ |
static Boolean isValidIPV4Address(const String &ipv4Address); | static Boolean isValidIPV4Address(const String &ipv4Address); |
| |
/** | /** |
Verifies given ipv6Address and returns true if it is valid. |
Verifies given IPv6Address (without brackets) and returns |
|
true if it is valid. |
*/ | */ |
static Boolean isValidIPV6Address(const String &ipv6Address); | static Boolean isValidIPV6Address(const String &ipv6Address); |
| |
|
|
static Boolean equal(int af, void *p1, void *p2); | static Boolean equal(int af, void *p1, void *p2); |
| |
/** | /** |
Returns HostName or IPv4Address or IPv6Address. Removes port number |
Returns HostName or IPv4Address or IPv6Address. This returns an empty |
from HostAddress if present. This returns empty string HostAddress is |
String if HostAddress is not valid. |
not valid. Check if HostAddress is valid by using isValid() method |
Check if HostAddress is valid by using isValid() method |
before making any calls on HostAddress object. | before making any calls on HostAddress object. |
*/ | */ |
String getHost(); | String getHost(); |