Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Myra::L3_IP Namespace Reference

Layer 3 is either IPv4 or IPv6. More...

Enumerations

enum  Protocol {
  Protocol::Unknown = 255,
  Protocol::HOPOPTS = IPPROTO_HOPOPTS,
  Protocol::ICMP = IPPROTO_ICMP,
  Protocol::TCP = IPPROTO_TCP,
  Protocol::UDP = IPPROTO_UDP,
  Protocol::ICMPv6 = IPPROTO_ICMPV6
}
 Single-byte protocol numbers used in Myra::L3_IPv4::Header::protocol and Myra::L3_IPv6::Header::next_header. More...
 

Functions

std::string to_string (const Protocol &protocol)
 Return a simple text string that represents the name of the IP protocol (layer 4). More...
 
bool is_known_protocol (const Protocol &protocol)
 Determine if the protocol is a known value. More...
 
bool is_unknown_protocol (const Protocol &protocol)
 Determine if the protocol is unknown. More...
 

Detailed Description

Layer 3 is either IPv4 or IPv6.

Enumeration Type Documentation

enum Myra::L3_IP::Protocol
strong

Single-byte protocol numbers used in Myra::L3_IPv4::Header::protocol and Myra::L3_IPv6::Header::next_header.

Note
If you add a new protocol, also update Myra::DB::update_protocol_types() to ensure it gets written to the database.
Enumerator
Unknown 
HOPOPTS 

0x00

ICMP 

0x01

TCP 

0x06

UDP 

0x11 (aka decimal 17)

ICMPv6 

0x3a (aka decimal 58)

Function Documentation

bool Myra::L3_IP::is_known_protocol ( const Protocol &  protocol)
inline

Determine if the protocol is a known value.

See also
L3_IPv4::is_known_protocol()
L3_IPv6::is_known_protocol()

Here is the call graph for this function:

Here is the caller graph for this function:

bool Myra::L3_IP::is_unknown_protocol ( const Protocol &  protocol)
inline

Determine if the protocol is unknown.

See also
L3_IPv4::is_unknown_protocol()
L3_IPv6::is_unknown_protocol()

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Myra::L3_IP::to_string ( const Protocol &  protocol)
inline

Return a simple text string that represents the name of the IP protocol (layer 4).

Returns
"unknown" if the protocol is unknown

Here is the caller graph for this function: