flow

package
v0.0.0-...-a8fe691 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counters

type Counters struct {
	Bytes   uint64
	Packets uint64
}

Counters contains flow counters

type Flow

type Flow struct {
	Meta        Meta      // Flow Src/Dst & Protocol Information
	Incoming    Counters  // Incoming counters
	Outgoing    Counters  // Outgoing counters
	CommunityID string    // CommunityID
	Start       time.Time // Start time
	End         time.Time // Stop time
}

Flow contains flow data

func New

func New(fm Meta) *Flow

New creates a new Flow

type Meta

type Meta struct {
	Transport protos.ProtocolType
	Src       net.IP
	Dst       net.IP
	IcmpType  uint16
	IcmpCode  uint16
	DstPort   uint16
	SrcPort   uint16
}

Meta contains flow metadata

func (Meta) WithCorrectedSource

func (m Meta) WithCorrectedSource() Meta

WithCorrectedSource is a super simple helper function for determin which one is the source IP and updates the values inside accordingly

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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