entries

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package entries contains implementation of various P4 entitites such as tables, groups, meters, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Action *p4info.Action
}

Action represents a P4 action

func NewAction

func NewAction(table *p4info.Action) *Action

NewAction creates a new action

type ActionProfile added in v0.1.8

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

ActionProfile represents a P4 action profile instance

func (ActionProfile) DeleteActionProfileGroup added in v0.1.8

func (ap ActionProfile) DeleteActionProfileGroup(entry *p4api.ActionProfileGroup) error

DeleteActionProfileGroup deletes the specified group from this action profile

func (ActionProfile) DeleteActionProfileMember added in v0.1.8

func (ap ActionProfile) DeleteActionProfileMember(entry *p4api.ActionProfileMember) error

DeleteActionProfileMember deletes the specified member entry

func (ActionProfile) ModifyActionProfileGroup added in v0.1.8

func (ap ActionProfile) ModifyActionProfileGroup(entry *p4api.ActionProfileGroup, insert bool) error

ModifyActionProfileGroup modifies the specified group in this action profile

func (ActionProfile) ModifyActionProfileMember added in v0.1.8

func (ap ActionProfile) ModifyActionProfileMember(entry *p4api.ActionProfileMember, insert bool) error

ModifyActionProfileMember modifies the specified member entry

func (ActionProfile) ReadActionProfileGroups added in v0.1.8

func (ap ActionProfile) ReadActionProfileGroups(sender BatchSender) error

ReadActionProfileGroups sends all groups of the profile to the specified sender

func (ActionProfile) ReadActionProfileMembers added in v0.1.8

func (ap ActionProfile) ReadActionProfileMembers(sender BatchSender) error

ReadActionProfileMembers sends all members of the profile to the specified sender

type ActionProfileGroup added in v0.1.8

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

ActionProfileGroup represents a P4 action profile group

func (*ActionProfileGroup) ID added in v0.1.9

func (g *ActionProfileGroup) ID() uint32

ID returns the ID of the group

func (*ActionProfileGroup) Name added in v0.1.9

func (g *ActionProfileGroup) Name() string

Name returns the name of the group

func (*ActionProfileGroup) Size added in v0.1.9

func (g *ActionProfileGroup) Size() int

Size returns the size of the group

type ActionProfileMember added in v0.1.8

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

ActionProfileMember represents a P4 action profile member

type ActionProfiles added in v0.1.8

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

ActionProfiles represents a set of P4 action profiles

func NewActionProfiles added in v0.1.8

func NewActionProfiles(actionProfilesInfo []*p4info.ActionProfile) *ActionProfiles

NewActionProfiles creates a new action profiles

func (*ActionProfiles) DeleteActionProfileGroup added in v0.1.8

func (aps *ActionProfiles) DeleteActionProfileGroup(entry *p4api.ActionProfileGroup) error

DeleteActionProfileGroup deletes the specified action profile group

func (*ActionProfiles) DeleteActionProfileMember added in v0.1.8

func (aps *ActionProfiles) DeleteActionProfileMember(entry *p4api.ActionProfileMember) error

DeleteActionProfileMember deletes the specified member entry from its action profile

func (*ActionProfiles) Groups added in v0.1.9

func (aps *ActionProfiles) Groups() []*ActionProfileGroup

Groups returns a list of all action profiles' groups.

func (*ActionProfiles) ModifyActionProfileGroup added in v0.1.8

func (aps *ActionProfiles) ModifyActionProfileGroup(entry *p4api.ActionProfileGroup, insert bool) error

ModifyActionProfileGroup modifies the specified action profile group

func (*ActionProfiles) ModifyActionProfileMember added in v0.1.8

func (aps *ActionProfiles) ModifyActionProfileMember(entry *p4api.ActionProfileMember, insert bool) error

ModifyActionProfileMember modifies the specified action profile member

func (*ActionProfiles) NewActionProfile added in v0.1.8

func (aps *ActionProfiles) NewActionProfile(info *p4info.ActionProfile) *ActionProfile

NewActionProfile creates a new action profile

func (*ActionProfiles) ReadActionProfileGroups added in v0.1.8

func (aps *ActionProfiles) ReadActionProfileGroups(entry *p4api.ActionProfileGroup, sender BatchSender) error

ReadActionProfileGroups reads action profile groups

