Movatterモバイル変換


[0]ホーム

URL:


netlogtype

package
v1.84.3Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License:BSD-3-ClauseImports:4Imported by:21

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package netlogtype defines types for network logging.

Index

Constants

View Source
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.

func (Counts)Add

func (c1Counts) Add(c2Counts)Counts

Add adds the counts from both c1 and c2.

func (Counts)IsZero

func (cCounts) IsZero()bool

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.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp