Documentation
¶
Overview ¶
Package dpi implements an interface for application layer classification via bindings to nDPI and libprotoident
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // NDPIVersion is the version of nDPI library linked against NDPIVersion = "unknown" // LibprotoidentVersion is the version of libprotoident library linked against LibprotoidentVersion = "unknown" // GoDPIVersion is the version of go-dpi wrapper used GoDPIVersion = "v1.2.3" )
These variables can be set at build time using ldflags Example: -ldflags "-X github.com/dreadl0ck/netcap/dpi.NDPIVersion=4.14.0"
Functions ¶
func Destroy ¶
func Destroy()
Destroy tears down godpi and frees the memory allocated for cgo. It also explicitly resets the internal flow tracker to release all tracked flows. Returned errors are logged to stdout.
func GetProtocols ¶
GetProtocols returns a map of all the identified protocol names to a result datastructure packets are identified with libprotoident, nDPI and a few custom heuristics from godpi. Will return nil if dpi is disabled, or if flow is not yet ready to be classified (need 10 packets).
func GetVersionInfo ¶ added in v0.7.3
func GetVersionInfo() string
GetVersionInfo returns a formatted string with DPI library versions
func HasDPISupport ¶ added in v0.7.3
func HasDPISupport() bool
HasDPISupport returns true when DPI support is compiled in
func Init ¶
func Init(modules string)
Init initializes the deep packet inspection engines. modules is a comma-separated list of modules to enable: lpi, ndpi, go If empty, all modules will be enabled.
func Reset ¶ added in v0.7.5
func Reset(modules string)
Reset destroys the current DPI state and reinitializes it. This should be called when resetting state between processing different files. It performs the following cleanup:
- Destroys all DPI modules (nDPI, LPI, go-dpi)
- Flushes and nils the FlowTrackerInstance (releases all tracked flows)
- Waits for C libraries to release memory
- Reinitializes with the same modules
Types ¶
This section is empty.