metadata

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metadata implements the metadata packet header.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

Metadata is a manadatory packet header that stores derived state of a packet. Since metadata is not a real packet header, it does not contribute to the packet's frame.

func (*Metadata) Field

func (m *Metadata) Field(id fwdpacket.FieldID) ([]byte, error)

Field returns the values of the queried packet fields.

func (Metadata) Header

func (Metadata) Header() []byte

Header returns nil as it does not contribute to the packet's frame.

func (Metadata) ID

ID returns the protocol header ID.

func (Metadata) Modify

Modify returns an error as the metadata header cannot be changed.

func (*Metadata) Rebuild

func (m *Metadata) Rebuild() error

Rebuild updates the packet length. The length is zero if the packet had zero bytes.

func (Metadata) Remove

Remove returns an error as the metadata header cannot be removed.

func (Metadata) Trailer

func (Metadata) Trailer() []byte

Trailer returns the no trailing bytes.

func (*Metadata) UpdateField

func (m *Metadata) UpdateField(id fwdpacket.FieldID, op int, arg []byte) (bool, error)

UpdateField can update the input and output port of the packet.

Jump to

Keyboard shortcuts

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