Documentation ¶
Index ¶
- Constants
- Variables
- func DisableCanonicalBytestrings(options *ClientOptions)
- func ToCanonicalIf(v []byte, cond bool) []byte
- type ActionProfileActionSet
- type Client
- func (c *Client) AckDigestList(ctx context.Context, digestList *p4_v1.DigestList) error
- func (c *Client) CommitFwdPipe(ctx context.Context) (*p4_v1.SetForwardingPipelineConfigResponse, error)
- func (c *Client) DeleteActionProfileGroup(ctx context.Context, entry *p4_v1.ActionProfileGroup) error
- func (c *Client) DeleteActionProfileMember(ctx context.Context, entry *p4_v1.ActionProfileMember) error
- func (c *Client) DeleteCloneSession(ctx context.Context, id uint32) error
- func (c *Client) DeleteMulticastGroup(ctx context.Context, mgid uint32) error
- func (c *Client) DeleteTableEntry(ctx context.Context, entry *p4_v1.TableEntry) error
- func (c *Client) DisableDigest(ctx context.Context, digest string) error
- func (c *Client) EnableDigest(ctx context.Context, digest string, config *p4_v1.DigestEntry_Config) error
- func (c *Client) GetFwdPipe(ctx context.Context, responseType GetFwdPipeResponseType) (*FwdPipeConfig, error)
- func (c *Client) InsertActionProfileGroup(ctx context.Context, entry *p4_v1.ActionProfileGroup) error
- func (c *Client) InsertActionProfileMember(ctx context.Context, entry *p4_v1.ActionProfileMember) error
- func (c *Client) InsertCloneSession(ctx context.Context, id uint32, ports []uint32, options CloneSessionOptions) error
- func (c *Client) InsertMulticastGroup(ctx context.Context, mgid uint32, ports []uint32) error
- func (c *Client) InsertTableEntry(ctx context.Context, entry *p4_v1.TableEntry) error
- func (c *Client) ModifyActionProfileGroup(ctx context.Context, entry *p4_v1.ActionProfileGroup) error
- func (c *Client) ModifyActionProfileMember(ctx context.Context, entry *p4_v1.ActionProfileMember) error
- func (c *Client) ModifyCounterEntry(ctx context.Context, counter string, index int64, data *p4_v1.CounterData) error
- func (c *Client) ModifyDigest(ctx context.Context, digest string, config *p4_v1.DigestEntry_Config) error
- func (c *Client) ModifyTableEntry(ctx context.Context, entry *p4_v1.TableEntry) error
- func (c *Client) NewActionProfileActionSet() *ActionProfileActionSet
- func (c *Client) NewActionProfileGroup(actionProfile string, groupID uint32, ...) *p4_v1.ActionProfileGroup
- func (c *Client) NewActionProfileMember(actionProfile string, memberID uint32, action string, params [][]byte) *p4_v1.ActionProfileMember
- func (c *Client) NewTableActionDirect(action string, params [][]byte) *p4_v1.TableAction
- func (c *Client) NewTableActionGroup(groupID uint32) *p4_v1.TableAction
- func (c *Client) NewTableActionMember(memberID uint32) *p4_v1.TableAction
- func (c *Client) NewTableEntry(table string, mfs map[string]MatchInterface, action *p4_v1.TableAction, ...) *p4_v1.TableEntry
- func (c *Client) ReadCounterEntry(ctx context.Context, counter string, index int64) (*p4_v1.CounterData, error)
- func (c *Client) ReadCounterEntryWildcard(ctx context.Context, counter string) ([]*p4_v1.CounterData, error)
- func (c *Client) ReadEntitySingle(ctx context.Context, entity *p4_v1.Entity) (*p4_v1.Entity, error)
- func (c *Client) ReadEntityWildcard(ctx context.Context, entity *p4_v1.Entity, readEntityCh chan<- *p4_v1.Entity) error
- func (c *Client) ReadMeterEntry(ctx context.Context, meter string, index int64) (*p4_v1.MeterConfig, error)
- func (c *Client) ReadMeterEntryWildcard(ctx context.Context, meter string) ([]*p4_v1.MeterEntry, error)
- func (c *Client) ReadTableEntry(ctx context.Context, table string, mfs []MatchInterface) (*p4_v1.TableEntry, error)
- func (c *Client) ReadTableEntryWildcard(ctx context.Context, table string) ([]*p4_v1.TableEntry, error)
- func (c *Client) Run(stopCh <-chan struct{}, arbitrationCh chan<- bool, ...) error
- func (c *Client) SaveFwdPipeFromBytes(ctx context.Context, binBytes, p4infoBytes []byte, cookie uint64) (*FwdPipeConfig, error)
- func (c *Client) SendMessage(ctx context.Context, msg *p4_v1.StreamMessageRequest) error
- func (c *Client) SendPacketOut(ctx context.Context, pkt *p4_v1.PacketOut) error
- func (c *Client) SetFwdPipe(ctx context.Context, binPath string, p4infoPath string, cookie uint64) (*FwdPipeConfig, error)
- func (c *Client) SetFwdPipeFromBytes(ctx context.Context, binBytes, p4infoBytes []byte, cookie uint64) (*FwdPipeConfig, error)
- func (c *Client) SetFwdPipeFromBytesWithAction(ctx context.Context, binBytes, p4infoBytes []byte, cookie uint64, ...) (*FwdPipeConfig, error)
- func (c *Client) WriteUpdate(ctx context.Context, update *p4_v1.Update) error
- type ClientOptions
- type CloneSessionOptions
- 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) GetFwdPipeP4InfoAndCookie = GetFwdPipeResponseType(p4_v1.GetForwardingPipelineConfigRequest_P4INFO_AND_COOKIE) GetFwdPipeDeviceConfigAndCookie = GetFwdPipeResponseType(p4_v1.GetForwardingPipelineConfigRequest_DEVICE_CONFIG_AND_COOKIE) )
View Source
const (
P4RuntimePort = 9559
)
Variables ¶
View Source
var DefaultCloneSessionOptions = CloneSessionOptions{
ClassOfService: 0,
PacketLenBytes: 0,
}
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, port Port, ) *ActionProfileActionSet
func (*ActionProfileActionSet) TableAction ¶
func (s *ActionProfileActionSet) TableAction() *p4_v1.TableAction
type Client ¶
type Client struct { ClientOptions p4_v1.P4RuntimeClient // contains filtered or unexported fields }
func NewClient ¶
func NewClient( p4RuntimeClient p4_v1.P4RuntimeClient, deviceID uint64, electionID *p4_v1.Uint128, optionsModifierFns ...func(*ClientOptions), ) *Client
func NewClientForRole ¶
func NewClientForRole( p4RuntimeClient p4_v1.P4RuntimeClient, deviceID uint64, electionID *p4_v1.Uint128, role *p4_v1.Role, optionsModifierFns ...func(*ClientOptions), ) *Client
func (*Client) AckDigestList ¶
func (*Client) CommitFwdPipe ¶
func (*Client) DeleteActionProfileGroup ¶
func (*Client) DeleteActionProfileMember ¶
func (*Client) DeleteCloneSession ¶
func (*Client) DeleteMulticastGroup ¶
func (*Client) DeleteTableEntry ¶
func (*Client) DisableDigest ¶
func (*Client) EnableDigest ¶
func (*Client) GetFwdPipe ¶
func (c *Client) GetFwdPipe(ctx context.Context, responseType GetFwdPipeResponseType) (*FwdPipeConfig, error)
GetFwdPipe retrieves the current pipeline config used in the remote switch.
responseType is oneof:
GetFwdPipeAll, GetFwdPipeCookieOnly, GetFwdPipeP4InfoAndCookie, GetFwdPipeDeviceConfigAndCookie
See https://p4.org/p4runtime/spec/v1.3.0/P4Runtime-Spec.html#sec-getforwardingpipelineconfig-rpc
func (*Client) InsertActionProfileGroup ¶
func (*Client) InsertActionProfileMember ¶
func (*Client) InsertCloneSession ¶
func (*Client) InsertMulticastGroup ¶
func (*Client) InsertTableEntry ¶
func (*Client) ModifyActionProfileGroup ¶
func (*Client) ModifyActionProfileMember ¶
func (*Client) ModifyCounterEntry ¶
func (*Client) ModifyDigest ¶
func (*Client) ModifyTableEntry ¶
func (*Client) NewActionProfileActionSet ¶
func (c *Client) NewActionProfileActionSet() *ActionProfileActionSet
func (*Client) NewActionProfileGroup ¶
func (c *Client) NewActionProfileGroup( actionProfile string, groupID uint32, members []*p4_v1.ActionProfileGroup_Member, size int32, ) *p4_v1.ActionProfileGroup
func (*Client) NewActionProfileMember ¶
func (*Client) NewTableActionDirect ¶
func (c *Client) NewTableActionDirect( action string, params [][]byte, ) *p4_v1.TableAction
func (*Client) NewTableActionGroup ¶
func (c *Client) NewTableActionGroup( groupID uint32, ) *p4_v1.TableAction
func (*Client) NewTableActionMember ¶
func (c *Client) NewTableActionMember( memberID uint32, ) *p4_v1.TableAction
func (*Client) NewTableEntry ¶
func (c *Client) NewTableEntry( table string, mfs map[string]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) ReadCounterEntry ¶
func (*Client) ReadCounterEntryWildcard ¶
func (*Client) ReadEntitySingle ¶
func (*Client) ReadEntityWildcard ¶
func (c *Client) ReadEntityWildcard(ctx context.Context, entity *p4_v1.Entity, readEntityCh chan<- *p4_v1.Entity) error
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) ReadMeterEntry ¶
func (*Client) ReadMeterEntryWildcard ¶
func (*Client) ReadTableEntry ¶
func (c *Client) ReadTableEntry(ctx context.Context, table string, mfs []MatchInterface) (*p4_v1.TableEntry, error)
func (*Client) ReadTableEntryWildcard ¶
func (*Client) Run ¶
func (c *Client) Run( stopCh <-chan struct{}, arbitrationCh chan<- bool, messageCh chan<- *p4_v1.StreamMessageResponse, ) error
func (*Client) SaveFwdPipeFromBytes ¶
func (*Client) SendMessage ¶
func (*Client) SendPacketOut ¶
func (*Client) SetFwdPipe ¶
func (*Client) SetFwdPipeFromBytes ¶
func (*Client) SetFwdPipeFromBytesWithAction ¶
func (c *Client) SetFwdPipeFromBytesWithAction(ctx context.Context, binBytes, p4infoBytes []byte, cookie uint64, action p4_v1.SetForwardingPipelineConfigRequest_Action) (*FwdPipeConfig, error)
type ClientOptions ¶
type ClientOptions struct {
CanonicalBytestrings bool
}
type CloneSessionOptions ¶
type ExactMatch ¶
type ExactMatch struct {
Value []byte
}
type FwdPipeConfig ¶
type FwdPipeConfig struct { P4Info *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.