Documentation ¶
Index ¶
Constants ¶
View Source
const ( IAC nvtCmd = 255 // 0xFF Interpret as Command DONT nvtCmd = 254 // 0xFE Don't do something DO nvtCmd = 253 // 0xFD Do something WONT nvtCmd = 252 // 0xFC Won't do something WILL nvtCmd = 251 // 0xFB Will do something SB nvtCmd = 250 // 0xFA Subnegotiation Begin GA nvtCmd = 249 // 0xF9 Go Ahead EL nvtCmd = 248 // 0xF8 Erase Line EC nvtCmd = 247 // 0xF7 Erase Character AYT nvtCmd = 246 // 0xF6 Are You Here? NOP nvtCmd = 241 // 0xF1 No operation SE nvtCmd = 240 // 0xF0 Subnegotiation End )
View Source
const ( O_GMCP nvtOpt = 201 // 0xC9 Generic MUD Communication Protocol O_ZMP nvtOpt = 93 // 0x5D Zenith MUD Protocol O_MXP nvtOpt = 91 // 0x5B MUD eXtension Protocol O_MSSP nvtOpt = 70 // 0x46 MUD Server Status Protocol O_NENV nvtOpt = 39 // 0x27 [RFC1572] New Environment O_NAWS nvtOpt = 31 // 0x1F [RFC1073] Negotiate About Window Size O_TTYPE nvtOpt = 24 // 0x18 [RFC1091] Terminal Type O_ECHO nvtOpt = 1 // 0x01 [RFC857] Echo O_BINARY nvtOpt = 0 // 0x00 [RFC856] Binary Transmission )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IACPacket ¶
type IACPacket struct {
// contains filtered or unexported fields
}
type IACParseStatus ¶
type IACParseStatus int
const ( WANT_CMD IACParseStatus = iota WANT_OPT WANT_SUBOPT WANT_DATA WANT_NOTHING )
type IACReactor ¶
type IACReactor struct {
// contains filtered or unexported fields
}
func NewIACReactor ¶
func NewIACReactor(cfg *NVTOptionConfig) *IACReactor
func (*IACReactor) React ¶
func (r *IACReactor) React(m *IACPacket) *IACPacket
type NVT ¶
type NVT struct { Option *SessionOption // contains filtered or unexported fields }
Session is a telnet session based on net.Conn
func NewNVT ¶
func NewNVT(ch chan<- []byte, host, port string, opt *SessionOption) *NVT
NewSession will return a new session with host and output message to out
type NVTCommand ¶
type NVTCommandHandler ¶
type NVTCommandHandler func(cfg *NVTOptionConfig, data *IACPacket) *IACPacket
type NVTCommandHandlerMap ¶
type NVTCommandHandlerMap map[NVTCommand]NVTCommandHandler
type NVTOptionConfig ¶
type NVTOptionConfig struct {
// contains filtered or unexported fields
}
func NewNVTOptionConfig ¶
func NewNVTOptionConfig() *NVTOptionConfig
func (*NVTOptionConfig) Get ¶
func (c *NVTOptionConfig) Get(o NVTOption) bool
func (*NVTOptionConfig) GetRemote ¶
func (c *NVTOptionConfig) GetRemote(o NVTOption) bool
func (*NVTOptionConfig) Set ¶
func (c *NVTOptionConfig) Set(o NVTOption, v bool)
type ScheduleTask ¶
type ScheduleTask struct {
// contains filtered or unexported fields
}
type SessionOption ¶
type SessionOption struct { DebugColor bool DebugAnsiColor bool DebugIAC bool GAVisible bool NVTOptionCfg *NVTOptionConfig }
SessionOption contains some options of session
type TaskHandler ¶
type TaskHandler func()
type TickTaskMap ¶
type TickTaskMap map[time.Duration][]ScheduleTask
Click to show internal directories.
Click to hide internal directories.