Skip to content
Nikos Filippakis edited this page Aug 17, 2017 · 6 revisions

go-dpi comprises of the main godpi API interface, as well as the classification modules, which live in their own directories. The types package contains the basic types defined by go-dpi, while the utils package contains some useful utility functions for the library. There also exists an example app in the godpi_example directory, which is described below.

The types package contains the Protocol type, which is simply a string and is used to specify the protocol that was detected for a flow, and is the type that is returned by all the classifiers available. There are Protocol constants for each supported protocol, and the Unknown constant which signifies that a flow has not been classified.
The other important type is Flow, which contains a list of packets. There is also a field that contains the detected protocol of that flow, which is set once a detection is made, and a field that contains the source of that detection, meaning the module that made it. Flows are automatically tracked by the library, with the use of the types.GetFlowForPacket method, which keeps track of which packets belong in which flows.

The modules package contains the 3 available modules, classifiers, wrappers and ml. You may read more about them in Modules.

Clone this wiki locally