appsdk

package
v0.1.8 Latest Latest
Warning

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

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

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 TargetClient

type TargetClient interface {
	ID() topoapi.ID
	Capabilities(ctx context.Context, opts ...grpc.CallOption) (*p4api.CapabilitiesResponse, error)
	Read(ctx context.Context, entities []*p4api.Entity, ch chan *p4api.Entity, opts ...grpc.CallOption) error
	Write(ctx context.Context, updates []*p4api.Update, atomicity p4api.WriteRequest_Atomicity, opts ...grpc.CallOption) (*p4api.WriteResponse, error)
	GetForwardingPipelineConfig(ctx context.Context, responseType p4api.GetForwardingPipelineConfigRequest_ResponseType, opts ...grpc.CallOption) (*p4api.GetForwardingPipelineConfigResponse, error)
	PacketIn(ch 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