netlogtype
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package netlogtype defines types for network logging.
Index¶
Constants¶
const (// MaxMessageJSONSize is the overhead size of Message when it is// serialized as JSON assuming that each traffic map is populated.MaxMessageJSONSize =len(messageJSON)// MaxConnectionCountsJSONSize is the maximum size of a ConnectionCounts// when it is serialized as JSON, assuming no superfluous whitespace.// It does not include the trailing comma that often appears when// this object is nested within an array.// It assumes that netip.Addr never has IPv6 zones.MaxConnectionCountsJSONSize =len(maxJSONConnCounts)// MaxConnectionCountsCBORSize is the maximum size of a ConnectionCounts// when it is serialized as CBOR.// It assumes that netip.Addr never has IPv6 zones.MaxConnectionCountsCBORSize =len(maxCBORConnCounts))
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeConnection¶
type Connection struct {Protoipproto.Proto `json:"proto,omitzero,omitempty" cbor:"0,keyasint,omitempty"`Srcnetip.AddrPort `json:"src,omitzero,omitempty" cbor:"1,keyasint,omitempty"`Dstnetip.AddrPort `json:"dst,omitzero,omitempty" cbor:"2,keyasint,omitempty"`}
Connection is a 5-tuple of proto, source and destination IP and port.
func (Connection)IsZero¶
func (cConnection) IsZero()bool
typeConnectionCounts¶
type ConnectionCounts struct {ConnectionCounts}
ConnectionCounts is a flattened struct of both a connection and counts.
typeCounts¶
type Counts struct {TxPacketsuint64 `json:"txPkts,omitzero,omitempty" cbor:"12,keyasint,omitempty"`TxBytesuint64 `json:"txBytes,omitzero,omitempty" cbor:"13,keyasint,omitempty"`RxPacketsuint64 `json:"rxPkts,omitzero,omitempty" cbor:"14,keyasint,omitempty"`RxBytesuint64 `json:"rxBytes,omitzero,omitempty" cbor:"15,keyasint,omitempty"`}
Counts are statistics about a particular connection.
typeMessage¶
type Message struct {NodeIDtailcfg.StableNodeID `json:"nodeId" cbor:"0,keyasint"`// e.g., "n123456CNTRL"Starttime.Time `json:"start" cbor:"12,keyasint"`// inclusiveEndtime.Time `json:"end" cbor:"13,keyasint"`// inclusiveVirtualTraffic []ConnectionCounts `json:"virtualTraffic,omitempty" cbor:"14,keyasint,omitempty"`SubnetTraffic []ConnectionCounts `json:"subnetTraffic,omitempty" cbor:"15,keyasint,omitempty"`ExitTraffic []ConnectionCounts `json:"exitTraffic,omitempty" cbor:"16,keyasint,omitempty"`PhysicalTraffic []ConnectionCounts `json:"physicalTraffic,omitempty" cbor:"17,keyasint,omitempty"`}
Message is the log message that captures network traffic.