classifiers

package
v0.0.0-...-6cae302 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package classifiers contains the custom classifiers for each protocol and the helpers for applying them on a flow.

Index

Constants

View Source
const GoDPIName = types.ClassificationSource("go-dpi")

GoDPIName is the name of the library, to be used as an identifier for the source of a classification.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassifierModule

type ClassifierModule struct {
	// contains filtered or unexported fields
}

ClassifierModule is the module that contains the custom go-dpi flow classifiers.

func NewClassifierModule

func NewClassifierModule() *ClassifierModule

NewClassifierModule returns a new ClassifierModule with the default configuration. By default, all classifiers are active.

func (*ClassifierModule) ClassifyFlow

func (module *ClassifierModule) ClassifyFlow(flow *types.Flow) (result types.ClassificationResult)

ClassifyFlow applies all the classifiers to a flow and returns the protocol that is detected by a classifier if there is one. Otherwise the returned protocol is Unknown.

func (*ClassifierModule) ClassifyFlowAll

func (module *ClassifierModule) ClassifyFlowAll(flow *types.Flow) (results []types.ClassificationResult)

ClassifyFlowAll applies all the classifiers to a flow and returns the all the protocols detected by any of the classifiers.

func (*ClassifierModule) ConfigureModule

func (module *ClassifierModule) ConfigureModule(config ClassifierModuleConfig)

ConfigureModule configures this module instance with the given configuration. This should called before the module instance is initialized, otherwise Destroy and Initialize should be called on the module manually.

func (*ClassifierModule) Destroy

func (module *ClassifierModule) Destroy() error

Destroy destroys the module instance.

func (*ClassifierModule) Initialize

func (module *ClassifierModule) Initialize() error

Initialize initializes the module instance.

type ClassifierModuleConfig

type ClassifierModuleConfig struct {
	Classifiers []GenericClassifier
}

ClassifierModuleConfig is given to the module's ConfigureModule method, in order to set which classifiers are active and their order.

type DNSClassifier

type DNSClassifier struct{}

DNSClassifier struct

func (DNSClassifier) GetProtocol

func (classifier DNSClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (DNSClassifier) HeuristicClassify

func (classifier DNSClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for DNSClassifier

type FTPClassifier

type FTPClassifier struct{}

FTPClassifier struct

func (FTPClassifier) GetProtocol

func (classifier FTPClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (FTPClassifier) HeuristicClassify

func (classifier FTPClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for FTPClassifier

type GenericClassifier

type GenericClassifier interface {
	// GetProtocol returns the protocol this classifier can detect.
	GetProtocol() types.Protocol
}

GenericClassifier is implemented by every classifier. It contains a method that returns the classifier's detected protocol.

type HTTPClassifier

type HTTPClassifier struct{}

HTTPClassifier struct

func (HTTPClassifier) GetProtocol

func (classifier HTTPClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (HTTPClassifier) HeuristicClassify

func (classifier HTTPClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for HTTPClassifier

type HeuristicClassifier

type HeuristicClassifier interface {
	// HeuristicClassify returns whether this classifier can identify the flow
	// using heuristics.
	HeuristicClassify(*types.Flow) bool
}

HeuristicClassifier is implemented by the classifiers that have heuristic methods to detect a protocol.

type ICMPClassifier

type ICMPClassifier struct{}

ICMPClassifier struct

func (ICMPClassifier) GetProtocol

func (classifier ICMPClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (ICMPClassifier) HeuristicClassify

func (classifier ICMPClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for ICMPClassifier

type JABBERClassifier

type JABBERClassifier struct{}

JABBERClassifier struct

func (JABBERClassifier) GetProtocol

func (classifier JABBERClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (JABBERClassifier) HeuristicClassify

func (classifier JABBERClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for JABBERClassifier

type MQTTClassifier

type MQTTClassifier struct{}

MQTTClassifier struct

func (MQTTClassifier) GetProtocol

func (classifier MQTTClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (MQTTClassifier) HeuristicClassify

func (classifier MQTTClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for MQTTClassifier

type NetBIOSClassifier

type NetBIOSClassifier struct{}

NetBIOSClassifier struct

func (NetBIOSClassifier) GetProtocol

func (classifier NetBIOSClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (NetBIOSClassifier) HeuristicClassify

func (classifier NetBIOSClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for NetBIOSClassifier

type RDPClassifier

type RDPClassifier struct{}

RDPClassifier struct

func (RDPClassifier) GetProtocol

func (classifier RDPClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (RDPClassifier) HeuristicClassify

func (classifier RDPClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for RDPClassifier

type RPCClassifier

type RPCClassifier struct{}

RPCClassifier struct

func (RPCClassifier) GetProtocol

func (classifier RPCClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (RPCClassifier) HeuristicClassify

func (classifier RPCClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for RPCClassifier

type SMBClassifier

type SMBClassifier struct{}

SMBClassifier struct

func (SMBClassifier) GetProtocol

func (classifier SMBClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (SMBClassifier) HeuristicClassify

func (classifier SMBClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for SMBClassifier

type SMTPClassifier

type SMTPClassifier struct{}

SMTPClassifier struct

func (SMTPClassifier) GetProtocol

func (classifier SMTPClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (SMTPClassifier) HeuristicClassify

func (classifier SMTPClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for SMTPClassifier

type SSHClassifier

type SSHClassifier struct{}

SSHClassifier struct

func (SSHClassifier) GetProtocol

func (classifier SSHClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (SSHClassifier) HeuristicClassify

func (classifier SSHClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for SSHClassifier

type SSLClassifier

type SSLClassifier struct{}

SSLClassifier struct

func (SSLClassifier) GetProtocol

func (classifier SSLClassifier) GetProtocol() types.Protocol

GetProtocol returns the corresponding protocol

func (SSLClassifier) HeuristicClassify

func (classifier SSLClassifier) HeuristicClassify(flow *types.Flow) bool

HeuristicClassify for SSLClassifier

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL