Documentation
¶
Index ¶
- Constants
- Variables
- func AuthConn(auth PasswordAuthenticator, conn net.Conn) (err error)
- func RecvWithTimeout(ch chan uint32, t time.Duration) (errno uint32)
- func RegisterNetwork(network string, handler Handler) (ok bool)
- func RunMockServer(wg *sync.WaitGroup) (err error)
- func SendFrame(fiber Fiber, tp uint8, streamid uint16, v interface{}) (err error)
- func SetLogging()
- func WriteFrame(stream io.Writer, tp uint8, streamid uint16, v interface{}) (err error)
- type Addr
- type Auth
- type Client
- type Conn
- func (c *Conn) Accept() (err error)
- func (c *Conn) CheckAndSetStatus(old uint8, new uint8) (err error)
- func (c *Conn) Close() (err error)
- func (c *Conn) CloseFiber(streamid uint16) (err error)
- func (c *Conn) Connect(network, address string) (err error)
- func (c *Conn) Deny() (err error)
- func (c *Conn) Final()
- func (c *Conn) GetStatusString() (st string)
- func (c *Conn) GetStreamId() uint16
- func (c *Conn) GetTarget() (s string)
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(data []byte) (n int, err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) Reset()
- func (c *Conn) SendFrame(f *Frame) (err error)
- 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) String() (s string)
- func (c *Conn) Write(data []byte) (n int, err error)
- type ConnSlice
- type DialerCreator
- type Fabric
- func (fab *Fabric) Close() (err error)
- func (fab *Fabric) CloseFiber(streamid uint16) (err error)
- func (fab *Fabric) GetConnections() (conns ConnSlice)
- func (fab *Fabric) GetSize() int
- func (fab *Fabric) Loop()
- func (fab *Fabric) PutIntoId(id uint16, f Fiber) (err error)
- func (fab *Fabric) PutIntoNextId(f Fiber) (id uint16, err error)
- func (fab *Fabric) SendFrame(f *Frame) (err error)
- func (fab *Fabric) String() string
- func (fab *Fabric) Uptime() (d time.Duration)
- type Fiber
- type Frame
- type Handler
- type Header
- type MockServer
- type PasswordAuthenticator
- type Queue
- type Result
- type Server
- type Syn
- type TcpProxy
- type Tunnel
- type TunnelServer
- type Wnd
Constants ¶
View Source
const ( AUTH_TIMEOUT = 10000 DIAL_TIMEOUT = 20000 WRITE_TIMEOUT = 10000 CLOSE_TIMEOUT = 30000 WINDOWSIZE = 4 * 1024 * 1024 )
View Source
const ( MSG_UNKNOWN = iota MSG_RESULT MSG_AUTH MSG_DATA MSG_SYN MSG_WND MSG_FIN MSG_RST )
View Source
const ( ST_UNKNOWN = 0x00 ST_SYN_RECV = 0x01 ST_SYN_SENT = 0x02 ST_EST = 0x03 ST_FIN_RECV = 0x04 ST_FIN_SENT = 0x06 )
View Source
const ( ERR_NONE = iota ERR_AUTH ERR_IDEXIST ERR_CONNFAILED ERR_TIMEOUT ERR_CLOSED ERR_UNKNOWN_PROTOCOL )
Variables ¶
View Source
var ( ErrFrameOverFlow = errors.New("marshal overflow in frame") ErrUnknownNetwork = errors.New("unknown network.") ErrStreamOutOfID = errors.New("stream out of id.") ErrUnexpectedPkg = errors.New("unexpected package.") ErrIdExist = errors.New("frame sync stream id exist.") ErrState = errors.New("status error.") )
View Source
var ErrnoText = map[uint32]string{ ERR_NONE: "none", ERR_AUTH: "auth failed", ERR_IDEXIST: "stream id existed", ERR_CONNFAILED: "connected failed", ERR_TIMEOUT: "timeout", ERR_CLOSED: "connect closed", }
View Source
var ProtocolHandlers map[string]Handler
View Source
var StatusText = map[uint8]string{ ST_UNKNOWN: "UNKNOWN", ST_SYN_RECV: "SYN_RECV", ST_SYN_SENT: "SYN_SENT", ST_EST: "ESTAB", ST_FIN_RECV: "FIN_RECV", ST_FIN_SENT: "FIN_SENT", }
Functions ¶
func RegisterNetwork ¶
func RunMockServer ¶
func SetLogging ¶
func SetLogging()
Types ¶
type Conn ¶
use lock to protect: status, window. SendFrame are not included.
func (*Conn) CloseFiber ¶
func (*Conn) GetStatusString ¶
func (*Conn) GetStreamId ¶
func (*Conn) RemoteAddr ¶
type DialerCreator ¶
func NewDialerCreator ¶
func NewDialerCreator(raw netutil.Dialer, network, serveraddr, username, password string) (dc *DialerCreator)
func (*DialerCreator) Create ¶
func (dc *DialerCreator) Create() (client *Client, err error)
type MockServer ¶
type MockServer struct {
}
func (*MockServer) AuthPass ¶
func (m *MockServer) AuthPass(username, password string) bool
type PasswordAuthenticator ¶
type TunnelServer ¶
type TunnelServer struct {
*Fabric
}
func NewTunnelServer ¶
func NewTunnelServer(conn net.Conn) (s *TunnelServer)
func (*TunnelServer) CloseFiber ¶
func (s *TunnelServer) CloseFiber(streamid uint16) (err error)
never called as default fiber.
func (*TunnelServer) SendFrame ¶
func (s *TunnelServer) SendFrame(f *Frame) (err error)
Click to show internal directories.
Click to hide internal directories.