Bitcoin
Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
CSubNet Class Reference

#include <netaddress.h>

Public Member Functions

 CSubNet ()
 
 CSubNet (const CNetAddr &addr, int32_t mask)
 
 CSubNet (const CNetAddr &addr, const CNetAddr &mask)
 
 CSubNet (const CNetAddr &addr)
 
bool Match (const CNetAddr &addr) const
 
std::string ToString () const
 
bool IsValid () const
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 

Public Attributes

 ADD_SERIALIZE_METHODS
 

Protected Attributes

CNetAddr network
 Network (base) address. More...
 
uint8_t netmask [16]
 Netmask, in network byte order. More...
 
bool valid
 Is this value valid? (only used to signal parse errors) More...
 

Friends

bool operator== (const CSubNet &a, const CSubNet &b)
 
bool operator!= (const CSubNet &a, const CSubNet &b)
 
bool operator< (const CSubNet &a, const CSubNet &b)
 

Constructor & Destructor Documentation

◆ CSubNet() [1/4]

CSubNet::CSubNet ( )

◆ CSubNet() [2/4]

CSubNet::CSubNet ( const CNetAddr addr,
int32_t  mask 
)

◆ CSubNet() [3/4]

CSubNet::CSubNet ( const CNetAddr addr,
const CNetAddr mask 
)

◆ CSubNet() [4/4]

CSubNet::CSubNet ( const CNetAddr addr)
explicit

Member Function Documentation

◆ IsValid()

bool CSubNet::IsValid ( ) const

◆ Match()

bool CSubNet::Match ( const CNetAddr addr) const
Returns
True if this subnet is valid, the specified address is valid, and the specified address belongs in this subnet.

◆ SerializationOp()

template<typename Stream , typename Operation >
void CSubNet::SerializationOp ( Stream &  s,
Operation  ser_action 
)
inline

◆ ToString()

std::string CSubNet::ToString ( ) const

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const CSubNet a,
const CSubNet b 
)
friend

◆ operator<

bool operator< ( const CSubNet a,
const CSubNet b 
)
friend

◆ operator==

bool operator== ( const CSubNet a,
const CSubNet b 
)
friend

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

CSubNet::ADD_SERIALIZE_METHODS

◆ netmask

uint8_t CSubNet::netmask[16]
protected

Netmask, in network byte order.

◆ network

CNetAddr CSubNet::network
protected

Network (base) address.

◆ valid

bool CSubNet::valid
protected

Is this value valid? (only used to signal parse errors)


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