packet

package
v0.0.0-...-550a133 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package packet is a wrapper for GoPacket and sub packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LookUpCache

type LookUpCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Options

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

Options represents dump options

type Packet

type Packet struct {
	// packet layers data
	Eth    *layers.Ethernet
	ARP    *layers.ARP
	IPv4   *layers.IPv4
	IPv6   *layers.IPv6
	TCP    *layers.TCP
	UDP    *layers.UDP
	ICMPv4 *layers.ICMPv4
	ICMPv6 *layers.ICMPv6

	SrcHost []string
	DstHost []string
	Payload []byte
	// contains filtered or unexported fields
}

Packet holds all layers information

func NewPacket

func NewPacket(args string) (*Packet, error)

NewPacket creates an empty packet info

func ParsePacketLayers

func ParsePacketLayers(packet gopacket.Packet) *Packet

ParsePacketLayers decodes layers (Lazy Decoding)

func (*Packet) Banner

func (p *Packet) Banner() string

Banner prints out info that related to packet capturing

func (*Packet) Open

func (p *Packet) Open() chan *Packet

Open is a loop over packets

func (*Packet) PrintARP

func (p *Packet) PrintARP()

PrintARP prints ARP header

func (*Packet) PrintIPv4

func (p *Packet) PrintIPv4()

PrintIPv4 prints IPv4 packets

func (*Packet) PrintIPv6

func (p *Packet) PrintIPv6()

PrintIPv6 prints IPv6 packets

func (*Packet) PrintPretty

func (p *Packet) PrintPretty()

PrintPretty prints out the captured data to the stdout

Jump to

Keyboard shortcuts

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