p4runtime

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package p4runtime implements the simulated P4Runtime service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	p4api.UnimplementedP4RuntimeServer
	// contains filtered or unexported fields
}

Server implements the P4Runtime API

func NewServer

func NewServer(deviceID simapi.DeviceID, simulation *simulator.Simulation) *Server

NewServer creates a new P4Runtime API server

func (*Server) Capabilities

func (s *Server) Capabilities(ctx context.Context, request *p4api.CapabilitiesRequest) (*p4api.CapabilitiesResponse, error)

Capabilities responds with the device P4Runtime capabilities

func (*Server) GetForwardingPipelineConfig

GetForwardingPipelineConfig retrieves the current forwarding pipeline configuration

func (*Server) Read

func (s *Server) Read(request *p4api.ReadRequest, server p4api.P4Runtime_ReadServer) error

Read receives a query and stream back all requested entities

func (*Server) SetForwardingPipelineConfig

SetForwardingPipelineConfig sets the forwarding pipeline configuration

func (*Server) StreamChannel

func (s *Server) StreamChannel(server p4api.P4Runtime_StreamChannelServer) error

StreamChannel reads and handles incoming requests and emits any queued up outgoing responses

func (*Server) Write

func (s *Server) Write(ctx context.Context, request *p4api.WriteRequest) (*p4api.WriteResponse, error)

Write applies a set of updates to the device

Jump to

Keyboard shortcuts

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