SatCat5
satcat5::ip::Subnet Struct Reference

Detailed Description

An IPv4 subnet consists of a base address and a subnet mask.

Definition at line 87 of file ip_core.h.

#include <ip_core.h>

Collaboration diagram for satcat5::ip::Subnet:
[legend]

Public Member Functions

 Subnet (const Subnet &t)=default
 
Subnetoperator= (const Subnet &t)=default
 
constexpr bool contains (const satcat5::ip::Addr &other) const
 Does this subnet contain the given address?
 
unsigned prefix () const
 Get the CIDR prefix length for this subnet.
 
void log_to (satcat5::log::LogBuffer &wr) const
 Format this subnet in CIDR form, e.g., "192.168.1.0/24".
 
constexpr bool operator== (const satcat5::ip::Addr &other) const
 Commonly used operators.
 
constexpr bool operator== (const satcat5::ip::Subnet &other) const
 Commonly used operators.
 
constexpr bool operator!= (const satcat5::ip::Subnet &other) const
 Commonly used operators.
 

Public Attributes

satcat5::ip::Addr addr
 Base address.
 
satcat5::ip::Mask mask
 Subnet mask.
 

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