layers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LayerTypeSCMP = gopacket.RegisterLayerType(
	1361,
	gopacket.LayerTypeMetadata{
		Name:    "SCMP",
		Decoder: gopacket.DecodeFunc(decodeSCMP),
	},
)
View Source
var LayerTypeScion = gopacket.RegisterLayerType(
	newScnLayerID(),
	gopacket.LayerTypeMetadata{
		Name:    "SCION",
		Decoder: gopacket.DecodeFunc(decodeScion),
	},
)
View Source
var LayerTypeScionHBH gopacket.LayerType

Functions

func PrintSegments

func PrintSegments(segs []*Segment, indent, sep string) string

Types

type AddrHdr

type AddrHdr struct {
	DstIA   addr.IA
	SrcIA   addr.IA
	DstHost addr.HostAddr
	SrcHost addr.HostAddr
}

func NewAddrHdr

func NewAddrHdr(srcIA, srcHost, dstIA, dstHost string) *AddrHdr

func ParseRawAddrHdr

func ParseRawAddrHdr(b common.RawBytes, srcT, dstT addr.HostAddrType) (*AddrHdr, error)

func (*AddrHdr) Equal

func (a *AddrHdr) Equal(o *AddrHdr) bool

func (*AddrHdr) Len

func (a *AddrHdr) Len() int

func (*AddrHdr) NoPaddedLen

func (a *AddrHdr) NoPaddedLen() int

func (*AddrHdr) Parse

func (a *AddrHdr) Parse(b common.RawBytes, srcT, dstT addr.HostAddrType) (int, error)

func (*AddrHdr) String

func (a *AddrHdr) String() string

func (*AddrHdr) Write

func (a *AddrHdr) Write(b common.RawBytes) int

type Pld

type Pld = scmp.Payload

This type alias is to avoid name clash with Payload field in layers.BaseLayer

type SCMP

type SCMP struct {
	layers.BaseLayer
	scmp.Hdr
	*Pld
	// contains filtered or unexported fields
}

func (*SCMP) DecodeFromBytes

func (s *SCMP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*SCMP) LayerType

func (s *SCMP) LayerType() gopacket.LayerType

func (*SCMP) SerializeTo

func (s *SCMP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

func (*SCMP) SetNetworkLayerForChecksum

func (s *SCMP) SetNetworkLayerForChecksum(l gopacket.NetworkLayer) error

func (*SCMP) String

func (s *SCMP) String() string

Strings is a pretty print of the quotes, trying to display pretty-printed quotes if they parse without errors, otherwise display hex of the slice

type Scion

type Scion struct {
	golayers.BaseLayer

	CmnHdr  spkt.CmnHdr
	AddrHdr AddrHdr
	Path    ScnPath
	// contains filtered or unexported fields
}

Scion represents the gopacket SCION network layer, which contains the common, address and path "headers".

func (*Scion) DecodeFromBytes

func (l *Scion) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Scion) LayerType

func (l *Scion) LayerType() gopacket.LayerType

func (*Scion) NetworkFlow

func (l *Scion) NetworkFlow() gopacket.Flow

XXX required to implement NetworkLayer interface

func (*Scion) SerializeTo

func (l *Scion) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

type ScionHBH

type ScionHBH struct {
	layers.Extension
}

func (*ScionHBH) LayerType

func (l *ScionHBH) LayerType() gopacket.LayerType

func (*ScionHBH) LengthBytes

func (l *ScionHBH) LengthBytes() int

type ScnPath

type ScnPath struct {
	Segs []*Segment
	// contains filtered or unexported fields
}

func (*ScnPath) Len

func (p *ScnPath) Len() int

func (*ScnPath) Parse

func (p *ScnPath) Parse(b common.RawBytes) error

func (*ScnPath) String

func (p *ScnPath) String() string

func (*ScnPath) WriteTo

func (p *ScnPath) WriteTo(b common.RawBytes) error

type Segment

type Segment struct {
	Inf  *spath.InfoField
	Hops []*spath.HopField
}

Segment defines a path segment

func (*Segment) Len

func (s *Segment) Len() int

func (*Segment) Parse

func (s *Segment) Parse(b common.RawBytes) (int, error)

func (*Segment) String

func (s *Segment) String() string

func (*Segment) WriteTo

func (s *Segment) WriteTo(b common.RawBytes) (int, error)

type UDP

type UDP struct {
	golayers.UDP
	// contains filtered or unexported fields
}

UDP is a wrapper around layers.UDP to be able to leverage gopacket UDP checksum calculation

func (*UDP) SerializeTo

func (udp *UDP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

func (*UDP) SetNetworkLayerForChecksum

func (udp *UDP) SetNetworkLayerForChecksum(l gopacket.NetworkLayer) error

Jump to

Keyboard shortcuts

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