Documentation
¶
Overview ¶
Package dpi implements an interface for application layer classification via bindings to nDPI and libprotoident
Index ¶
- Variables
- func Destroy()
- func GetModuleProtocols() map[string][]string
- func GetProtocols(packet gopacket.Packet) map[string]ClassificationResult
- func GetVersionInfo() string
- func HasDPISupport() bool
- func Init(modules string)
- func InitWithConfig(modules string, config RuntimeConfig)
- func IsEnabled() bool
- func NewProto(res *ClassificationResult) *types.Protocol
- func Reset(modules string)
- type RuntimeConfig
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.5.0" )
These variables can be set at build time using ldflags Example: -ldflags "-X github.com/dreadl0ck/netcap/internal/dpi.NDPIVersion=4.14.0"
Functions ¶
func Destroy ¶
func Destroy()
Destroy releases native contexts and all tracked flow state. Concurrent calls are safe; already disabled engines are left untouched.
func GetModuleProtocols ¶
GetModuleProtocols returns a map of module names to their supported protocols using the new GetSupportedProtocols APIs introduced in go-dpi v1.3.0
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. Native engines keep incremental state until detection or the inspection budget.
func GetVersionInfo ¶
func GetVersionInfo() string
GetVersionInfo returns a formatted string with DPI library versions
func HasDPISupport ¶
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. This function is thread-safe and will only execute once if called concurrently.
func InitWithConfig ¶
func InitWithConfig(modules string, config RuntimeConfig)