|
Public Member Functions |
| Comparison | Compare (const PObject &obj) const |
| | Compare two adresses for absolute (in)equality.
|
| bool | operator== (const Address &addr) const |
| bool | operator!= (const Address &addr) const |
| bool | operator== (in_addr &addr) const |
| bool | operator!= (in_addr &addr) const |
| bool | operator== (DWORD dw) const |
| bool | operator!= (DWORD dw) const |
| bool | operator== (int i) const |
| bool | operator!= (int i) const |
| bool | operator *= (const Address &addr) const |
| PString | AsString () const |
| | Format an address as a string.
|
| BOOL | FromString (const PString &str) |
| | Convert string to IP address. Returns TRUE if was a valid address.
|
| | operator PString () const |
| | Format an address as a string.
|
| | operator in_addr () const |
| | Return IPv4 address in network order.
|
| | operator DWORD () const |
| | Return IPv4 address in network order.
|
| BYTE | Byte1 () const |
| | Return first byte of IPv4 address.
|
| BYTE | Byte2 () const |
| | Return second byte of IPv4 address.
|
| BYTE | Byte3 () const |
| | Return third byte of IPv4 address.
|
| BYTE | Byte4 () const |
| | Return fourth byte of IPv4 address.
|
| BYTE | operator[] (PINDEX idx) const |
| | return specified byte of IPv4 or IPv6 address
|
| PINDEX | GetSize () const |
| | Get the address length (will be either 4 or 16).
|
| const char * | GetPointer () const |
| | Get the pointer to IP address data.
|
| unsigned | GetVersion () const |
| | Get the version of the IP address being used.
|
| BOOL | IsValid () const |
| | Check address 0.0.0.0 or ::.
|
| BOOL | IsAny () const |
| BOOL | IsLoopback () const |
| | Check address 127.0.0.1 or ::1.
|
| BOOL | IsBroadcast () const |
| | Check for Broadcast address 255.255.255.255.
|
| BOOL | IsRFC1918 () const |
|
| | Address () |
| | Create an IPv4 address with the default address: 127.0.0.1 (loopback).
|
| | Address (const PString &dotNotation) |
| | Address (PINDEX len, const BYTE *bytes) |
| | Create an IPv4 or IPv6 address from 4 or 16 byte values.
|
| | Address (BYTE b1, BYTE b2, BYTE b3, BYTE b4) |
| | Create an IP address from four byte values.
|
| | Address (DWORD dw) |
| | Create an IPv4 address from a four byte value in network byte order.
|
| | Address (const in_addr &addr) |
| | Create an IPv4 address from an in_addr structure.
|
| Address & | operator= (const in_addr &addr) |
| | Copy an address from another IP v4 address.
|
| Address & | operator= (const PString &dotNotation) |
| | Copy an address from a string.
|
| Address & | operator= (DWORD dw) |
| | Copy an address from a four byte value in network order.
|
Static Public Member Functions |
| static const Address & | GetLoopback () |
| static const Address & | GetBroadcast () |
Protected Attributes |
| union { |
| in_addr four |
| } | v |
| | Runtime test of IP addresse type.
|
| unsigned | version |
Friends |
| ostream & | operator<< (ostream &s, const PString &str) |
| | need this to avoid intepreting string as addresses
|
| ostream & | operator<< (ostream &s, const Address &a) |
| | output IPv6 & IPv4 address as a string to the specified string
|
| istream & | operator>> (istream &s, Address &a) |
| | input IPv4 (not IPv6 yet!) address as a string from the specified string
|