Represents the bitwise mask for a version 4 subnet.
More...
#include <ip.hpp>
|
static SubnetMaskV4 | by_id (u8 id) |
| Retrieves a subnet mask by id (valid ids is 0-32).
|
|
static constexpr bool | valid_id (u8 id) |
| Checks if an id is a valid subnet mask id (0-32)
|
|
Represents the bitwise mask for a version 4 subnet.
Definition at line 129 of file ip.hpp.
◆ by_id()
Retrieves a subnet mask by id (valid ids is 0-32).
Will abort if id is invalid
- Parameters
-
id | ID of the subnet mask to get |
Definition at line 169 of file ip.hpp.
169 {
171 return impl::ip4SubnetMasks[
id];
172 }
#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 an id is a valid subnet mask id (0-32)
◆ subnet_ip()
Subnets an IP address based on the IP mask.
- Parameters
-
- Returns
- Masked IP address
◆ valid_id()
bool mtcore::SubnetMaskV4::valid_id |
( |
u8 | id | ) |
|
|
staticconstexpr |
Checks if an id is a valid subnet mask id (0-32)
- Parameters
-
Definition at line 167 of file ip.hpp.
167{ return id < impl::ip4SubnetMasks.size(); }
◆ id
u8 mtcore::SubnetMaskV4::id = 0 |
◆ mask
u32 mtcore::SubnetMaskV4::mask = 0 |
The documentation for this struct was generated from the following file: