diffpcap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 2 Imported by: ? 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 diffpcap provides PCAP file comparison and protocol audit trail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDiffResult

func FormatDiffResult(r *DiffResult) string

FormatDiffResult formats a DiffResult as a human-readable string.

Types

type AuditEntry

type AuditEntry struct {
	Timestamp string `json:"timestamp"`
	User      string `json:"user"`
	Protocol  string `json:"protocol"`
	Action    string `json:"action"` // "created", "modified", "deleted"
	Details   string `json:"details"`
}

AuditEntry represents a protocol change audit entry.

type DiffResult

type DiffResult struct {
	TotalA    int          `json:"total_a"`
	TotalB    int          `json:"total_b"`
	Identical int          `json:"identical"`
	Modified  int          `json:"modified"`
	OnlyInA   int          `json:"only_in_a"`
	OnlyInB   int          `json:"only_in_b"`
	Diffs     []PacketDiff `json:"diffs,omitempty"`
}

DiffResult holds the result of comparing two packet sets.

func ComparePackets

func ComparePackets(a, b []map[string]any) *DiffResult

ComparePackets compares two sets of decoded packets.

type FieldChange

type FieldChange struct {
	Field    string `json:"field"`
	OldValue any    `json:"old_value"`
	NewValue any    `json:"new_value"`
	Type     string `json:"type"` // "modified", "added", "removed"
}

FieldChange represents a single field-level change.

type PacketDiff

type PacketDiff struct {
	Index   int            `json:"index"`
	FieldA  map[string]any `json:"field_a,omitempty"`
	FieldB  map[string]any `json:"field_b,omitempty"`
	Changes []FieldChange  `json:"changes"`
}

PacketDiff represents the difference between two packets.

Jump to

Keyboard shortcuts

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