packet

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: MIT Imports: 15 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 Options added in v0.2.1

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 added in v0.2.4

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 added in v0.2.2

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