session

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToCodeString

func ByteToCodeString(b byte) string

func CodeToString

func CodeToString(code IOCode) string

Types

type IOCode

type IOCode int
const (
	NUL  IOCode = iota // NULL, no operation
	ECHO IOCode = iota // Echo
	SGA  IOCode = iota // Suppress go ahead
	ST   IOCode = iota // Status
	TM   IOCode = iota // Timing mark
	BEL  IOCode = iota // Bell
	BS   IOCode = iota // Backspace
	HT   IOCode = iota // Horizontal tab
	LF   IOCode = iota // Line feed
	FF   IOCode = iota // Form feed
	CR   IOCode = iota // Carriage return
	TT   IOCode = iota // Terminal type
	WS   IOCode = iota // Window size
	TS   IOCode = iota // Terminal speed
	RFC  IOCode = iota // Remote flow control
	LM   IOCode = iota // Line mode
	EV   IOCode = iota // Environment variables
	SE   IOCode = iota // End of sub negotiation parameters.
	NOP  IOCode = iota // No operation.
	DM   IOCode = iota // Data Mark. The data stream portion of a Sync. This should always be accompanied by a TCP Urgent notification.
	BRK  IOCode = iota // Break. NVT character BRK.
	IP   IOCode = iota // Interrupt Process
	AO   IOCode = iota // Abort output
	AYT  IOCode = iota // Are you there
	EC   IOCode = iota // Erase character
	EL   IOCode = iota // Erase line
	GA   IOCode = iota // Go ahead signal
	SB   IOCode = iota // Indicates that what follows is sub negotiation of the indicated option.
	WILL IOCode = iota // Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.
	WONT IOCode = iota // Indicates the refusal to perform, or continue performing, the indicated option.
	DO   IOCode = iota // Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option.
	DONT IOCode = iota // Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option.
	IAC  IOCode = iota // Interpret as command

	// Non-standard codes:
	CMP1 IOCode = iota // MCCP Compress
	CMP2 IOCode = iota // MCCP Compress2
	AARD IOCode = iota // Aardwolf MUD out of band communication, http://www.aardwolf.com/blog/2008/07/10/telnet-negotiation-control-mud-client-interaction/
	ATCP IOCode = iota // Achaea Telnet Client Protocol, http://www.ironrealms.com/rapture/manual/files/FeatATCP-txt.html
	GMCP IOCode = iota // Generic Mud Communication Protocol
)

type Telnet

type Telnet struct {
	// contains filtered or unexported fields
}

func NewTelnet

func NewTelnet(conn net.Conn) *Telnet

func (*Telnet) BuildCommand

func (t *Telnet) BuildCommand(codes ...IOCode) []byte

func (*Telnet) Close

func (t *Telnet) Close() error

func (*Telnet) Data

func (t *Telnet) Data(code IOCode) []byte

func (*Telnet) DoTerminalType

func (t *Telnet) DoTerminalType()

func (*Telnet) DoWindowSize

func (t *Telnet) DoWindowSize()

func (*Telnet) LocalAddr

func (t *Telnet) LocalAddr() net.Addr

func (*Telnet) Read

func (t *Telnet) Read(p []byte) (int, error)

func (*Telnet) RemoteAddr

func (t *Telnet) RemoteAddr() net.Addr

func (*Telnet) SendCommand

func (t *Telnet) SendCommand(codes ...IOCode)

func (*Telnet) SetDeadline

func (t *Telnet) SetDeadline(dl time.Time) error

func (*Telnet) SetListenFunc

func (t *Telnet) SetListenFunc(listenFunc func(IOCode, []byte))

func (*Telnet) SetReadDeadline

func (t *Telnet) SetReadDeadline(dl time.Time) error

func (*Telnet) SetWriteDeadline

func (t *Telnet) SetWriteDeadline(dl time.Time) error

func (*Telnet) WillEcho

func (t *Telnet) WillEcho()

func (*Telnet) WillSga

func (t *Telnet) WillSga()

func (*Telnet) WontEcho

func (t *Telnet) WontEcho()

func (*Telnet) Write

func (t *Telnet) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL