p4rt

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CAPath      string
	KeyPath     string
	CertPath    string
	TopoAddress string
}

Config is a manager

type Controller

type Controller struct {
	Config Config
	// contains filtered or unexported fields
}

Controller p4rt controller

func StartController

func StartController(cfg Config) *Controller

StartController creates a new P4RTController instance and starts it

func (*Controller) Client

func (c *Controller) Client(ctx context.Context, targetID topoapi.ID) (TargetClient, error)

Client returns a master client for the given target

type PipelineConfigSpec

type PipelineConfigSpec struct {
	P4Info         *p4configapi.P4Info
	P4DeviceConfig []byte
	Action         p4api.SetForwardingPipelineConfigRequest_Action
}

PipelineConfigSpec pipeline config info

type TargetClient

type TargetClient interface {
	ID() topoapi.ID
	Capabilities(ctx context.Context, opts ...grpc.CallOption) (*p4api.CapabilitiesResponse, error)
	Read(ctx context.Context, entities []*p4api.Entity, opts ...grpc.CallOption) ([]*p4api.Entity, error)
	Write(ctx context.Context, updates []*p4api.Update, atomicity p4api.WriteRequest_Atomicity, opts ...grpc.CallOption) (*p4api.WriteResponse, error)
	SetForwardingPipelineConfig(ctx context.Context, spec *PipelineConfigSpec, opts ...grpc.CallOption) (*p4api.SetForwardingPipelineConfigResponse, error)
	GetForwardingPipelineConfig(ctx context.Context, responseType p4api.GetForwardingPipelineConfigRequest_ResponseType, opts ...grpc.CallOption) (*p4api.GetForwardingPipelineConfigResponse, error)
	PacketIn(outputCh chan *p4api.PacketIn) error
	PacketOut(packetOut *p4api.PacketOut) error
}

TargetClient an interface to interact with the P4 programmable device via P4Runtime API

Jump to

Keyboard shortcuts

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