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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtnSCMPErrorFlag = 0x01
	ExtnSCMPHBHFlag   = 0x02
)
View Source
const E2EDebugLen = common.ExtnFirstLineLen
View Source
const OneHopPathLen = common.ExtnFirstLineLen

Variables

View Source
var (
	LayerTypeHopByHopExtension = gopacket.RegisterLayerType(1101,
		gopacket.LayerTypeMetadata{Name: "HopByHopExtension", Decoder: nil})
	LayerTypeEndToEndExtension = gopacket.RegisterLayerType(1102,
		gopacket.LayerTypeMetadata{Name: "EndToEndExtension", Decoder: nil})
	LayerTypeSCIONUDP = gopacket.RegisterLayerType(1103,
		gopacket.LayerTypeMetadata{Name: "SCIONUDP", Decoder: nil})
	LayerTypeSCMP = gopacket.RegisterLayerType(1104,
		gopacket.LayerTypeMetadata{Name: "SCMP", Decoder: nil})
)

Functions

func ExtensionFactory

func ExtensionFactory(class common.L4ProtocolType, extension *Extension) (common.Extension, error)

Types

type Extension

type Extension struct {
	layers.BaseLayer
	NextHeader common.L4ProtocolType
	NumLines   uint8
	Type       uint8
	Data       []byte
}

func ExtensionDataToExtensionLayer

func ExtensionDataToExtensionLayer(nextHdr common.L4ProtocolType,
	data common.Extension) (*Extension, error)

ExtensionDataToExtensionLayer build a low level extension representation from a high level interface.

func (*Extension) DecodeFromBytes

func (e *Extension) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Extension) SerializeTo

type ExtnE2EDebug

type ExtnE2EDebug struct {
	ID [5]byte
}

func NewExtnE2EDebugFromLayer

func NewExtnE2EDebugFromLayer(extension *Extension) (*ExtnE2EDebug, error)

func (ExtnE2EDebug) Class

func (ExtnE2EDebug) Copy

func (o ExtnE2EDebug) Copy() common.Extension

func (*ExtnE2EDebug) DecodeFromLayer

func (o *ExtnE2EDebug) DecodeFromLayer(extension *Extension) error

func (ExtnE2EDebug) Len

func (o ExtnE2EDebug) Len() int

func (ExtnE2EDebug) Pack

func (o ExtnE2EDebug) Pack() (common.RawBytes, error)

func (ExtnE2EDebug) Reverse

func (o ExtnE2EDebug) Reverse() (bool, error)

func (ExtnE2EDebug) String

func (o ExtnE2EDebug) String() string

func (ExtnE2EDebug) Type

func (o ExtnE2EDebug) Type() common.ExtnType

func (ExtnE2EDebug) Write

func (o ExtnE2EDebug) Write(b common.RawBytes) error

type ExtnOHP

type ExtnOHP struct{}

func NewExtnOHPFromLayer

func NewExtnOHPFromLayer(extension *Extension) (*ExtnOHP, error)

func (ExtnOHP) Class

func (o ExtnOHP) Class() common.L4ProtocolType

func (ExtnOHP) Copy

func (o ExtnOHP) Copy() common.Extension

func (*ExtnOHP) DecodeFromLayer

func (o *ExtnOHP) DecodeFromLayer(extension *Extension) error

func (ExtnOHP) Len

func (o ExtnOHP) Len() int

func (ExtnOHP) Pack

func (o ExtnOHP) Pack() (common.RawBytes, error)

func (ExtnOHP) Reverse

func (o ExtnOHP) Reverse() (bool, error)

func (ExtnOHP) String

func (o ExtnOHP) String() string

func (ExtnOHP) Type

func (o ExtnOHP) Type() common.ExtnType

func (ExtnOHP) Write

func (o ExtnOHP) Write(b common.RawBytes) error

type ExtnSCMP

type ExtnSCMP struct {
	Error    bool
	HopByHop bool
}

func ExtnSCMPFromRaw

func ExtnSCMPFromRaw(b common.RawBytes) (*ExtnSCMP, error)

func NewExtnSCMPFromLayer

func NewExtnSCMPFromLayer(extension *Extension) (*ExtnSCMP, error)

func (*ExtnSCMP) Class

func (e *ExtnSCMP) Class() common.L4ProtocolType

func (*ExtnSCMP) Copy

func (e *ExtnSCMP) Copy() common.Extension

func (*ExtnSCMP) DecodeFromBytes

func (e *ExtnSCMP) DecodeFromBytes(b []byte) error

func (*ExtnSCMP) DecodeFromLayer

func (e *ExtnSCMP) DecodeFromLayer(extension *Extension) error

func (*ExtnSCMP) Len

func (e *ExtnSCMP) Len() int

func (*ExtnSCMP) Pack

func (e *ExtnSCMP) Pack() (common.RawBytes, error)

func (*ExtnSCMP) Reverse

func (e *ExtnSCMP) Reverse() (bool, error)

func (*ExtnSCMP) String

func (e *ExtnSCMP) String() string

func (*ExtnSCMP) Type

func (e *ExtnSCMP) Type() common.ExtnType

func (*ExtnSCMP) Write

func (e *ExtnSCMP) Write(b common.RawBytes) error

type ExtnUnknown

type ExtnUnknown struct {
	// ClassField is the Extension class. We include it here because we cannot
	// implement the Class() method of the interface otherwise.
	ClassField common.L4ProtocolType
	TypeField  uint8
	// Length, in bytes, not including the 3-byte extension header
	Length int
}

ExtnUnknown implements common.Extension for an unknown extension.

func NewExtnUnknownFromLayer

func NewExtnUnknownFromLayer(class common.L4ProtocolType,
	extension *Extension) (*ExtnUnknown, error)

func (ExtnUnknown) Class

func (u ExtnUnknown) Class() common.L4ProtocolType

func (ExtnUnknown) Copy

func (u ExtnUnknown) Copy() common.Extension

func (*ExtnUnknown) DecodeFromLayer

func (u *ExtnUnknown) DecodeFromLayer(extension *Extension) error

func (ExtnUnknown) Len

func (u ExtnUnknown) Len() int

func (ExtnUnknown) Pack

func (u ExtnUnknown) Pack() (common.RawBytes, error)

func (ExtnUnknown) Reverse

func (u ExtnUnknown) Reverse() (bool, error)

func (ExtnUnknown) String

func (u ExtnUnknown) String() string

func (ExtnUnknown) Type

func (u ExtnUnknown) Type() common.ExtnType

func (ExtnUnknown) Write

func (u ExtnUnknown) Write(b common.RawBytes) error

Jump to

Keyboard shortcuts

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