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

A masked IP version 6 address. More...

#include <ip.hpp>

Collaboration diagram for mtcore::SubnetV6:

Public Member Functions

bool is_valid () const
 Checks if a masked IP address is valid (i.e.
 
bool operator== (const SubnetV6 &o) const
 
bool operator!= (const SubnetV6 &o) const
 

Public Attributes

IPv6 ip = {}
 
u8 mask_id = 0
 

Detailed Description

A masked IP version 6 address.

Definition at line 259 of file ip.hpp.

Member Function Documentation

◆ is_valid()

bool mtcore::SubnetV6::is_valid ( ) const
inlinenodiscard

Checks if a masked IP address is valid (i.e.

the subnet id is correct and the mask is applied)

Definition at line 266 of file ip.hpp.

266 {
268 return false;
269 }
271 }
SubnetV6 subnet_ip(const IPv6 &ip)
Subnets an IP address using the subnet mask.
static constexpr bool valid_id(u8 id)
Checks if a subnet mask ID is valid (0-128)
Definition ip.hpp:231
static SubnetMaskV6 by_id(u8 id)
Gets a subnet mask by id.
Definition ip.hpp:226
Here is the call graph for this function:

◆ operator!=()

bool mtcore::SubnetV6::operator!= ( const SubnetV6 & o) const
inline

Definition at line 274 of file ip.hpp.

274{ return !(o == *this); }

◆ operator==()

bool mtcore::SubnetV6::operator== ( const SubnetV6 & o) const
inline

Definition at line 273 of file ip.hpp.

273{ return mask_id == o.mask_id && ip == o.ip; }

Member Data Documentation

◆ ip

IPv6 mtcore::SubnetV6::ip = {}

Definition at line 260 of file ip.hpp.

260{};

◆ mask_id

u8 mtcore::SubnetV6::mask_id = 0

Definition at line 261 of file ip.hpp.


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