Class ProtocolL4

Class Documentation

class peafowl::ProtocolL4

L4 protocol. Values defined in include/netinet/in.h (IPPROTO_TCP, IPPROTO_UDP, IPPROTO_ICMP, etc…)

Public Functions

ProtocolL4(pfwl_protocol_l4_t protocol)

Copy constructor

Parameters
  • protocol: The protocol to copy.

ProtocolL4(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_l4_t getId() const

Returns the identifier of the protocol.

Return

The identifier of the protocol.

operator pfwl_protocol_l4_t() const

Accesses the protocol.

Friends

friend bool operator==(const ProtocolL4 &p1, const pfwl_protocol_l4_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 ProtocolL4 &p1, const pfwl_protocol_l4_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.

friend bool operator==(const ProtocolL4 &p1, const int &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 ProtocolL4 &p1, const int &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.