Documentation
¶
Index ¶
- type BPF
- type BPFTerm
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (n int, err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (n int, err error)
- type EthAddr
- type Handler
- type HandlerInterface
- type LLC
- type MACAddr
- type MockConn
- func (c *MockConn) Close() error
- func (c *MockConn) LocalAddr() net.Addr
- func (c *MockConn) Read(b []byte) (n int, err error)
- func (c *MockConn) RemoteAddr() net.Addr
- func (c *MockConn) SetDeadline(t time.Time) error
- func (c *MockConn) SetReadDeadline(t time.Time) error
- func (c *MockConn) SetWriteDeadline(t time.Time) error
- func (c *MockConn) Write(b []byte) (n int, err error)
- type MockHandler
- func (m *MockHandler) Close()
- func (m *MockHandler) GetMTU() int
- func (m *MockHandler) MCastJoin(addr MACAddr) error
- func (m *MockHandler) NewConn(dest MACAddr) net.Conn
- func (m *MockHandler) RecvPacket() (pkt []byte, src MACAddr, err error)
- func (m *MockHandler) SendPacket(dst MACAddr, pkt []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BPF ¶
type BPF struct {
// contains filtered or unexported fields
}
BPF represents a Berkeley Packet Filter
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a wrapper that implements net.Conn and sents packets to a particular destination (write only)
func (*Conn) RemoteAddr ¶
RemoteAddr returns the remote address
func (*Conn) SetDeadline ¶
SetDeadline is here to fulfill the net.Conn interface
func (*Conn) SetReadDeadline ¶
SetReadDeadline is here to fulfill the net.Conn interface
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline is here to fulfill the net.Conn interface
type EthAddr ¶
type EthAddr struct {
// contains filtered or unexported fields
}
EthAddr implements net.Addr
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is an Ethernet handler
func NewHandler ¶
NewHandler creates a new Ethernet handler
func (*Handler) RecvPacket ¶
RecvPacket receives a packet on the ethernet handler
type HandlerInterface ¶
type HandlerInterface interface { NewConn(dest MACAddr) net.Conn RecvPacket() (pkt []byte, src MACAddr, err error) SendPacket(dst MACAddr, pkt []byte) error MCastJoin(addr MACAddr) error GetMTU() int Close() }
HandlerInterface is an handler interface
func NewMockHandler ¶
func NewMockHandler() HandlerInterface
NewMockHandler creates a new mock handler
type MockConn ¶
type MockConn struct { C *btesting.MockConnBidi // contains filtered or unexported fields }
MockConn is a mock of Conn
func (*MockConn) RemoteAddr ¶
RemoteAddr returns the remote address
func (*MockConn) SetDeadline ¶
SetDeadline is here to fulfill the net.Conn interface
func (*MockConn) SetReadDeadline ¶
SetReadDeadline is here to fulfill the net.Conn interface
func (*MockConn) SetWriteDeadline ¶
SetWriteDeadline is here to fulfill the net.Conn interface
type MockHandler ¶
type MockHandler struct { }
MockHandler mocks an ethernet handler
func (*MockHandler) GetMTU ¶
func (m *MockHandler) GetMTU() int
GetMTU is here to fulfill an interface
func (*MockHandler) MCastJoin ¶
func (m *MockHandler) MCastJoin(addr MACAddr) error
MCastJoin is here to fulfill an interface
func (*MockHandler) NewConn ¶
func (m *MockHandler) NewConn(dest MACAddr) net.Conn
NewConn creates a new mocked ethernet conn
func (*MockHandler) RecvPacket ¶
func (m *MockHandler) RecvPacket() (pkt []byte, src MACAddr, err error)
RecvPacket to be implemented
func (*MockHandler) SendPacket ¶
func (m *MockHandler) SendPacket(dst MACAddr, pkt []byte) error
SendPacket is here to fulfill an interface