Version: v0.7.1 Latest Latest

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 5 Imported by: 0




View Source
const (
	// FlowUnknown are unknown flow.
	FlowUnknown FlowDirection = 1 << iota
	// FlowActive are 'active open'.
	// FlowPassive are 'passive open'

	// FilterAll is the filter condition including public and private IP address.
	FilterAll = "all"
	// FilterPublic is the filter condition including public IP address.
	FilterPublic = "public"
	// FilterPrivate is the filter condition including private IP address.
	FilterPrivate = "private"


This section is empty.


This section is empty.


type AddrPort

type AddrPort struct {
	Name string `json:"name"`
	Addr string `json:"addr"`
	Port string `json:"port"`

AddrPort are <addr>:<port>

func (*AddrPort) PortInt

func (a *AddrPort) PortInt() int

PortInt returnts integer representation.

func (*AddrPort) String

func (a *AddrPort) String() string

String returns the string representation of the AddrPort.

type FlowDirection

type FlowDirection int

FlowDirection are bitmask that represents both Active or Passive.

func (FlowDirection) MarshalJSON

func (c FlowDirection) MarshalJSON() ([]byte, error)

MarshalJSON returns human readable `mode` format.

func (FlowDirection) String

func (c FlowDirection) String() string

String returns string representation.

type HostFlow

type HostFlow struct {
	Direction   FlowDirection `json:"direction"`
	Local       *AddrPort     `json:"local"`
	Peer        *AddrPort     `json:"peer"`
	Connections int64         `json:"connections"`
	Process     *Process      `json:"process,omitempty"`

HostFlow represents a `host flow`.

func (*HostFlow) SetLookupedName

func (f *HostFlow) SetLookupedName()

SetLookupedName replaces f.Addr into lookuped name.

func (*HostFlow) String

func (f *HostFlow) String() string

String returns the string representation of HostFlow.

func (*HostFlow) UniqKey

func (f *HostFlow) UniqKey() string

UniqKey returns the unique identifier key for connections flow.

type HostFlows

type HostFlows map[string]*HostFlow

HostFlows represents a group of host flow by unique key.

func (HostFlows) Insert

func (hf HostFlows) Insert(flow *HostFlow)

Insert inserts a flow into the HostFlows.

func (HostFlows) MarshalJSON

func (hf HostFlows) MarshalJSON() ([]byte, error)

MarshalJSON converts map into list.

type Process

type Process struct {
	Name string `json:"name"`
	Pgid int    `json:"pgid"`

Process represents a OS process.

Source Files


Path Synopsis

Jump to

Keyboard shortcuts

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