spkt

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmnHdrLen    = 8 // Bytes
	SCIONVersion = 0
)

Variables

View Source
var ErrUnsupportedVersion = serrors.New("unsupported SCION version")

ErrUnsupportedVersion indicates an unsupported SCION version.

Functions

func AddrHdrLen

func AddrHdrLen(dst addr.HostAddr, src addr.HostAddr) int

AddrHdrLen calculates the length of a SCION address header (including padding) for the specified address types.

Types

type CmnHdr

type CmnHdr struct {
	Ver       uint8
	DstType   addr.HostAddrType
	SrcType   addr.HostAddrType
	TotalLen  uint16
	HdrLen    uint8
	CurrInfoF uint8
	CurrHopF  uint8
	NextHdr   common.L4ProtocolType
}

func CmnHdrFromRaw

func CmnHdrFromRaw(b []byte) (*CmnHdr, error)

func (*CmnHdr) HdrLenBytes

func (c *CmnHdr) HdrLenBytes() int

func (*CmnHdr) HopFOffBytes

func (c *CmnHdr) HopFOffBytes() int

func (*CmnHdr) InfoFOffBytes

func (c *CmnHdr) InfoFOffBytes() int

func (*CmnHdr) Parse

func (c *CmnHdr) Parse(b []byte) error

func (CmnHdr) String

func (c CmnHdr) String() string

func (*CmnHdr) UpdatePathOffsets

func (c *CmnHdr) UpdatePathOffsets(b []byte, iOff, hOff uint8)

func (*CmnHdr) Write

func (c *CmnHdr) Write(b []byte)

type ScnPkt

type ScnPkt struct {
	DstIA   addr.IA
	SrcIA   addr.IA
	DstHost addr.HostAddr
	SrcHost addr.HostAddr
	Path    *spath.Path
	HBHExt  []common.Extension
	E2EExt  []common.Extension
	L4      l4.L4Header
	Pld     common.Payload
}

SCION Packet structure.

func (*ScnPkt) AddrLen

func (s *ScnPkt) AddrLen() int

func (*ScnPkt) Copy

func (s *ScnPkt) Copy() (*ScnPkt, error)

func (*ScnPkt) HdrLen

func (s *ScnPkt) HdrLen() int

HdrLen returns the length of the header, in bytes.

func (*ScnPkt) Reverse

func (s *ScnPkt) Reverse() error

func (*ScnPkt) TotalLen

func (s *ScnPkt) TotalLen() int

Jump to

Keyboard shortcuts

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