packet

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcLatency

func CalcLatency(pkt Packet, table *flowtable.FlowTable)

CalcLatency calculates and displays flow latencies

Types

type Packet

type Packet struct {
	SrcIP     netip.Addr
	DstIP     netip.Addr
	SrcPort   uint16
	DstPort   uint16
	Protocol  uint8
	TTL       uint8
	Syn       bool
	Ack       bool
	TimeStamp uint64
}

Packet represents a TCP or UDP packet

func UnmarshalBinary

func UnmarshalBinary(in []byte) (Packet, bool)

UnmarshalBinary builds and fills up the Packet struct coming from eBPF map

func (*Packet) Hash

func (pkt *Packet) Hash() uint64

Hash hashes the packets based on their 5-tuple hash

Jump to

Keyboard shortcuts

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