type Teamserver interface {
// Create tunnel
TsTunnelCreate(AgentId string, Type int, Info string, Lhost string, Lport int, Client string, Thost string, Tport int, AuthUser string, AuthPass string) (string, error)
TsTunnelCreateSocks4(AgentId string, Info string, Lhost string, Lport int) (string, error)
TsTunnelCreateSocks5(AgentId string, Info string, Lhost string, Lport int, UseAuth bool, Username string, Password string) (string, error)
TsTunnelCreateLportfwd(AgentId string, Info string, Lhost string, Lport int, Thost string, Tport int) (string, error)
TsTunnelCreateRportfwd(AgentId string, Info string, Lport int, Thost string, Tport int) (string, error)
// Start/stop
TsTunnelStart(TunnelId string) (string, error)
TsTunnelStop(TunnelId string) error
TsTunnelStopSocks(AgentId string, Port int)
TsTunnelStopLportfwd(AgentId string, Port int)
TsTunnelStopRportfwd(AgentId string, Port int)
// Connection management
TsTunnelChannelExists(channelId int) bool
TsTunnelGetPipe(AgentId string, channelId int) (*io.PipeReader, *io.PipeWriter, error)
TsTunnelConnectionData(channelId int, data []byte)
TsTunnelConnectionResume(AgentId string, channelId int, ioDirect bool)
TsTunnelConnectionClose(channelId int)
TsTunnelConnectionHalt(channelId int, errorCode byte)
TsTunnelConnectionAccept(tunnelId int, channelId int)
// Update Reverse Port Forward
TsTunnelUpdateRportfwd(tunnelId int, result bool) (string, string, error)
}