Documentation ¶
Index ¶
- Constants
- 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) SetBindToDev(devName string) error
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetDontRoute() error
- func (c *Conn) SetNoDelay() error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetTTL(ttl uint8) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (n int, err error)
- type ConnI
- type ConnWithVRF
- type Listener
- type ListenerFactory
- type ListenerFactoryI
- type ListenerI
- type ListenerManager
- func (lm *ListenerManager) AcceptCh() chan ConnWithVRF
- func (lm *ListenerManager) CreateListenersIfNotExists(v *vrf.VRF) error
- func (lm *ListenerManager) GetListeners(v *vrf.VRF) []ListenerI
- func (lm *ListenerManager) ListenAddrsPerVRF(vrf *vrf.VRF) []string
- func (lm *ListenerManager) SetListenerFactory(lf ListenerFactoryI)
- type ListenerManagerI
- 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) ReadFromOtherEnd() []byte
- func (c *MockConn) RemoteAddr() net.Addr
- func (c *MockConn) SetBindToDev(devName string) error
- func (c *MockConn) SetDeadline(t time.Time) error
- func (c *MockConn) SetDontRoute() error
- func (c *MockConn) SetNoDelay() error
- func (c *MockConn) SetReadDeadline(t time.Time) error
- func (c *MockConn) SetTTL(ttl uint8) error
- func (c *MockConn) SetWriteDeadline(t time.Time) error
- func (c *MockConn) Write(b []byte) (n int, err error)
- func (c *MockConn) WriteFromOtherEnd(b []byte)
- type MockListener
- type MockListenerFactory
Constants ¶
View Source
const ( // SOL_IP is not defined on darwin SOL_IP = 0x0 // SOL_IPV6 is not defined on darwin SOL_IPV6 = 0x29 )
View Source
const BGPPORT = 179
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is TCP connection
func Dial ¶
func Dial(laddr, raddr *net.TCPAddr, ttl uint8, md5Secret string, noRoute bool, bindDev string) (*Conn, error)
Dial established a new TCP connection
func (*Conn) SetBindToDev ¶ added in v0.1.8
SetBindToDev sets the SO_BINDTODEVICE option
func (*Conn) SetDeadline ¶
SetDeadline is here to fulfill net.Conn interface
func (*Conn) SetDontRoute ¶
SetDontRoute sets the SO_DONTROUTE option
func (*Conn) SetReadDeadline ¶
SetReadDeadline is here to fulfill net.Conn interface
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline is here to fulfill net.Conn interface
type ConnI ¶ added in v0.1.8
type ConnI interface { Write(b []byte) (n int, err error) Read(b []byte) (n int, err error) Close() error LocalAddr() net.Addr RemoteAddr() net.Addr SetDeadline(t time.Time) error SetReadDeadline(t time.Time) error SetWriteDeadline(t time.Time) error SetTTL(ttl uint8) error SetDontRoute() error SetNoDelay() error SetBindToDev(devName string) error }
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener listens for TCP clients
type ListenerFactory ¶ added in v0.1.8
type ListenerFactory struct{}
func NewListenerFactory ¶ added in v0.1.8
func NewListenerFactory() *ListenerFactory
func (*ListenerFactory) NewListener ¶ added in v0.1.8
func (lf *ListenerFactory) NewListener(v *vrf.VRF, laddr *net.TCPAddr, ttl uint8) (ListenerI, error)
NewListener starts a TCPListener
type ListenerFactoryI ¶ added in v0.1.8
type ListenerManager ¶ added in v0.1.8
type ListenerManager struct {
// contains filtered or unexported fields
}
func NewListenerManager ¶ added in v0.1.8
func NewListenerManager(listenAddrsByVRF map[string][]string) *ListenerManager
func (*ListenerManager) AcceptCh ¶ added in v0.1.8
func (lm *ListenerManager) AcceptCh() chan ConnWithVRF
func (*ListenerManager) CreateListenersIfNotExists ¶ added in v0.1.8
func (lm *ListenerManager) CreateListenersIfNotExists(v *vrf.VRF) error
func (*ListenerManager) GetListeners ¶ added in v0.1.8
func (lm *ListenerManager) GetListeners(v *vrf.VRF) []ListenerI
func (*ListenerManager) ListenAddrsPerVRF ¶ added in v0.1.8
func (lm *ListenerManager) ListenAddrsPerVRF(vrf *vrf.VRF) []string
func (*ListenerManager) SetListenerFactory ¶ added in v0.1.8
func (lm *ListenerManager) SetListenerFactory(lf ListenerFactoryI)
type ListenerManagerI ¶ added in v0.1.8
type MockConn ¶ added in v0.1.8
type MockConn struct {
// contains filtered or unexported fields
}
MockConn is mocked TCP connection
func NewMockConn ¶ added in v0.1.8
func (*MockConn) ReadFromOtherEnd ¶ added in v0.1.8
func (*MockConn) RemoteAddr ¶ added in v0.1.8
func (*MockConn) SetBindToDev ¶ added in v0.1.8
func (*MockConn) SetDeadline ¶ added in v0.1.8
SetDeadline is here to fulfill net.Conn interface
func (*MockConn) SetDontRoute ¶ added in v0.1.8
func (*MockConn) SetNoDelay ¶ added in v0.1.8
func (*MockConn) SetReadDeadline ¶ added in v0.1.8
func (*MockConn) SetWriteDeadline ¶ added in v0.1.8
func (*MockConn) WriteFromOtherEnd ¶ added in v0.1.8
type MockListener ¶ added in v0.1.8
type MockListener struct {
// contains filtered or unexported fields
}
func (*MockListener) AcceptTCP ¶ added in v0.1.8
func (l *MockListener) AcceptTCP() (ConnI, error)
AcceptTCP accepts a new TCP connection
type MockListenerFactory ¶ added in v0.1.8
type MockListenerFactory struct{}
func NewMockListenerFactory ¶ added in v0.1.8
func NewMockListenerFactory() *MockListenerFactory
func (*MockListenerFactory) NewListener ¶ added in v0.1.8
Click to show internal directories.
Click to hide internal directories.