InspIRCd  2.0
Public Member Functions | Public Attributes | List of all members
irc::sockets::cidr_mask Struct Reference

Public Member Functions

 cidr_mask (const std::string &mask)
 cidr_mask (const irc::sockets::sockaddrs &addr, int len)
bool operator== (const cidr_mask &other) const
bool operator< (const cidr_mask &other) const
bool match (const irc::sockets::sockaddrs &addr) const
std::string str () const

Public Attributes

unsigned char type
unsigned char length
unsigned char bits [16]

Constructor & Destructor Documentation

◆ cidr_mask() [1/2]

irc::sockets::cidr_mask::cidr_mask ( const std::string &  mask)

Construct a CIDR mask from the string. Will normalize ( =>

◆ cidr_mask() [2/2]

irc::sockets::cidr_mask::cidr_mask ( const irc::sockets::sockaddrs addr,
int  len 

Construct a CIDR mask of a given length from the given address

Member Function Documentation

◆ match()

bool irc::sockets::cidr_mask::match ( const irc::sockets::sockaddrs addr) const

Match within this CIDR?

◆ operator<()

bool irc::sockets::cidr_mask::operator< ( const cidr_mask other) const

Ordering defined for maps

◆ operator==()

bool irc::sockets::cidr_mask::operator== ( const cidr_mask other) const

Equality of bits, type, and length

◆ str()

std::string irc::sockets::cidr_mask::str ( ) const

Human-readable string

Member Data Documentation

◆ bits

unsigned char irc::sockets::cidr_mask::bits[16]

Raw bits. Unused bits must be zero

◆ length

unsigned char irc::sockets::cidr_mask::length

Length of the mask in bits (0-128)

◆ type

unsigned char irc::sockets::cidr_mask::type


The documentation for this struct was generated from the following files: