Documentation
¶
Overview ¶
Package telnet implements the RFC854 Telnet Protocol Specification, as well as:
RFC855 Telnet Option Specifications RFC1143 The Q Method of Implementing TELNET Option Negotiation
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Trace = log.New(ioutil.Discard, "[TRCE]", log.LstdFlags|log.Lmicroseconds|log.Lshortfile) Debug = log.New(ioutil.Discard, "[DBUG]", log.LstdFlags|log.Lshortfile) Error = log.New(ioutil.Discard, "[ERRO]", log.LstdFlags|log.Lshortfile) )
Loggers.
var (
ErrNegAskDenied = errors.New("Ask violates let")
)
Errors.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command byte
Command is a telnet command.
const ( EOF Command = 236 + iota // End of File character SP // Suspend Process AP // Abort Process EOR // End Of Record NOP // No Operation DM // Data Mark BRK // Break IP // Interrupt Process AO // Abort Output AYT // Are You There EC // Erase Character EL // Erase Line GA // Go Ahead )
RFC854 telnet commands.
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
Ctx is a telnet context.
func NewReadWriter ¶
func NewReadWriter(rw io.ReadWriter, opts ...Option) *Ctx
NewReadWriter allocates a new ReadWriter that intercepts and handles telnet negotiations and dispatches remaining data to rw. Any options that are provided will be available for negotiation.
func (*Ctx) Read ¶
Read is a telnet Reader.
The Reader provided by the client is read and command sequences are parsed and executed. If a non-empty buffer is passed then data will be passed as-is.
func (Ctx) SendParams ¶
SendParams sends option subnegotiation parameters.
type Option ¶
type Option interface { // Byte returns the byte code of the option. Byte() byte // String is the text name of the option (for debugging). String() string // LetHim indicates if he is allowed to enable the option. LetHim() bool // LetUs indicates if we are willing to enable the option. LetUs() bool // Params is called when subnegotiation parameters are received. Params(tn *Ctx, params []byte) // SetHim sets the option state for him. SetHim(tn *Ctx, enabled bool) // SetUs sets the option state for us. SetUs(tn *Ctx, enabled bool) }
Option is an interface for implementing telnet options.
Directories
¶
Path | Synopsis |
---|---|
Package option implements several RFC855 Telnet Option Specifications, including: RFC857 Telnet Echo Option RFC858 Telnet Suppress Go Ahead Option RFC1091 Telnet Terminal-Type Option
|
Package option implements several RFC855 Telnet Option Specifications, including: RFC857 Telnet Echo Option RFC858 Telnet Suppress Go Ahead Option RFC1091 Telnet Terminal-Type Option |