Documentation ¶
Overview ¶
Package utils contains various utilities for working with P4Info and P4RT entities
Index ¶
- func ARPRequestPacket(theirIP []byte, ourMAC []byte, ourIP []byte) ([]byte, error)
- func ControllerLLDPPacket(egressPort uint32) ([]byte, error)
- func CreateMastershipArbitration(electionID *p4api.Uint128) *p4api.StreamMessageRequest
- func GenerateFieldMatch(mf *p4info.MatchField) *p4api.FieldMatch
- func GenerateFieldMatches(tableInfo *p4info.Table) []*p4api.FieldMatch
- func GenerateTableAction(tableInfo *p4info.Table) *p4api.TableAction
- func GenerateTableEntry(tableInfo *p4info.Table, priority int32, action *p4api.TableAction) *p4api.TableEntry
- func IP(addr string) []byte
- func JoinPath(segments []string) string
- func LoadP4Info(path string) (*p4info.P4Info, error)
- func MAC(addr string) []byte
- func NameKey(e string) (string, map[string]string, bool)
- func P4InfoBytes(info *p4info.P4Info) []byte
- func RandomBytes(bitwidth int32) []byte
- func SplitPath(path string) []string
- func Subpath(path string, name string, key map[string]string) string
- func ToPath(path string) *gnmi.Path
- func ToString(path *gnmi.Path) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ARPRequestPacket ¶
ARPRequestPacket returns packet bytes with an ARP request for the specified IP address
func ControllerLLDPPacket ¶
ControllerLLDPPacket returns packet bytes for an ONOS link discovery packet
func CreateMastershipArbitration ¶
func CreateMastershipArbitration(electionID *p4api.Uint128) *p4api.StreamMessageRequest
CreateMastershipArbitration returns stream message request with the specified election ID components
func GenerateFieldMatch ¶
func GenerateFieldMatch(mf *p4info.MatchField) *p4api.FieldMatch
GenerateFieldMatch generates field match compliant with the specified match schema
func GenerateFieldMatches ¶
func GenerateFieldMatches(tableInfo *p4info.Table) []*p4api.FieldMatch
GenerateFieldMatches generates field matches compliant with the specified table schema
func GenerateTableAction ¶
func GenerateTableAction(tableInfo *p4info.Table) *p4api.TableAction
GenerateTableAction generates a table action compliant with the specified table schema
func GenerateTableEntry ¶
func GenerateTableEntry(tableInfo *p4info.Table, priority int32, action *p4api.TableAction) *p4api.TableEntry
GenerateTableEntry generates a table entry compliant with the specified table schema
func LoadP4Info ¶
LoadP4Info loads the specified file containing protoJSON representation of a P4Info and returns its descriptor
func NameKey ¶
NameKey splits the string representation of the path segment into name and an optional key
func P4InfoBytes ¶
P4InfoBytes serializes the given P4 info structure into prototext bytes
func RandomBytes ¶
RandomBytes returns a buffer spanning at least the specified number of bits, filled with random content
Types ¶
This section is empty.