func (*ActionProfiles) ReadActionProfileMembers added in v0.1.8

func (aps *ActionProfiles) ReadActionProfileMembers(entry *p4api.ActionProfileMember, sender BatchSender) error

ReadActionProfileMembers reads action profile members

type BatchSender

type BatchSender func(entities []*p4api.Entity) error

BatchSender is an abstract function for returning batches of read entities

type Counter

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

Counter represents all cells of a specific counter

func (*Counter) Cell

func (c *Counter) Cell(index int64) *p4api.CounterEntry

Cell returns the specified cell of the counter

func (*Counter) ID

func (c *Counter) ID() uint32

ID returns the counter ID

func (*Counter) Name added in v0.1.1

func (c *Counter) Name() string

Name returns the counter name

func (*Counter) Size

func (c *Counter) Size() int

Size returns the number of cells for the counter

type Counters

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

Counters represents a set of P4 counters

func NewCounters

func NewCounters(info []*p4info.Counter) *Counters

NewCounters creates a new counters store

func (*Counters) Counters

func (cs *Counters) Counters() []*Counter

Counters returns the list of counters

func (*Counters) ModifyCounterEntry

func (cs *Counters) ModifyCounterEntry(entry *p4api.CounterEntry, insert bool) error

ModifyCounterEntry modifies the specified counter entry cell

func (*Counters) NewCounter

func (cs *Counters) NewCounter(info *p4info.Counter) *Counter

NewCounter creates a new counter and all its cell entries

type Meter

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

Meter represents all cells of a specific meter

func (*Meter) Cell

func (m *Meter) Cell(index int64) *p4api.MeterEntry

Cell returns the specified cell of the meter

func (*Meter) ID

func (m *Meter) ID() uint32

ID returns the meter ID

func (*Meter) Name added in v0.1.1

func (m *Meter) Name() string

Name returns the meter name

func (*Meter) Size

func (m *Meter) Size() int

Size returns the number of cells for the meter

type Meters

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

Meters represents a set of P4 meters

func NewMeters

func NewMeters(info []*p4info.Meter) *Meters

NewMeters creates a new meters store

func (*Meters) Meters

func (ms *Meters) Meters() []*Meter

Meters returns the list of meters

func (*Meters) ModifyMeterEntry

func (ms *Meters) ModifyMeterEntry(entry *p4api.MeterEntry, insert bool) error

ModifyMeterEntry modifies the specified meter entry cell

func (*Meters) NewMeter

func (ms *Meters) NewMeter(info *p4info.Meter) *Meter

NewMeter creates a new meter and all its cell entries

type PacketReplication added in v0.1.8

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

PacketReplication represents packet replication engine constructs

func NewPacketReplication added in v0.1.8

func NewPacketReplication() *PacketReplication

NewPacketReplication creates store for P4 PRE constructs

func (*PacketReplication) CloneSessions added in v0.1.9

func (pr *PacketReplication) CloneSessions() []*p4api.CloneSessionEntry

CloneSessions returns list of clone sessions created in PRE

func (*PacketReplication) DeleteCloneSessionEntry added in v0.1.8

func (pr *PacketReplication) DeleteCloneSessionEntry(entry *p4api.CloneSessionEntry) error

DeleteCloneSessionEntry deletes the specified close session entry

func (*PacketReplication) DeleteMulticastGroupEntry added in v0.1.8

func (pr *PacketReplication) DeleteMulticastGroupEntry(entry *p4api.MulticastGroupEntry) error

DeleteMulticastGroupEntry deletes the specified multicast group entry

func (*PacketReplication) ModifyCloneSessionEntry added in v0.1.8

func (pr *PacketReplication) ModifyCloneSessionEntry(entry *p4api.CloneSessionEntry, insert bool) error

ModifyCloneSessionEntry modifies the specified clone session entry

func (*PacketReplication) ModifyMulticastGroupEntry added in v0.1.8

func (pr *PacketReplication) ModifyMulticastGroupEntry(entry *p4api.MulticastGroupEntry, insert bool) error

ModifyMulticastGroupEntry modifies the specified multicast group entry

func (*PacketReplication) MulticastGroups added in v0.1.9

func (pr *PacketReplication) MulticastGroups() []*p4api.MulticastGroupEntry

MulticastGroups returns list of multicast groups created in PRE

