Documentation
¶
Overview ¶
Package registry is the registry of protocol on the dataplane.
Index ¶
- type Handler
- type Registry
- func (r *Registry) Context() context.Context
- func (r *Registry) Deregister(name string) error
- func (r *Registry) Recv() (*packetio.PacketOut, error)
- func (r *Registry) Register(name string, h Handler) error
- func (r *Registry) Send(pkt *packetio.PacketIn) error
- func (r *Registry) Start()
- func (r *Registry) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
Matched(*packetio.PacketOut) bool // returns true if this protocol can handle the packet.
Process(*packetio.PacketOut) error // processes the packet and update internal data structure if necessary.
}
Handler handles a protocol.
type Registry ¶
type Registry struct {
pktiopb.PacketIO_CPUPacketStreamClient
// contains filtered or unexported fields
}
Registry is the repository of protocol handler.
func NewRegistry ¶
func NewRegistry(psc pktiopb.PacketIO_CPUPacketStreamClient) (*Registry, error)
NewRegistry takes a packet stream client and returns an empty registry.
func (*Registry) Deregister ¶
Deregister removes a protocol handler from the registry.
Click to show internal directories.
Click to hide internal directories.