2.2. Flows API

The Flows API exposes functions to query and manage active ntopng flows.

Functions

function getFlowsInfo(string host_ip = nil, table pag_options = nil)

Get active flows information.

Return

table (num_flows, flows) on success, nil otherwise.

Parameters
  • host_ip: filter by host/host@vlan.

  • pag_options: options for the paginator.

function getFlowsStatus()

Get active flows status statistics.

Return

a table (status -> num_flows) for every status (RST, SYN, Established, FIN) on success, nil otherwise.

function getGroupedFlows(string group_col, table pag_options = nil)

Group active flows by a specified criteria.

Return

table with grouped flows information on success, nil otherwise.

Parameters
  • group_col: the grouping column

  • pag_options: options for the paginator.

function getFlowsStats()

Get active flows nDPI bytes count.

Return

table (num_flows, protos, breeds) which map (protocol_name->bytes_count) on success, nil otherwise.

function getnDPIFlowsCount()

Get the number of active flows by nDPI protocol.

Return

a table (protocol_name -> num_flows) on success, nil otherwise.

function getFlowKey(string cli_ip, int cli_vlan, string srv_ip, int srv_vlan, int l4_proto)

Computes the unique flow identifier.

Return

the numeric flow key on success, nil otherwise.

Parameters
  • cli_ip: host/host@vlan.

  • cli_vlan: specify the cli_ip vlan separately.

  • srv_ip: host/host@vlan.

  • srv_vlan: specify the srv_ip vlan separately.

  • l4_proto: l4 protocol id

function findFlowByKey(int key)

Returns a single active flow information.

Return

the flow information on success, nil otherwise.

Parameters
  • key: the flow key.

function dropFlowTraffic(int key)

Drops an active flow traffic.

Note

this is only effective when running in inline mode.

Parameters
  • key: the flow key.