Layer 2 (ethernet).
More...
The Ethertype in network byte order.
- Note
- If you add a new type, also update Myra::DB::update_ethertypes() to ensure it gets written to the database.
Enumerator |
---|
Unknown |
|
IPv4 |
host 0x0800, net 0x0008, aka ETHERTYPE_IP
|
ARP |
host 0x0806, net 0x0608, aka ETHERTYPE_ARP
|
IPv6 |
host 0x86dd, net 0xdd86, aka ETHERTYPE_IPV6
|
bool Myra::L2::ethertype_is_ARP |
( |
const L2::Ethertype |
type | ) |
|
|
inline |
Determine if a packet's layer 3 is ARP.
bool Myra::L2::ethertype_is_ARP |
( |
const L2::Header * |
l2 | ) |
|
|
inline |
Determine if a packet's layer 3 is ARP.
bool Myra::L2::ethertype_is_IP |
( |
const L2::Ethertype |
type | ) |
|
|
inline |
bool Myra::L2::ethertype_is_IP |
( |
const L2::Header * |
l2 | ) |
|
|
inline |
bool Myra::L2::ethertype_is_IPv4 |
( |
const L2::Ethertype |
type | ) |
|
|
inline |
Determine if a packet's layer 3 is IPv4.
bool Myra::L2::ethertype_is_IPv4 |
( |
const L2::Header * |
l2 | ) |
|
|
inline |
Determine if a packet's layer 3 is IPv4.
bool Myra::L2::ethertype_is_IPv6 |
( |
const L2::Ethertype |
type | ) |
|
|
inline |
Determine if a packet's layer 3 is IPv6.
bool Myra::L2::ethertype_is_IPv6 |
( |
const L2::Header * |
l2 | ) |
|
|
inline |
Determine if a packet's layer 3 is IPv6.
Ethertype Myra::L2::get_ethertype |
( |
const Header * |
header | ) |
|
|
inline |
const Header* Myra::L2::get_header |
( |
const uint8_t * |
ptr | ) |
|
|
inline |
const uint8_t* Myra::L2::get_L3_pointer |
( |
const Header * |
header | ) |
|
|
inline |
bool Myra::L2::is_known_ethertype |
( |
const Ethertype & |
type | ) |
|
|
inline |
Determine if the Ethertype is known.
- Returns
true
if the Ethertype value maps to one of the Myra::L2::Ethertype enums
bool Myra::L2::is_known_ethertype |
( |
const Header * |
header | ) |
|
|
inline |
Determine if the Ethertype is known.
- Returns
true
if the Ethertype value maps to one of the Myra::L2::Ethertype enums
bool Myra::L2::is_unknown_ethertype |
( |
const Ethertype & |
type | ) |
|
|
inline |
Determine if the Ethertype is unknown.
- Returns
true
if the Ethertype value does not map to one of the Myra::L2::Ethertype enums
bool Myra::L2::is_unknown_ethertype |
( |
const Header * |
header | ) |
|
|
inline |
Determine if the Ethertype is unknown.
- Returns
true
if the Ethertype value does not map to one of the Myra::L2::Ethertype enums
std::string Myra::L2::to_string |
( |
const Ethertype & |
type | ) |
|
|
inline |
Convert the type to a short text string.
For example: