libDwm-0.9.45
Dwm::IpPrefix Class Reference

Encapsulates an IP prefix (v4 or v6). More...

#include <DwmIpPrefix.hh>

Public Member Functions

 IpPrefix (const IpAddress &network, uint8_t maskLength)
 
 IpPrefix (const Ipv4Prefix &prefix)
 
 IpPrefix (const Ipv6Prefix &prefix)
 
 IpPrefix (const std::string &prefix)
 
int Family () const
 
template<typename T >
const T * Prefix () const
 
 operator std::string () const
 
bool Set (const IpAddress &network, uint8_t maskLength)
 
bool Contains (const IpAddress &addr) const
 
bool Contains (const Ipv4Address &addr) const
 
bool Contains (const Ipv6Address &addr) const
 
bool operator< (const IpPrefix &prefix) const
 
bool operator> (const IpPrefix &prefix) const
 
bool operator== (const IpPrefix &prefix) const
 
bool operator!= (const IpPrefix &prefix) const
 
ssize_t Read (int fd)
 Reads the prefix from a file descriptor.
 
ssize_t Write (int fd) const
 Writes the prefix to a file descriptor.
 
size_t Read (FILE *f)
 Reads the prefix from a FILE pointer.
 
size_t Write (FILE *f) const
 Writes the prefix to a FILE pointer.
 
std::istream & Read (std::istream &is)
 Reads the prefix from an istream. Returns the istream.
 
std::ostream & Write (std::ostream &os) const
 Writes the prefix to an ostream. Returns the ostream.
 
int Read (gzFile gzf)
 Reads the prefix from a gzFile.
 
int Write (gzFile gzf) const
 Writes the prefix to a gzFile.
 
int BZRead (BZFILE *bzf)
 Reads the prefix from a BZFILE pointer.
 
int BZWrite (BZFILE *bzf) const
 Writes the prefix to a BZFILE pointer.
 
uint64_t StreamedLength () const
 Returns the number of bytes that would be written if the prefix was written to a file descriptor or ostream.
 

Friends

std::ostream & operator<< (std::ostream &os, const IpPrefix &addr)
 ostream output operator
 

Detailed Description

Encapsulates an IP prefix (v4 or v6).

Member Function Documentation

◆ Read()

size_t Dwm::IpPrefix::Read ( FILE * f)

Reads the prefix from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write()

size_t Dwm::IpPrefix::Write ( FILE * f) const

Writes the prefix to a FILE pointer.

Returns 1 on success, 0 on failure.


The documentation for this class was generated from the following file: