packetview

package
v0.16.12 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package packetview supplies bounded, scope-preserving inner datagram views. A Processor is owned by the collector's serialized admission path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accounting

func Accounting(p gopacket.Packet) (count, bytes, first, last int64)

Accounting attributes original wire packets to a completed datagram once.

func FillContext

func FillContext(dst *types.PacketContext, p gopacket.Packet)

func LogicalInterface added in v0.16.7

func LogicalInterface(ci gopacket.CaptureInfo) int

func Scope

func Scope(p gopacket.Packet) string

func ScopeFlow

func ScopeFlow(ci gopacket.CaptureInfo) gopacket.Flow

ScopeFlow supplies an opaque, direction-independent third reassembly key. Network endpoints remain unmodified for checksums and application attribution.

func ScopeHash

func ScopeHash(p gopacket.Packet) uint64

func ScopeInterface

func ScopeInterface(p gopacket.Packet, base string) string

ScopeInterface fits the existing host/detection scope schema without changing it.

func TimeUnavailable added in v0.16.7

func TimeUnavailable(ci gopacket.CaptureInfo) bool

Types

type CaptureInterface added in v0.16.7

type CaptureInterface int

CaptureInterface is an explicit logical identity; capture refs retain physical ordinals.

type Context

type Context struct {
	Scope               string
	Tunnels             []*types.Encapsulation
	Packets             []*types.CapturePacketRef
	Reassembled         bool
	CompletedAt         time.Time // admission time; CaptureInfo.Timestamp remains the earliest evidence
	Status              string
	SyntheticNetwork    bool // its original fragment headers were already audited
	LinkTransformations []*types.LinkTransformation
}

Context is immutable after dispatch and survives TCP/UDP capture-info copies.

func FromCapture

func FromCapture(ci gopacket.CaptureInfo) *Context

type Limits

type Limits struct {
	DisableIPv4Defrag                              bool
	MaxDatagrams, MaxBytes, MaxFragments, MaxDepth int
	Timeout                                        time.Duration
	Checksum                                       bool // validate original IPv4 fragment headers before reconstruction
}

func DefaultLimits

func DefaultLimits() Limits

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

func New

func New(l Limits) *Processor

func (*Processor) ExpireIdle

func (p *Processor) ExpireIdle(now time.Time)

ExpireIdle is for live-capture maintenance; offline expiry uses capture time.

func (*Processor) Process

func (p *Processor) Process(original gopacket.Packet, ordinal uint64) Result

func (*Processor) Reset

func (p *Processor) Reset()

Reset releases both pending datagrams and duplicate/rejection tombstones. Cumulative counters survive shutdown for reporting.

func (*Processor) Stats

func (p *Processor) Stats() Stats

type Result

type Result struct {
	Issues   []string
	Original gopacket.Packet
	Evidence []gopacket.Packet
	Packet   gopacket.Packet
	Opaque   gopacket.Packet // unresolved tunnel: network Connection only, never transport dispatch
	Status   string
}

Result separates original header evidence from the one datagram eligible for application dispatch. Original owns pooled memory until all views are consumed.

type Stats

type Stats struct {
	Overlaps, ConflictingOverlaps, TinyFragments, IPv4DefragDisabled                       uint64
	RejectedIPv4Checksums                                                                  uint64
	Completed, Duplicates, Rejected, Expired, Incomplete, Limited, Malformed, DepthLimited uint64
	Datagrams, BufferedBytes                                                               int
}

type TimestampMissing added in v0.16.7

type TimestampMissing bool

Directories

Path Synopsis
Package testutil builds deterministic, fictional packet-pipeline fixtures.
Package testutil builds deterministic, fictional packet-pipeline fixtures.

Jump to

Keyboard shortcuts

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