Documentation
¶
Index ¶
- Constants
- Variables
- type Capture
- func (c *Capture) Checkpoint(admitted, drops uint64) error
- func (c *Capture) Close(status string, admitted, drops uint64, captureError error) error
- func (c *Capture) Kernel(received, dropped *uint64, statsError string)
- func (c *Capture) MarkAuditOutputReady() (resultErr error)
- func (c *Capture) Observe(data []byte, ci gopacket.CaptureInfo, linkType layers.LinkType) error
- func (c *Capture) ObserveScope(cid string, iface int, vlans []uint16)
- func (c *Capture) RunID() string
- type CaptureConfig
- type CaptureInspection
- type CaptureManifest
- type CaptureSegment
- type CommunityScope
- type FlowScope
- type Interface
- type PacketManifest
- func ArchiveToFile(ctx context.Context, input, target string, selection Selection) (PacketManifest, error)
- func ExportPackets(ctx context.Context, input string, output io.Writer, selection Selection) (PacketManifest, error)
- func WriteArchive(ctx context.Context, input string, output io.Writer, selection Selection) (PacketManifest, error)
- type PacketSpan
- type ProducerIdentity
- type ScopeLedger
- type Selection
Constants ¶
const AuditReadyFile = "audit-output-ready.json"
const MaxCommunityScopes = 32768
Variables ¶
var ErrNoMatchingPackets = errors.New("no packets matched the requested selection")
Functions ¶
This section is empty.
Types ¶
type Capture ¶
type Capture struct {
// contains filtered or unexported fields
}
func NewCapture ¶
func (*Capture) Checkpoint ¶
func (*Capture) MarkAuditOutputReady ¶
MarkAuditOutputReady is called only after stream finalization and writer teardown.
func (*Capture) ObserveScope ¶
ObserveScope runs at serialized packet ingress, before worker ownership. A Community ID observed in multiple scopes never becomes unambiguous again.
type CaptureConfig ¶
type CaptureConfig struct {
Source string `json:"source"`
Kind string `json:"kind"`
BPF string `json:"bpf"`
SnapLen int `json:"snapLen"`
Workers int `json:"workers"`
IncludeDecoders string `json:"includeDecoders"`
ExcludeDecoders string `json:"excludeDecoders"`
Reassembly bool `json:"reassembly"`
RetainPackets bool `json:"retainPackets"`
SegmentBytes int64 `json:"segmentBytes,string"`
RetentionBytes int64 `json:"retentionBytes,string"`
MaxRetainedTCPBytes int64 `json:"maxRetainedTCPBytes,omitempty,string"`
MaxRetainedReassemblyBytes int64 `json:"maxRetainedReassemblyBytes,omitempty,string"`
IncrementalHTTP bool `json:"incrementalHTTP,omitempty"`
MaxRetainedTCPStateBytes int64 `json:"maxRetainedTCPStateBytes,omitempty,string"`
CaptureTimeIdleExpiry bool `json:"captureTimeIdleExpiry,omitempty"`
}
type CaptureInspection ¶ added in v0.16.0
type CaptureInspection struct {
Version int `json:"version"`
SourceSHA256 string `json:"sourceSHA256"`
SourceBytes string `json:"sourceBytes"`
Format string `json:"format"`
Compression string `json:"compression"`
Packets uint64 `json:"packets,string"`
CapturedBytes uint64 `json:"capturedBytes,string"`
WireBytes uint64 `json:"wireBytes,string"`
TruncatedPackets uint64 `json:"truncatedPackets,string"`
FirstNs string `json:"firstNs,omitempty"`
LastNs string `json:"lastNs,omitempty"`
OutOfOrder bool `json:"outOfOrder"`
Interfaces []Interface `json:"interfaces"`
Limitations []string `json:"limitations"`
}
func InspectCapture ¶ added in v0.16.0
type CaptureManifest ¶
type CaptureManifest struct {
Producer *ProducerIdentity `json:"producer,omitempty"`
CommunityScopes *ScopeLedger `json:"communityScopes,omitempty"`
Version int `json:"version"`
RunID string `json:"runId"`
CreatedAt string `json:"createdAt"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
Config CaptureConfig `json:"config"`
ConfigSHA256 string `json:"configSHA256"`
InputSHA256 string `json:"inputSHA256,omitempty"`
IngressPackets uint64 `json:"ingressPackets"`
AdmittedPackets uint64 `json:"admittedPackets"`
QueueDrops uint64 `json:"queueDrops"`
CapturedBytes uint64 `json:"capturedBytes,string"`
WireBytes uint64 `json:"wireBytes,string"`
TruncatedPackets uint64 `json:"truncatedPackets"`
FirstNs *int64 `json:"firstNs,omitempty,string"`
LastNs *int64 `json:"lastNs,omitempty,string"`
KernelReceived *uint64 `json:"kernelReceived"`
KernelDrops *uint64 `json:"kernelDrops"`
KernelStatsError string `json:"kernelStatsError,omitempty"`
Segments []CaptureSegment `json:"segments"`
Limitations []string `json:"limitations"`
}
type CaptureSegment ¶
type CaptureSegment struct {
Name string `json:"name"`
Bytes int64 `json:"bytes,string"`
Packets uint64 `json:"packets"`
FirstOrdinal uint64 `json:"firstOrdinal"`
LastOrdinal uint64 `json:"lastOrdinal"`
FirstNs string `json:"firstNs"`
LastNs string `json:"lastNs"`
SHA256 string `json:"sha256"`
State string `json:"state"`
}
type CommunityScope ¶
type FlowScope ¶
type FlowScope struct {
Sensor string `json:"sensor"`
InterfaceIndex int `json:"interfaceIndex"`
VLANs []uint16 `json:"vlans"`
}
FlowScope is packet-derived scope within this capture's RunID namespace.
type Interface ¶
type Interface struct {
Section int `json:"section"`
SourceIndex int `json:"sourceIndex"`
OutputIndex int `json:"outputIndex"`
Metadata pcapgo.NgInterface `json:"metadata"`
}
type PacketManifest ¶
type PacketManifest struct {
Version int `json:"version"`
SourceSHA256 string `json:"sourceSHA256"`
OutputSHA256 string `json:"outputSHA256"`
OutputFormat string `json:"outputFormat"`
Selection Selection `json:"selection"`
SourcePackets uint64 `json:"sourcePackets"`
Selected uint64 `json:"selectedPackets"`
PacketSpans []PacketSpan `json:"sourcePacketSpans"`
Interfaces []Interface `json:"interfaces"`
Limitations []string `json:"limitations"`
SourceTruncatedPackets uint64 `json:"sourceTruncatedPackets"`
SelectedTruncatedPackets uint64 `json:"selectedTruncatedPackets"`
MaxCapturedPacketBytes int `json:"maxCapturedPacketBytes"`
MaxCaptureBlockBytes int `json:"maxCaptureBlockBytes"`
}
func ArchiveToFile ¶
func ArchiveToFile(ctx context.Context, input, target string, selection Selection) (PacketManifest, error)
ArchiveToFile atomically publishes a complete archive without replacing existing work.
func ExportPackets ¶
func ExportPackets(ctx context.Context, input string, output io.Writer, selection Selection) (PacketManifest, error)
ExportPackets writes a PCAPNG derivative and hashes the actual input/output bytes. Callers must discard output on any error; no partial export is evidence-qualified.
func WriteArchive ¶
type PacketSpan ¶
type ProducerIdentity ¶ added in v0.16.0
type ProducerIdentity struct {
Version string `json:"version"`
Commit string `json:"commit"`
GoVersion string `json:"goVersion"`
Platform string `json:"platform"`
ExecutableModule string `json:"executableModule,omitempty"`
ExecutableRevision string `json:"executableRevision,omitempty"`
ExecutableModified *bool `json:"executableModified,omitempty"`
CoreModuleVersion string `json:"coreModuleVersion,omitempty"`
CoreModuleReplaced bool `json:"coreModuleReplaced,omitempty"`
}
func CurrentProducerIdentity ¶ added in v0.16.0
func CurrentProducerIdentity() *ProducerIdentity
type ScopeLedger ¶
type ScopeLedger struct {
Schema int `json:"schema"`
Complete bool `json:"complete"`
Overflow uint64 `json:"overflow"`
Entries []CommunityScope `json:"entries"`
}