Documentation ¶
Overview ¶
Package p4runtime implements the simulated P4Runtime service
Index ¶
- type Server
- func (s *Server) Capabilities(ctx context.Context, request *p4api.CapabilitiesRequest) (*p4api.CapabilitiesResponse, error)
- func (s *Server) GetForwardingPipelineConfig(ctx context.Context, request *p4api.GetForwardingPipelineConfigRequest) (*p4api.GetForwardingPipelineConfigResponse, error)
- func (s *Server) Read(request *p4api.ReadRequest, server p4api.P4Runtime_ReadServer) error
- func (s *Server) SetForwardingPipelineConfig(ctx context.Context, request *p4api.SetForwardingPipelineConfigRequest) (*p4api.SetForwardingPipelineConfigResponse, error)
- func (s *Server) StreamChannel(server p4api.P4Runtime_StreamChannelServer) error
- func (s *Server) Write(ctx context.Context, request *p4api.WriteRequest) (*p4api.WriteResponse, error)
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 ¶
func (s *Server) GetForwardingPipelineConfig(ctx context.Context, request *p4api.GetForwardingPipelineConfigRequest) (*p4api.GetForwardingPipelineConfigResponse, error)
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 ¶
func (s *Server) SetForwardingPipelineConfig(ctx context.Context, request *p4api.SetForwardingPipelineConfigRequest) (*p4api.SetForwardingPipelineConfigResponse, error)
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
Click to show internal directories.
Click to hide internal directories.