2.5. nDPI API¶
The nDPI API exposes functions for dealing with nDPI protocols and categories.
Functions
-
function
getnDPIProtoName
(int proto)¶ Convert a nDPI protocol id to a protocol name.
- Return
- the protocol name on success, nil otherwise.
- Parameters
proto
: the protocol id to convert
-
function
getnDPIProtoId
(string proto)¶ Convert a protocol name to the corresponding nDPI protocol id.
- Return
- the protocol id on success, nil otherwise.
- Parameters
proto
: the protocol name to convert
-
function
getnDPICategoryId
(string category)¶ Convert a category name to the corresponding nDPI category id.
- Return
- the category id on success, nil otherwise.
- Parameters
category
: the category name to convert
-
function
getnDPICategoryName
(int category)¶ Convert a nDPI category id to a category name.
- Return
- the category name on success, nil otherwise.
- Parameters
category
: the category id to convert
-
function
getnDPIProtoBreed
(int proto)¶ Get the nDPI protocol breed associated to the protocol.
- Return
- the protocol breed string on success, nil otherwise.
- Parameters
proto
: the protocol id to query
-
function
getnDPIProtocols
(int category_filter = nil, bool skip_critical = false)¶ Get the available nDPI protocols.
- Return
- a table (proto_name -> proto_id) on success, nil otherwise.
- Parameters
category_filter
: only show protocols of this categoryskip_critical
: if true, skip protocols marked as critical for a network (e.g. DNS)
-
function
getnDPICategories
()¶ Get the available nDPI categories.
- Return
- a table (category_name -> category_id) on success, nil otherwise.