netlogtype

package
v0.0.0-...-ded95ce Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package netlogtype defines types for network logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Proto ipproto.Proto  `json:"proto,omitzero,omitempty"`
	Src   netip.AddrPort `json:"src,omitzero"`
	Dst   netip.AddrPort `json:"dst,omitzero"`
}

Connection is a 5-tuple of proto, source and destination IP and port.

func (Connection) IsZero

func (c Connection) IsZero() bool

type ConnectionCounts

type ConnectionCounts struct {
	Connection
	Counts
}

ConnectionCounts is a flattened struct of both a connection and counts.

type Counts

type Counts struct {
	TxPackets uint64 `json:"txPkts,omitzero,omitempty"`
	TxBytes   uint64 `json:"txBytes,omitzero,omitempty"`
	RxPackets uint64 `json:"rxPkts,omitzero,omitempty"`
	RxBytes   uint64 `json:"rxBytes,omitzero,omitempty"`
}

Counts are statistics about a particular connection.

func (Counts) Add

func (c1 Counts) Add(c2 Counts) Counts

Add adds the counts from both c1 and c2.

func (Counts) IsZero

func (c Counts) IsZero() bool

type Message

type Message struct {
	NodeID tailcfg.StableNodeID `json:"nodeId"` // e.g., "n123456CNTRL"

	Start time.Time `json:"start"` // inclusive
	End   time.Time `json:"end"`   // inclusive

	VirtualTraffic  []ConnectionCounts `json:"virtualTraffic,omitempty"`
	SubnetTraffic   []ConnectionCounts `json:"subnetTraffic,omitempty"`
	ExitTraffic     []ConnectionCounts `json:"exitTraffic,omitempty"`
	PhysicalTraffic []ConnectionCounts `json:"physicalTraffic,omitempty"`
}

Message is the log message that captures network traffic.

Jump to

Keyboard shortcuts

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