This class encapsulates an IPv4 address. More...
#include <DwmIpv4Address.hh>


Public Member Functions | |
| Ipv4Address () | |
| Constructor. | |
| Ipv4Address (ipv4addr_t addr) | |
| Construct from an ipv4addr_t (32-bit value in network byte order). | |
| Ipv4Address (const std::string &dottedAddr) | |
| Construct from a dotted-decimal string. | |
| ipv4addr_t | Raw () const |
| Returns an ipv4addr_t representation (32-bit value in network byte order). More... | |
| operator std::string () const | |
| Returns a dotted-decimal string representation. | |
| bool | IsV6 () const |
| bool | operator< (const Ipv4Address &addr) const |
| less-than operator. | |
| bool | operator> (const Ipv4Address &addr) const |
| Greater-than operator. | |
| bool | operator>= (const Ipv4Address &addr) const |
| Greater than or equal-to operator. | |
| bool | operator<= (const Ipv4Address &addr) const |
| Less-than or equal-to operator. | |
| bool | operator== (const Ipv4Address &addr) const |
| Equal-to operator. | |
| bool | operator!= (const Ipv4Address &addr) const |
| Not-equal-to operator. | |
| Ipv4Address & | operator&= (const Ipv4Address &mask) |
| Mask operator. | |
| Ipv4Address | operator++ (int) |
| Post-increment operator. | |
| Ipv4Address & | operator++ () |
| Pre-increment operator. | |
| Ipv4Address | operator-- (int) |
| Post-decrement operator. | |
| Ipv4Address & | operator-- () |
| Pre-decrement operator. | |
| Ipv4Address & | operator-= (uint32_t i) |
| -= operator. More... | |
| Ipv4Address & | operator+= (uint32_t i) |
| += operator. More... | |
| bool | BitIsSet (int8_t bit) const |
| int | GetBit (int bit) const |
| uint32_t | StreamedLength () const |
| Returns the number of bytes that would be written if we called one of the Write() members. More... | |
| std::istream & | Read (std::istream &is) |
| Reads from an istream. Returns the istream. | |
| std::ostream & | Write (std::ostream &os) const |
| Writes to an ostream. Returns the ostream. | |
| ssize_t | Read (int fd) |
| Reads from a file descriptor. More... | |
| ssize_t | Write (int fd) const |
| Writes to a file descriptor. More... | |
| size_t | Read (FILE *f) |
| Reads from a FILE pointer. Returns 1 on success, 0 on failure. | |
| size_t | Write (FILE *f) const |
| Writes to a FILE pointer. Returns 1 on success, 0 on failure. | |
| int | Read (gzFile gzf) |
| Reads from a gzFile. More... | |
| int | Write (gzFile gzf) const |
| Writes to a gzFile. More... | |
| int | BZRead (BZFILE *bzf) |
| Reads from a BZFILE pointer. More... | |
| int | BZWrite (BZFILE *bzf) const |
| Writes to a BZFILE pointer. More... | |
| uint32_t | IpSum () const |
| Returns the partial sum of the IP address, as would be used when calculating the IP header checksum or UDP checksum (as part of the 'pseudo-header' used for UDP checksums). More... | |
Public Member Functions inherited from Dwm::Readable | |
| virtual | ~Readable () |
| destructor | |
Public Member Functions inherited from Dwm::Writable | |
| virtual | ~Writable () |
| Destructor. | |
Public Member Functions inherited from Dwm::GZReadable | |
| virtual | ~GZReadable () |
| destructor | |
Public Member Functions inherited from Dwm::GZWritable | |
| virtual | ~GZWritable () |
| destructor | |
Static Public Member Functions | |
| static uint8_t | MaxKeyBits () |
Protected Attributes | |
| uint32_t | _addr |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Ipv4Address &addr) |
| Prints an Ipv4Address to an ostream in human-readable form. | |
| Ipv4Address | operator& (const Ipv4Address &addr, const Ipv4Address &mask) |
This class encapsulates an IPv4 address.
|
virtual |
Reads from a BZFILE pointer.
Returns the number of bytes read (4 on success).
Implements Dwm::BZ2Readable.
|
virtual |
Writes to a BZFILE pointer.
Returns the number of bytes written (4 on success).
Implements Dwm::BZ2Writable.
| uint32_t Dwm::Ipv4Address::IpSum | ( | ) | const |
Returns the partial sum of the IP address, as would be used when calculating the IP header checksum or UDP checksum (as part of the 'pseudo-header' used for UDP checksums).
|
inline |
+= operator.
Protects against roll-over (will not increment past 255.255.255.255). Note that the right hand side must be in host byte order.

|
inline |
-= operator.
Protects against roll-under (will not decrement past 0.0.0.0). Note that the right hand side must be in host byte order.
|
inline |
Returns an ipv4addr_t representation (32-bit value in network byte order).
|
virtual |
Reads from a file descriptor.
Returns the number of bytes read (4 on success).
Implements Dwm::Readable.
|
virtual |
|
virtual |
Returns the number of bytes that would be written if we called one of the Write() members.
Implements Dwm::Writable.
|
virtual |
Writes to a file descriptor.
Returns the number of bytes written (4 on success).
Implements Dwm::Writable.
|
virtual |