packet

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2016 License: MIT Imports: 12 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 Packet

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

	SrcHost []string
	DstHost []string
	Payload string
	// 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

func (*Packet) Open

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

Open is a loop over packets

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