func (*PacketReplication) ReadCloneSessionEntries added in v0.1.8

func (pr *PacketReplication) ReadCloneSessionEntries(entry *p4api.CloneSessionEntry, sender BatchSender) error

ReadCloneSessionEntries sends all clone session entries to the given sender

func (*PacketReplication) ReadMulticastGroupEntries added in v0.1.8

func (pr *PacketReplication) ReadMulticastGroupEntries(entry *p4api.MulticastGroupEntry, sender BatchSender) error

ReadMulticastGroupEntries sends all multicast group entries to the given sender

type ReadType

type ReadType byte

ReadType specifies whether to read table entry, its direct counter or its direct meter

const (
	// ReadTableEntry specified that reads should return entities with TableEntry
	ReadTableEntry ReadType = iota
	// ReadDirectCounter specified that reads should return entities with DirectCounterEntry
	ReadDirectCounter
	// ReadDirectMeter specified that reads should return entities with DirectMeterEntry
	ReadDirectMeter
)

type Row

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

Row represents table row entry and its mutable direct resources

type Table

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

Table represents a single P4 table

func (*Table) Entries added in v0.1.2

func (t *Table) Entries() []*p4api.TableEntry

Entries returns a copy of the table entries; in no particular order

func (*Table) ID

func (t *Table) ID() uint32

ID returns the table ID

func (*Table) ModifyDirectCounterEntry

func (t *Table) ModifyDirectCounterEntry(entry *p4api.DirectCounterEntry) error

ModifyDirectCounterEntry modifies the specified direct counter entry data

func (*Table) ModifyDirectMeterEntry

func (t *Table) ModifyDirectMeterEntry(entry *p4api.DirectMeterEntry) error

ModifyDirectMeterEntry modifies the specified direct meter entry data

func (*Table) ModifyTableEntry

func (t *Table) ModifyTableEntry(entry *p4api.TableEntry, insert bool) error

ModifyTableEntry inserts or modifies the specified entry

func (*Table) Name added in v0.1.1

func (t *Table) Name() string

Name returns the table name

func (*Table) ReadTableEntries

func (t *Table) ReadTableEntries(request *p4api.TableEntry, readType ReadType, sender BatchSender) error

ReadTableEntries reads the table entries matching the specified table entry request

func (*Table) RemoveTableEntry

func (t *Table) RemoveTableEntry(entry *p4api.TableEntry) error

RemoveTableEntry removes the specified table entry and any direct counter data and meter configs for that entry

func (*Table) Size

func (t *Table) Size() int

Size returns the number of entries in the table

type Tables

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

Tables represents a set of P4 tables

func NewTables

func NewTables(tablesInfo []*p4info.Table) *Tables

NewTables creates a new set of tables from the given P4 info descriptor

func (*Tables) ModifyDirectCounterEntry

func (ts *Tables) ModifyDirectCounterEntry(entry *p4api.DirectCounterEntry, insert bool) error

ModifyDirectCounterEntry modifies the specified direct counter entry in its appropriate table

func (*Tables) ModifyDirectMeterEntry

func (ts *Tables) ModifyDirectMeterEntry(entry *p4api.DirectMeterEntry, insert bool) error

ModifyDirectMeterEntry modifies the specified direct meter entry in its appropriate table

func (*Tables) ModifyTableEntry

func (ts *Tables) ModifyTableEntry(entry *p4api.TableEntry, insert bool) error

ModifyTableEntry modifies the specified table entry in its appropriate table

func (*Tables) NewTable

func (ts *Tables) NewTable(table *p4info.Table) *Table

NewTable creates a new device table

func (*Tables) ReadTableEntries

func (ts *Tables) ReadTableEntries(request *p4api.TableEntry, readType ReadType, sender BatchSender) error

ReadTableEntries reads the table entries matching the specified table entry, from the appropriate table

func (*Tables) RemoveTableEntry

func (ts *Tables) RemoveTableEntry(entry *p4api.TableEntry) error

RemoveTableEntry removes the specified table entry from its appropriate table

func (*Tables) Table added in v0.1.2

func (ts *Tables) Table(id uint32) *Table

Table returns the table with the specified ID

func (*Tables) Tables

func (ts *Tables) Tables() []*Table

Tables returns the list of tables

Jump to

Keyboard shortcuts

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