tableutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package tableutil contains utilites used to implement tables in Lucius like prefix, flow and exact match.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key []byte

A Key is a sequence of bytes used to identify entries in a table.

type KeyDesc

type KeyDesc []fwdpacket.FieldID

A KeyDesc describes the structure of a key as a sequence of packet field IDs. It can make keys from packets or entry descriptors.

func MakeKeyDesc

func MakeKeyDesc(fields []*fwdpb.PacketFieldId) KeyDesc

MakeKeyDesc makes a keyDesc from a series of packet field id.

func (KeyDesc) MakePacketKey

func (kd KeyDesc) MakePacketKey(packet fwdpacket.Packet) Key

MakePacketKey makes a key from a packet. The key desc determines the sequence of fields used to create the key. If the key desc contains a field absent in the desc, then the corresponding bytes are set to zero. Each field is padded to the maximum size when forming the key.

func (KeyDesc) Size

func (kd KeyDesc) Size() int

Size returns the size of the key in bytes built using the key desc.

Jump to

Keyboard shortcuts

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