InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
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

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

Construct a CIDR mask from the string. Will normalize (127.0.0.1/8 => 127.0.0.0/8).

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

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

Match within this CIDR?

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

Ordering defined for maps

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

Equality of bits, type, and length

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

Human-readable string

Member Data Documentation

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

Raw bits. Unused bits must be zero

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

Length of the mask in bits (0-128)

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

Type, AF_INET or AF_INET6


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