2.3. Misc API¶
Miscellaneous interface functions.
Functions
-
function
setActiveInterfaceId
(int id)¶ Set the active interface by using the interface id.
- Return
- the interface name on success, nil otherwise.
- Parameters
id
: the interface id.
-
function
getIfNames
()¶ Get the available ntopng network interfaces.
- Return
- a table containing (ifid -> ifname) mappings.
-
function
select
(string ifname)¶ Set the active interface by using the interface name.
- Parameters
ifname
: the interface name.
-
function
getMaxIfSpeed
(string ifname)¶ Get the interface maximum speed.
- Return
- the interface maximum speed on success, nil otherwise.
- Parameters
ifname
: the interface name.
-
function
resetCounters
(bool only_drops = true)¶ Reset interface packet counters.
- Parameters
only_drops
: if true, only reset the packet drops counter
-
function
getEndpoint
()¶ Get the name of the remote probe when connected via ZMQ.
- Return
- endpoint name on success, nil otherwise.
-
function
isPacketInterface
()¶ Check if the interface captures raw packets.
- Return
- true if the interface is a packet interface, false otherwise.
- Note
- ZMQ interfaces, for example, are not packet interfaces but flow interfaces.
-
function
isDiscoverableInterface
()¶ Check if the network interface can be used to perform network discovery.
- Return
- true if the interface is discoverable, false otherwise.
-
function
isPcapDumpInterface
()¶ Check if the network interface is a PcapInterface.
- Return
- true if the interface is a PcapInterface, false otherwise.
-
function
isRunning
()¶ Check if the network interface has started capturing packets.
- Return
- true if the interface is running, false otherwise.
-
function
isIdle
()¶ Check if the network interface has been temporary paused.
- Return
- true if the interface is paused, false otherwise.
-
function
setInterfaceIdleState
(bool state)¶ Temporary pause or unpause a network interface.
- Parameters
state
: if true, the interface will be paused, otherwise resumed.
-
function
getStats
()¶ Get many information about the interface traffic and status.
- Return
- table with interface stats success, nil otherwise.
-
function
getNetworksStats
()¶ Get local network stats.
- Return
- table (network_name -> network_stats) on success, nil otherwise.
-
function
getASesInfo
(table pag_options = nil)¶ Get active autonomous systems information.
- Return
- table (numASes, ASes) on success, nil otherwise.
- Parameters
pag_options
: options for the paginator.
-
function
getASInfo
(int asn)¶ Get information about a specifc Autonomous System.
- Return
- AS information on success, nil otherwise.
- Parameters
asn
: the AS number.
-
function
getCountriesInfo
(table pag_options = nil)¶ Get active countries information.
- Return
- table (numCountries, Countries) on success, nil otherwise.
- Parameters
pag_options
: options for the paginator.
-
function
getVLANsList
()¶ Get active VLAN information.
- Return
- table (numVLANs, VLANs) on success, nil otherwise.
-
function
getVLANInfo
(int vlan_id)¶ Get a specific VLAN information. @oaram vlan_id the VLAN id to query.
- Return
- VLAN information on success, nil otherwise.
-
function
reloadHostPools
()¶ Reload Host Pool membership information after changes from Lua.
-
function
getHostPoolsInfo
()¶ Get host pools information, like the number of members in the pool.
- Return
- host pools information on success, nil otherwise.
-
function
getSFlowDevices
()¶ Returns a list of active sFlow devices.
- Return
- table (device_ip -> device_ip_numeric) on success, nil otherwise.
-
function
getSFlowDeviceInfo
(string device_ip)¶ Returns information about a specific sFlow device interfaces.
- Return
- table (if_idx -> if_information) on success, nil otherwise.
- Parameters
device_ip
: the sFlow device IP.
-
function
captureToPcap
(int duration, string bpf_filter)¶ Captures a ‘duration’ long pcap file. The capture is performed in background.
- Return
- The path of the pcap file, nil otherwise.
- Parameters
duration
: The pcap duration (in seconds)bpf_filter
: An optional BPF filtering expression
-
function
isCaptureRunning
()¶ Checks if there is a pending captureToPcap() in progress.
- Return
- True is there is an ongoing capture, false otherwise.
-
function
stopRunningCapture
()¶ Stops a running capture.