MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::SubnetMaskV6 Struct Reference

Gets a subnet mask for an IP version 6 subnet. More...

#include <ip.hpp>

Public Member Functions

SubnetV6 subnet_ip (const IPv6 &ip)
 Subnets an IP address using the subnet mask.
 

Static Public Member Functions

static SubnetMaskV6 by_id (u8 id)
 Gets a subnet mask by id.
 
static constexpr bool valid_id (u8 id)
 Checks if a subnet mask ID is valid (0-128)
 

Public Attributes

u8 id = 0
 
u64 maskHigh = 0
 
u64 maskLow = 0
 

Detailed Description

Gets a subnet mask for an IP version 6 subnet.

Definition at line 180 of file ip.hpp.

Member Function Documentation

◆ by_id()

SubnetMaskV6 mtcore::SubnetMaskV6::by_id ( u8 id)
inlinestatic

Gets a subnet mask by id.

Valid ids is 0-128

Parameters
idID of subnet mask to get

Definition at line 226 of file ip.hpp.

226 {
227 ensure(valid_id(id));
228 return impl::ip6SubnetMasks[id];
229 }
#define ensure(check,...)
Ensures that a check holds true, aborts the program if not true Will print error if the condition is ...
static constexpr bool valid_id(u8 id)
Checks if a subnet mask ID is valid (0-128)
Definition ip.hpp:231
Here is the call graph for this function:
Here is the caller graph for this function:

◆ subnet_ip()

SubnetV6 mtcore::SubnetMaskV6::subnet_ip ( const IPv6 & ip)

Subnets an IP address using the subnet mask.

Parameters
ipIP address to subnet
Returns
Masked IP address
Here is the caller graph for this function:

◆ valid_id()

bool mtcore::SubnetMaskV6::valid_id ( u8 id)
staticconstexpr

Checks if a subnet mask ID is valid (0-128)

Parameters
idID to validate

Definition at line 231 of file ip.hpp.

231{ return id < impl::ip6SubnetMasks.size(); }
Here is the caller graph for this function:

Member Data Documentation

◆ id

u8 mtcore::SubnetMaskV6::id = 0

Definition at line 181 of file ip.hpp.

◆ maskHigh

u64 mtcore::SubnetMaskV6::maskHigh = 0

Definition at line 182 of file ip.hpp.

◆ maskLow

u64 mtcore::SubnetMaskV6::maskLow = 0

Definition at line 183 of file ip.hpp.


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