telnet

package
v0.0.0-...-9842712 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0, ISC, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IAC                = byte(255) //Interpret as command
	DONT               = byte(254)
	DO                 = byte(253)
	WONT               = byte(252)
	WILL               = byte(251)
	GO_AHEAD           = byte(249) // Special go ahead command
	IAC_CMD_LENGTH     = 3         // IAC commands take 3 bytes (inclusive)
	READ_BUFFER_LENGTH = 8192
)

RFC 854 - https://tools.ietf.org/html/rfc854

Variables

This section is empty.

Functions

func GetTelnetBanner

func GetTelnetBanner(logStruct *TelnetLog, conn net.Conn, maxReadSize int) (err error)

func NegotiateOptions

func NegotiateOptions(logStruct *TelnetLog, conn net.Conn) error

Types

type TelnetLog

type TelnetLog struct {
	Banner string         `json:"banner,omitempty"`
	Will   []TelnetOption `json:"will,omitempty"`
	Do     []TelnetOption `json:"do,omitempty"`
	Wont   []TelnetOption `json:"wont,omitempty"`
	Dont   []TelnetOption `json:"dont,omitempty"`
}

type TelnetOption

type TelnetOption uint16

func (*TelnetOption) MarshalJSON

func (opt *TelnetOption) MarshalJSON() ([]byte, error)

func (*TelnetOption) Name

func (opt *TelnetOption) Name() string

func (*TelnetOption) UnmarshalJSON

func (opt *TelnetOption) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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