Class FlowInfo

Class Documentation

class peafowl::FlowInfo

Public information about the flow.

Public Functions

FlowInfo()

Constructor.

FlowInfo(pfwl_flow_info_t info)

Copy constructor.

Parameters
  • info: The information to be copied.

uint64_t getId() const

Returns the unique identifier of the flow. If multithreaded version is used, id is per-thread unique, i.e. two different flows, managed by two different threads may have the same id. If multithreaded Peafowl is used, the unique identifier will be the pair <thread_id, id>

Return

The unique identifier of the flow.

uint16_t getThreadId() const

Returns the identifier of the thread that managed this flow.

Return

The identifier of the thread that managed this flow.

IpAddress getAddressSrc() const

Returns the source address, in network byte order.

Return

The source address, in network byte order.

IpAddress getAddressDst() const

Returns the destination address, in network byte order.

Return

The destination address, in network byte order.

uint16_t getPortSrc() const

Returns the source port, in network byte order.

Return

The source port, in network byte order.

uint16_t getPortDst() const

Returns the destination port, in network byte order.

Return

The destination port, in network byte order.

ProtocolL2 getProtocolL2() const

Returns the L2 protocol.

Return

The L2 protocol.

ProtocolL3 getProtocolL3() const

Returns the L3 protocol.

Return

The L3 protocol.

ProtocolL4 getProtocolL4() const

Returns the L4 protocol.

Return

The L4 protocol.

std::vector<ProtocolL7> getProtocolsL7() const

Some L7 protocols may be carried by other L7 protocols. For example, Ethereum may be carried by JSON-RPC, which in turn may be carried by HTTP. If such a flow is found, we will have:

protocols[0] = HTTP

protocols[1] = JSON-RPC

protocols[2] = Ethereum

i.e., protocols are shown by the outermost to the innermost. Similarly, if Ethereum is carried by plain JSON-RPC, we would have:

protocols[0] = JSON-RPC

protocols[1] = Ethereum

This encapsulation can also hold over different packets of a given flow. E.g.IMAP over SSL has a few packet exchanged with plain IMAP and then the subsequent packets encapsulated within SSL. In such a case, the first IMAP packets will only have protocols[0] = IMAP. However, when the first SSL packet for the flow is received, we will have protocols[0] = IMAP and protocols[1] = SSL for that packet and for all the subsequent packets. Indeed, it is important to remark that protocols are associated to flows and not to packets. This call returns the list of L7 protocols identified for this flow.

Return

The list of L7 protocols identified for this flow.

double getStatistic(Statistic stat, Direction dir) const

Returns a flow statistic for a specific flow direction.

Return

A flow statistic for a specific flow direction.

Parameters
  • stat: The statistic.

  • dir: The direction.

void **getUserData() const

Returns the user data associated to this flow.

Return

The user data associated to this flow.

pfwl_flow_info_t getNative() const

Returns the C flow representation.

Return

The C flow representation.

void setUserData(void *udata)

Sets some user-specific data for this flow.

Parameters
  • udata: User-specific data for this flow.