Documentation ¶
Index ¶
- type Handler
- type HandlerFunc
- type Packet
- type TestHandler
- func (th *TestHandler) Receive(p []Packet) error
- func (th *TestHandler) Send(packets []Packet, rdst net.IP) (int, error)
- func (th *TestHandler) SendOne(packet *Packet, rdst net.IP) (int, error)
- func (th *TestHandler) SetHandler(h HandlerFunc)
- func (th *TestHandler) Start() error
- func (th *TestHandler) Stats() (int, []*Packet)
- func (th *TestHandler) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { Start() error Stop() error Send([]Packet, net.IP) (int, error) SetHandler(HandlerFunc) }
Handler provides methods of forwarding frames to another endpoint
type HandlerFunc ¶
type HandlerFunc func([]Packet)
HandlerFunc allows callbacks when receiving packets from a remote source
type TestHandler ¶
type TestHandler struct { StoreOutbound bool // contains filtered or unexported fields }
TestHandler provides a way to track and drop output packets and simulate inbound packets
func (*TestHandler) Receive ¶
func (th *TestHandler) Receive(p []Packet) error
Receive allows for packet injection into the tap as if coming from OS
func (*TestHandler) SetHandler ¶
func (th *TestHandler) SetHandler(h HandlerFunc)
SetHandler sets the TX handler for l2 forwarding
func (*TestHandler) Stats ¶
func (th *TestHandler) Stats() (int, []*Packet)
Stats provides the handled packet count and any stored packets
Click to show internal directories.
Click to hide internal directories.