ownlayers

package
v1.66.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HPERMLayerType = gopacket.RegisterLayerType(
	2112,
	gopacket.LayerTypeMetadata{
		Name:    "HPERMLayerType",
		Decoder: gopacket.DecodeFunc(decodeHPERMLayer),
	},
)

Register the layer type so we can use it Use negative or 2000+ for custom layers. It must be unique

View Source
var LayerTypeRTP = gopacket.RegisterLayerType(2010, gopacket.LayerTypeMetadata{Name: "RTP", Decoder: gopacket.DecodeFunc(decodeRTP)})

LayerTypeRTP registers the RTP layer type 2010.

Functions

This section is empty.

Types

type HPERM

type HPERM struct {
	Unk1 []byte
	Unk2 byte
	Unk3 byte
	// contains filtered or unexported fields
}

func (*HPERM) LayerContents

func (hp *HPERM) LayerContents() []byte

LayerContents returns the information that our layer provides. In this case it is a header layer so we return the header information

func (*HPERM) LayerPayload

func (hp *HPERM) LayerPayload() []byte

LayerPayload returns the layer built on top of our layer or raw payload

func (*HPERM) LayerType

func (hp *HPERM) LayerType() gopacket.LayerType

We want it to return our custom layer type

type RTP

type RTP struct {
	Version               uint8
	Padding               uint8
	Extension             uint8
	CC                    uint8
	Marker                uint8
	PayloadType           uint8
	SequenceNumber        uint16
	Timestamp             uint32
	Ssrc                  uint32
	Csrc                  []uint32
	ExtensionHeaderID     uint16
	ExtensionHeaderLength uint16
	ExtensionHeader       []byte
	Payload               []byte
	Contents              []byte
}

RTP represents a RTP packet.

func (*RTP) CanDecode

func (r *RTP) CanDecode() gopacket.LayerClass

CanDecode returns a set of layers that RTP objects can decode, which is just LayerTypeRTP.

func (*RTP) DecodeFromBytes

func (r *RTP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*RTP) LayerContents

func (r *RTP) LayerContents() []byte

func (*RTP) LayerPayload

func (r *RTP) LayerPayload() []byte

func (*RTP) LayerType

func (r *RTP) LayerType() gopacket.LayerType

LayerType returns the layer type of the RTP object, which is LayerTypeRTP.

func (*RTP) Length

func (r *RTP) Length() int

Length returns the RTP Contents length.

func (*RTP) NextLayerType

func (r *RTP) NextLayerType() gopacket.LayerType

NextLayerType specifies the next layer that should be decoded. VRRP does not contain any further payload, so we set to 0

func (*RTP) String

func (r *RTP) String() string

String returns a string version of RTP.

type VXLAN

type VXLAN struct {
	layers.BaseLayer
	ValidIDFlag bool   // 'I' bit per RFC 7348
	VNI         uint32 // 'VXLAN Network Identifier' 24 bits per RFC 7348
}

func (*VXLAN) CanDecode

func (v *VXLAN) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*VXLAN) DecodeFromBytes

func (v *VXLAN) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*VXLAN) LayerType

func (v *VXLAN) LayerType() gopacket.LayerType

LayerType returns LayerTypeVXLAN

func (*VXLAN) NextLayerType

func (v *VXLAN) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

Jump to

Keyboard shortcuts

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