Documentation ¶
Index ¶
- Constants
- func DisableCanonicalBytestrings(options *ClientOptions)
- func ToCanonicalIf(v []byte, cond bool) []byte
- type ActionProfileActionSet
- func (s *ActionProfileActionSet) AddAction(action string, params [][]byte, weight int32) *ActionProfileActionSet
- func (s *ActionProfileActionSet) AddActionWatchPort(action string, params [][]byte, weight int32, port Port) *ActionProfileActionSet
- func (s *ActionProfileActionSet) TableAction() *p4_v1.TableAction
- type Client
- func (c *Client) AckDigestList(digestList *p4_v1.DigestList) error
- func (c *Client) DeleteMulticastGroup(mgid uint32) error
- func (c *Client) DeleteTableEntry(entry *p4_v1.TableEntry) error
- func (c *Client) DisableDigest(digest string) error
- func (c *Client) DoActionProfileGroupEntry(opType p4_v1.Update_Type, entry *p4_v1.ActionProfileGroup) error
- func (c *Client) DoActionProfileMemberEntry(opType p4_v1.Update_Type, entry *p4_v1.ActionProfileMember) error
- func (c *Client) EnableDigest(digest string, config *p4_v1.DigestEntry_Config) error
- func (c *Client) GetFwdPipe(responseType GetFwdPipeResponseType) (*FwdPipeConfig, error)
- func (c *Client) InsertMulticastGroup(mgid uint32, ports []uint32) error
- func (c *Client) InsertMulticastGroupEntry(mge *p4_v1.MulticastGroupEntry) error
- func (c *Client) InsertTableEntry(entry *p4_v1.TableEntry) error
- func (c *Client) ModifyCounterEntry(counter string, index int64, data *p4_v1.CounterData) error
- func (c *Client) ModifyDigest(digest string, config *p4_v1.DigestEntry_Config) error
- func (c *Client) ModifyTableEntry(entry *p4_v1.TableEntry) error
- func (c *Client) NewActionProfileActionSet() *ActionProfileActionSet
- func (c *Client) NewActionProfileGroup(actionProfile string, groupId uint32, members []uint32) *p4_v1.ActionProfileGroup
- func (c *Client) NewActionProfileMember(actionProfile, action string, memberId uint32, params [][]byte) *p4_v1.ActionProfileMember
- func (c *Client) NewTableActionDirect(action string, params [][]byte) *p4_v1.TableAction
- func (c *Client) NewTableEntry(table string, mfs []MatchInterface, action *p4_v1.TableAction, ...) *p4_v1.TableEntry
- func (c *Client) NewTableEntryWithMatchFields(table string, fieldNames []string, mfs []MatchInterface, ...) *p4_v1.TableEntry
- func (c *Client) PacketOut(pkt []byte, md map[string][]byte) error
- func (c *Client) ReadCounterEntry(counter string, index int64) (*p4_v1.CounterData, error)
- func (c *Client) ReadCounterEntryWildcard(counter string) ([]*p4_v1.CounterData, error)
- func (c *Client) ReadEntitySingle(entity *p4_v1.Entity) (*p4_v1.Entity, error)
- func (c *Client) ReadEntityWildcard(entity *p4_v1.Entity, readEntityCh chan<- *p4_v1.Entity) error
- func (c *Client) ReadMulticastGroup(mgid uint32) (*p4_v1.Entity, error)
- func (c *Client) Run(stopCh <-chan struct{}, arbitrationCh chan<- bool, ...) error
- func (c *Client) SetFwdPipe(binPath string, Xp4infoPath string, cookie uint64) (*FwdPipeConfig, error)
- func (c *Client) SetFwdPipeFromBytes(binBytes, p4infoBytes []byte, cookie uint64) (*FwdPipeConfig, error)
- func (c *Client) WriteUpdate(update *p4_v1.Update) error
- type ClientOptions
- type ExactMatch
- type FwdPipeConfig
- type GetFwdPipeResponseType
- type LpmMatch
- type MatchInterface
- type OptionalMatch
- type Port
- type RangeMatch
- type TableEntryOptions
- type TernaryMatch
Constants ¶
View Source
const ( GetFwdPipeAll = GetFwdPipeResponseType(p4_v1.GetForwardingPipelineConfigRequest_ALL) GetFwdPipeCookieOnly = GetFwdPipeResponseType(p4_v1.GetForwardingPipelineConfigRequest_COOKIE_ONLY) GetFwdPipeXp4infoAndCookie = GetFwdPipeResponseType(p4_v1.GetForwardingPipelineConfigRequest_P4INFO_AND_COOKIE) GetFwdPipeDeviceConfigAndCookie = GetFwdPipeResponseType(p4_v1.GetForwardingPipelineConfigRequest_DEVICE_CONFIG_AND_COOKIE) )
View Source
const (
P4RuntimePort = 9559
)
Variables ¶
This section is empty.
Functions ¶
func DisableCanonicalBytestrings ¶
func DisableCanonicalBytestrings(options *ClientOptions)
func ToCanonicalIf ¶
Types ¶
type ActionProfileActionSet ¶
type ActionProfileActionSet struct {
// contains filtered or unexported fields
}
func (*ActionProfileActionSet) AddAction ¶
func (s *ActionProfileActionSet) AddAction( action string, params [][]byte, weight int32, ) *ActionProfileActionSet
func (*ActionProfileActionSet) AddActionWatchPort ¶
func (s *ActionProfileActionSet) AddActionWatchPort( action string, params [][]byte, weight int32, port Port, ) *ActionProfileActionSet
func (*ActionProfileActionSet) TableAction ¶
func (s *ActionProfileActionSet) TableAction() *p4_v1.TableAction
type Client ¶
type Client struct { ClientOptions p4_v1.P4RuntimeClient Xp4info *p4_config_v1.P4Info XstreamSendCh chan *p4_v1.StreamMessageRequest // contains filtered or unexported fields }
func NewClient ¶
func NewClient( p4RuntimeClient p4_v1.P4RuntimeClient, deviceID uint64, electionID p4_v1.Uint128, optionsModifierFns ...func(*ClientOptions), ) *Client
func (*Client) AckDigestList ¶
func (c *Client) AckDigestList(digestList *p4_v1.DigestList) error
func (*Client) DeleteMulticastGroup ¶
func (*Client) DeleteTableEntry ¶
func (c *Client) DeleteTableEntry(entry *p4_v1.TableEntry) error
func (*Client) DisableDigest ¶
func (*Client) DoActionProfileGroupEntry ¶
func (c *Client) DoActionProfileGroupEntry(opType p4_v1.Update_Type, entry *p4_v1.ActionProfileGroup) error
func (*Client) DoActionProfileMemberEntry ¶
func (c *Client) DoActionProfileMemberEntry(opType p4_v1.Update_Type, entry *p4_v1.ActionProfileMember) error
func (*Client) EnableDigest ¶
func (c *Client) EnableDigest(digest string, config *p4_v1.DigestEntry_Config) error
func (*Client) GetFwdPipe ¶
func (c *Client) GetFwdPipe(responseType GetFwdPipeResponseType) (*FwdPipeConfig, error)
GetFwdPipe retrieves the current pipeline config used in the remote switch.
responseType is oneof:
GetFwdPipeAll, GetFwdPipeCookieOnly, GetFwdPipeXp4infoAndCookie, GetFwdPipeDeviceConfigAndCookie
See https://p4.org/p4runtime/spec/v1.3.0/P4Runtime-Spec.html#sec-getforwardingpipelineconfig-rpc
func (*Client) InsertMulticastGroup ¶
func (*Client) InsertMulticastGroupEntry ¶
func (c *Client) InsertMulticastGroupEntry(mge *p4_v1.MulticastGroupEntry) error
func (*Client) InsertTableEntry ¶
func (c *Client) InsertTableEntry(entry *p4_v1.TableEntry) error
func (*Client) ModifyCounterEntry ¶
func (*Client) ModifyDigest ¶
func (c *Client) ModifyDigest(digest string, config *p4_v1.DigestEntry_Config) error
func (*Client) ModifyTableEntry ¶
func (c *Client) ModifyTableEntry(entry *p4_v1.TableEntry) error
func (*Client) NewActionProfileActionSet ¶
func (c *Client) NewActionProfileActionSet() *ActionProfileActionSet
func (*Client) NewActionProfileGroup ¶
func (*Client) NewActionProfileMember ¶
func (*Client) NewTableActionDirect ¶
func (c *Client) NewTableActionDirect( action string, params [][]byte, ) *p4_v1.TableAction
func (*Client) NewTableEntry ¶
func (c *Client) NewTableEntry( table string, mfs []MatchInterface, action *p4_v1.TableAction, options *TableEntryOptions, ) *p4_v1.TableEntry
for default entries: to set use nil for mfs, to unset use nil for mfs and nil for action
func (*Client) NewTableEntryWithMatchFields ¶
func (c *Client) NewTableEntryWithMatchFields( table string, fieldNames []string, mfs []MatchInterface, action *p4_v1.TableAction, options *TableEntryOptions, ) *p4_v1.TableEntry
func (*Client) ReadCounterEntry ¶
func (*Client) ReadCounterEntryWildcard ¶
func (c *Client) ReadCounterEntryWildcard(counter string) ([]*p4_v1.CounterData, error)
func (*Client) ReadEntitySingle ¶
func (*Client) ReadEntityWildcard ¶
ReadEntityWildcard will block and send all read entities on readEntityCh. It will close the channel when the RPC completes and return any error that may have occurred.
func (*Client) ReadMulticastGroup ¶
func (*Client) Run ¶
func (c *Client) Run( stopCh <-chan struct{}, arbitrationCh chan<- bool, messageCh chan<- *p4_v1.StreamMessageResponse, ) error
func (*Client) SetFwdPipe ¶
func (*Client) SetFwdPipeFromBytes ¶
func (c *Client) SetFwdPipeFromBytes(binBytes, p4infoBytes []byte, cookie uint64) (*FwdPipeConfig, error)
type ClientOptions ¶
type ClientOptions struct {
CanonicalBytestrings bool
}
type ExactMatch ¶
type ExactMatch struct {
Value []byte
}
type FwdPipeConfig ¶
type FwdPipeConfig struct { Xp4info *p4_config_v1.P4Info P4DeviceConfig []byte Cookie uint64 }
type GetFwdPipeResponseType ¶
type GetFwdPipeResponseType int32
type MatchInterface ¶
type MatchInterface interface {
// contains filtered or unexported methods
}
type OptionalMatch ¶
type OptionalMatch struct {
Value []byte
}
type RangeMatch ¶
type TableEntryOptions ¶
type TernaryMatch ¶
Click to show internal directories.
Click to hide internal directories.