types

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 18 Imported by: 7

Documentation

Overview

Package types Contains the type definitions for the supported network protocols

Index

Constants

This section is empty.

Variables

View Source
var (
	// StructureBegin marks the beginning of a structure in CSV.
	StructureBegin = ""

	// StructureEnd marks the end of a structure in CSV.
	StructureEnd = ""

	// FieldSeparator separates fields within a structure in CSV.
	FieldSeparator = ","
)
View Source
var Metrics = []prometheus.Collector{
	sipMetric,
	enipMetric,
	credentialsMetric,
	llcMetric,
	ipSecEspMetric,
	tlsClientMetric,
	dnsMetric,
	ethernetCTPMetric,
	ethernetMetric,
	ethernetPayloadEntropy,
	ethernetPayloadSize,
	dhcp4Metric,
	serviceMetric,
	icmp6raMetric,
	eapMetric,
	ipv6fragMetric,
	icmp6Metric,
	tlsServerMetric,
	ntpMetric,
	sctpMetric,
	ciscoDiscoveryMetric,
	usbRequestBlockSetupMetric,
	mplsMetric,
	icmp6rsMetric,
	snapMetric,
	eapPolKeyMetric,
	geneveMetric,
	ipSecAhMetric,
	ip4Metric,
	ip4PayloadEntropy,
	ip4PayloadSize,
	vrrp2Metric,
	ethernetCTPReplyMetric,
	igmpMetric,
	greMetric,
	ip6hopMetric,
	vxlanMetric,
	modbusTCPMetric,
	smtpMetric,
	ciscoDiscoveryInfoMetric,
	arpMetric,
	httpMetric,
	lldiMetric,
	ip6Metric,
	ip6PayloadEntropy,
	ip6PayloadSize,
	fileMetric,
	udpMetric,
	udpPayloadEntropy,
	udpPayloadSize,
	cipMetric,
	lcmMetric,
	pop3Metric,
	connectionsMetric,
	connTotalSize,
	connAppPayloadSize,
	connNumPackets,
	connDuration,
	dot11Metric,
	tcpMetric,
	tcpPayloadEntropy,
	tcpPayloadSize,
	icmp6nsMetric,
	softwareMetric,
	fddiMetric,
	eapPolMetric,
	diameterMetric,
	dot1qMetric,
	ospf3Metric,
	exploitMetric,
	nortelDiscoveryMetric,
	vulnerabilityMetric,
	usbMetric,
	ospf2Metric,
	icmp4Metric,
	sshMetric,
	icmp6eMetric,
	icmp6naMetric,
	lldMetric,
	dhcp6Metric,
	bfdMetric,
}

Metrics contains all available prometheus collectors.

View Source
var (

	// UTC allows to print timestamp in the utc format.
	UTC bool
)

Functions

func Select

func Select(msg proto.Message, vals string)

Select takes a proto.Message and sets the selection on the package level.

Types

type AuditRecord added in v0.4.0

type AuditRecord interface {

	// CSVRecord returns CSV values
	CSVRecord() []string

	// CSVHeader returns CSV header fields
	CSVHeader() []string

	// Time used to retrieve the timestamp of the audit record for labeling
	Time() int64

	// Src returns the source of an audit record
	// for Layer 2 records this shall be the MAC address
	// for Layer 3+ records this shall be the IP address
	Src() string

	// Dst returns the source of an audit record
	// for Layer 2 records this shall be the MAC address
	// for Layer 3+ records this shall be the IP address
	Dst() string

	// Inc increments the metric for the audit record
	Inc()

	// JSON returns the audit record as JSON
	JSON() (string, error)

	// SetPacketContext can be implemented to set additional information for each audit record
	// important:
	//  - MUST be implemented on a pointer of an instance
	//  - the passed in packet context MUST be set on the Context field of the current audit record
	SetPacketContext(ctx *PacketContext)

	// Encode this audit record into numerical data for processing by machine learning algorithms,
	// and return the result as CSV.
	Encode() []string

	// Analyze will feed this audit record to an analyzer.
	// This could either be a static rule based analyzer, or one that is based on a more complex Anomaly Detector (statistical or ML).
	// TODO: define AnomalyDetector interface
	Analyze()

	// NetcapType returns the audit record type
	NetcapType() Type
}

AuditRecord is the interface for basic operations with NETCAP audit records this includes dumping as CSV or JSON or prometheus metrics and provides access to the timestamp of the audit record.

Jump to

Keyboard shortcuts

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