packet

package
v0.0.0-...-93ed05b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_PING_PAYLOAD string = "abcdefghijklmnopqrstuvwxyz"
View Source
const DEFAULT_TTL uint8 = 64

Variables

View Source
var LayerTypePort = gopacket.RegisterLayerType(1001,
	gopacket.LayerTypeMetadata{Name: "Port", Decoder: gopacket.DecodeFunc(decodePort)})

Register the port layer, giving it name "Port" and its decoder Note: num must be unique across all decoders

Functions

func GenICMPEchoReq

func GenICMPEchoReq(srcMac, dstMac net.HardwareAddr, srcIp, dstIp net.IP, id, seqNo uint16) []byte

Types

type Port

type Port struct {
	layers.BaseLayer
	Port            uint16
	SubmitToIngress bool
}

Port is the custom P4 frame with ingress/egress port number

func (*Port) DecodeFromBytes

func (p *Port) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Port) LayerType

func (p *Port) LayerType() gopacket.LayerType

func (*Port) SerializeTo

func (p *Port) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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