|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
21 #include <boost/algorithm/string.hpp>
28 : enum_base<rc_t>(v, s)
33 rc_t::from_vpp_retval(int32_t
rv)
47 return (rc_t::INVALID);
51 const rc_t rc_t::NOOP(1,
"no-op");
52 const rc_t rc_t::OK(2,
"ok");
53 const rc_t rc_t::INVALID(3,
"invalid");
56 const handle_t handle_t::INVALID(~0);
71 return (std::to_string(m_value));
77 return (m_value == other.m_value);
83 return (!(*
this == other));
89 return (m_value < other.m_value);
114 std::copy(
b,
b + 6, std::begin(
bytes));
119 std::copy(
i.begin(),
i.end(), std::begin(
bytes));
124 std::vector<std::string> parts;
126 boost::split(parts, str, boost::is_any_of(
":"));
130 for (uint32_t ii = 0; ii <
n_bytes; ii++) {
131 bytes[ii] = std::stoul(parts[ii],
nullptr, 16);
142 for (
int i = 0;
i < 6 &&
i <
len;
i++) {
150 std::ostringstream s;
155 for (
auto byte :
bytes) {
160 s << std::setw(2) << static_cast<unsigned int>(
byte);
180 os <<
mac.to_string();
220 std::copy_n(
bytes.begin(),
mac.bytes.size(),
mac.bytes.begin());
228 std::ostringstream s;
233 for (
auto byte :
bytes) {
238 s << std::setw(2) << static_cast<unsigned int>(
byte);
302 if (0x0806 == numeric) {
305 if (0x8906 == numeric) {
308 if (0x0800 == numeric) {
311 if (0x86DD == numeric) {
314 if (0x88E5 == numeric) {
317 if (0x8847 == numeric) {
320 if (0x22F3 == numeric) {
330 os <<
"[packets: " <<
c.packets <<
" bytes:" <<
c.bytes <<
"]";
const static ethertype_t MPLS_UNICAST
Ethertype MPLS unicast.
const static l2_address_t ZERO
An all 0's L2 address.
mac_address_t to_mac() const
MAC address conversion.
The VPP Object Model (VOM) library.
const static mac_address_t ZERO
An all 0's MAC address.
bool operator<(const mac_address_t &m) const
less than operator
std::vector< uint8_t > bytes
Underlying bytes array - filled from least to most significant.
void to_bytes(uint8_t *array, uint8_t len) const
Convert to byte array.
void reset()
reset the value of the handle to ~0
uint32_t value() const
get the value of the handle
ethertype_t(int v, const std::string s)
Constructor.
static heap_elt_t * first(heap_header_t *h)
const static ethertype_t UNSPECIFIED
Ethertype Unspecified.
bool operator==(const handle_t &other) const
Comparison operator.
bool operator==(const mac_address_t &m) const
Comparison operator.
static const ethertype_t & from_numeric_val(uint16_t numeric)
Get the ethertype from the numeric value.
bool operator<(const handle_t &other) const
less than operator
const static ethertype_t IPV6
Ethertype Ipv6.
f64 end
end of the time range
void to_bytes(uint8_t *array, uint8_t len) const
Convert to byte array.
A template base class for all enum types.
const static direction_t OUTPUT
Deny Direction.
std::string to_string() const
String conversion.
const static ethertype_t IPV4
Ethertype IPv4.
sll srl srl sll sra u16x4 i
const static direction_t INPUT
Permit Direction.
A type declaration of an interface handle in VPP.
bool operator!=(const l2_address_t &m) const
Comparison operator.
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
const static ethertype_t FCOE
Ethertype FCoE.
const static mac_address_t ONE
An all 1's MAC address.
mac_address_t(const uint8_t bytes[6])
const static l2_address_t ONE
An all 1's L2 address.
const std::string & to_string() const
convert to string format for debug purposes
l2_address_t(const uint8_t bytes[8], uint8_t n_bytes)
Type def of a L2 address as read from VPP.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
String conversion.
Type def of a Ethernet address.
bool operator==(const l2_address_t &m) const
Comparison operator.
const static ethertype_t ARP
Ethertype Arp.
Error codes that VPP will return during a HW write.
bool operator!=(const handle_t &other) const
Comparison operator.
const static ethertype_t TRILL
Ethertype TRILL.
direction_t(int v, const std::string s)
Constructor.
std::array< uint8_t, 6 > bytes
Underlying bytes array.
const static ethertype_t MAC_SECURITY
Ethertype MAC Security.