Class ProtocolL2

Class Documentation

class peafowl::ProtocolL2

L2 datalink protocols supported by peafowl. When adding a new protocol, please update the pfwl_l2_protocols_names array in parsing_l2.c

Public Functions

ProtocolL2(pfwl_protocol_l2_t protocol)

Copy constructor

Parameters
  • protocol: The protocol to copy.

ProtocolL2(const std::string &protocol)

Build the protocol starting from its name.

Parameters
  • protocol: The protocol name.

const std::string &getName() const

Returns the name of the protocol.

Return

The name of the protocol.

pfwl_protocol_l2_t getId() const

Returns the identifier of the protocol.

Return

The identifier of the protocol.

operator pfwl_protocol_l2_t() const

Accesses the protocol.

Friends

friend bool operator==(const ProtocolL2 &p1, const pfwl_protocol_l2_t &p2)

Checks if two protocols are equal.

Return

True if the two protocols are equal, false otherwise.

Parameters
  • p1: The first protocol.

  • p2: The second protocol.

friend bool operator!=(const ProtocolL2 &p1, const pfwl_protocol_l2_t &p2)

Checks if two protocols are different.

Return

True if the two protocols are different, false otherwise.

Parameters
  • p1: The first protocol.

  • p2: The second protocol.