epic

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package epic implements the Path interface for the EPIC path type.

Index

Constants

View Source
const (
	// PathType denotes the EPIC path type identifier.
	PathType path.Type = 3
	// MetadataLen denotes the number of bytes the EPIC path type contains in addition to the SCION
	// path type. It is the sum of the PktID (8B), the PHVF (4B) and the LHVF (4B) sizes.
	MetadataLen = 16
	// PktIDLen denotes the length of the packet identifier.
	PktIDLen = 8
	// HVFLen denotes the length of the hop validation fields. The length is the same for both the
	// PHVF and the LHVF.
	HVFLen = 4
)

Variables

This section is empty.

Functions

func RegisterPath

func RegisterPath()

RegisterPath registers the EPIC path type globally.

Types

type Path

type Path struct {
	PktID     PktID
	PHVF      []byte
	LHVF      []byte
	ScionPath *scion.Raw
}

Path denotes the EPIC path type header.

func (*Path) DecodeFromBytes

func (p *Path) DecodeFromBytes(b []byte) error

DecodeFromBytes deserializes the buffer b into the Path. On failure, an error is returned, otherwise SerializeTo will return nil.

func (*Path) Len

func (p *Path) Len() int

Len returns the length of the EPIC path in bytes.

func (*Path) Reverse

func (p *Path) Reverse() (path.Path, error)

Reverse reverses the EPIC path. In particular, this means that the SCION path type subheader is reversed.

func (*Path) SerializeTo

func (p *Path) SerializeTo(b []byte) error

SerializeTo serializes the Path into buffer b. On failure, an error is returned, otherwise SerializeTo will return nil.

func (*Path) Type

func (p *Path) Type() path.Type

Type returns the EPIC path type identifier.

type PktID

type PktID struct {
	Timestamp uint32
	Counter   uint32
}

PktID denotes the EPIC packet ID.

func (*PktID) DecodeFromBytes

func (i *PktID) DecodeFromBytes(raw []byte)

DecodeFromBytes deserializes the buffer (raw) into the PktID.

func (*PktID) SerializeTo

func (i *PktID) SerializeTo(b []byte)

SerializeTo serializes the PktID into the buffer (b).

Jump to

Keyboard shortcuts

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