packet

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotLayer3Packet = errors.New("not a layer 3 packet")
)

Functions

This section is empty.

Types

type Mod

type Mod func(l *layers.IPv4)

func ModifyData

func ModifyData(b []byte) Mod

func ModifyDst

func ModifyDst(dstIP net.IP) Mod

func ModifySrc

func ModifySrc(srcIP net.IP) Mod

type Packet

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

func NewFromLayer3Bytes

func NewFromLayer3Bytes(b []byte) (*Packet, error)

func (*Packet) GetDst

func (p *Packet) GetDst() net.IP

func (*Packet) GetDstPort

func (p *Packet) GetDstPort() string

func (*Packet) GetSrc

func (p *Packet) GetSrc() net.IP

func (*Packet) GetSrcPort

func (p *Packet) GetSrcPort() string

func (*Packet) Modify

func (p *Packet) Modify(mods ...Mod)

func (*Packet) Serialize

func (p *Packet) Serialize() ([]byte, error)

Jump to

Keyboard shortcuts

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