packet_sniffer

package
v0.0.0-...-525a05c Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: GPL-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(cmd *cobra.Command, args []string)

Capture packets and decode them

func ExtendedCapture

func ExtendedCapture(p *Params)

Types

type CapturedPacket

type CapturedPacket struct {
	Command   networking.Command
	Seen      time.Time
	Direction string
}

type Context

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

func (Context) GetCaptureInfo

func (c Context) GetCaptureInfo() gopacket.CaptureInfo

type EntitiesMovements

type EntitiesMovements struct {
	Entities map[uint16][]Movement
	sync.Mutex
}

type Flows

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

Flows utility struct for storing raw packets

type Movement

type Movement struct {
	Timestamp time.Time
	X, Y      uint32
}

type PacketData

type PacketData struct {
	// opcode => hex string
	Packets map[uint16][]string
	sync.Mutex
}

type PacketView

type PacketView struct {
	// time of capture
	PacketID         string                 `json:"packetID"`
	ConnectionKey    string                 `json:"connectionKey"`
	TimeStamp        string                 `json:"timestamp"`
	IPEndpoints      string                 `json:"ipEndpoints"`
	PortEndpoints    string                 `json:"portEndpoints"`
	Direction        string                 `json:"direction"`
	PacketData       networking.ExportedPcb `json:"packetData"`
	NcRepresentation ncRepresentation       `json:"ncRepresentation"`
}

PacketView is used to represent data to the frontend UI

func (*PacketView) String

func (pv *PacketView) String() string

type Params

type Params struct {
	// if command operation code is in this list, send command on the channel
	WatchCommands map[uint16]interface{}
	Send          chan<- CapturedPacket
}

Jump to

Keyboard shortcuts

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