Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
L2.hpp File Reference

This file contains some definitions and helper functions related to layer 2 (e.g., MAC). More...

#include "Types.hpp"
#include <net/ethernet.h>
Include dependency graph for L2.hpp:
This graph shows which files directly or indirectly include this file:

Classes

struct  Myra::L2::Header
 Layer 2, Ethernet frame. More...
 
struct  Myra::L2::Header_with_VLAN
 Layer 2 can also have an optional 802.1Q VLAN tag, which pushes fields out by 4 bytes. More...
 

Namespaces

 Myra
 Namespace declaration for all of the Myra Canyon helper functions.
 
 Myra::L2
 Layer 2 (ethernet).
 

Enumerations

enum  Myra::L2::Ethertype {
  Myra::L2::Ethertype::Unknown = 0x0000,
  Myra::L2::Ethertype::IPv4 = 0x0008,
  Myra::L2::Ethertype::ARP = 0x0608,
  Myra::L2::Ethertype::IPv6 = 0xdd86
}
 The Ethertype in network byte order. More...
 

Functions

const Header * Myra::L2::get_header (const uint8_t *ptr)
 Get the layer 2 header. More...
 
Ethertype Myra::L2::get_ethertype (const Header *header)
 Get the ethertype. More...
 
const uint8_t * Myra::L2::get_L3_pointer (const Header *header)
 Get the layer 3 pointer. More...
 
std::string Myra::L2::to_string (const Ethertype &type)
 Convert the type to a short text string. More...
 
bool Myra::L2::is_known_ethertype (const Ethertype &type)
 Determine if the Ethertype is known. More...
 
bool Myra::L2::is_known_ethertype (const Header *header)
 Determine if the Ethertype is known. More...
 
bool Myra::L2::is_unknown_ethertype (const Ethertype &type)
 Determine if the Ethertype is unknown. More...
 
bool Myra::L2::is_unknown_ethertype (const Header *header)
 Determine if the Ethertype is unknown. More...
 

Detailed Description

This file contains some definitions and helper functions related to layer 2 (e.g., MAC).