message

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SSH_MSG_CHANNEL_CLOSE = 97
View Source
const SSH_MSG_CHANNEL_DATA = 94
View Source
const SSH_MSG_CHANNEL_EOF = 96
View Source
const SSH_MSG_CHANNEL_EXTENDED_DATA = 95
View Source
const SSH_MSG_CHANNEL_FAILURE = 100
View Source
const SSH_MSG_CHANNEL_OPEN = 90
View Source
const SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91
View Source
const SSH_MSG_CHANNEL_OPEN_FAILURE = 92
View Source
const SSH_MSG_CHANNEL_REQUEST = 98
View Source
const SSH_MSG_CHANNEL_SUCCESS = 99
View Source
const SSH_MSG_CHANNEL_WINDOW_ADJUST = 93
View Source
const SSH_MSG_DEBUG = 4
View Source
const SSH_MSG_DISCONNECT = 1

ssh messages type

View Source
const SSH_MSG_GLOBAL_REQUEST = 80
View Source
const SSH_MSG_IGNORE = 2
View Source
const SSH_MSG_KEXINIT = 20
View Source
const SSH_MSG_NEWKEYS = 21
View Source
const SSH_MSG_REQUEST_FAILURE = 82
View Source
const SSH_MSG_REQUEST_SUCCESS = 81
View Source
const SSH_MSG_SERVICE_ACCEPT = 6
View Source
const SSH_MSG_SERVICE_REQUEST = 5
View Source
const SSH_MSG_UNIMPLEMENTED = 3
View Source
const SSH_MSG_USERAUTH_BANNER = 53
View Source
const SSH_MSG_USERAUTH_FAILURE = 51
View Source
const SSH_MSG_USERAUTH_REQUEST = 50
View Source
const SSH_MSG_USERAUTH_SUCCESS = 52

Variables

View Source
var ChannelRequestParseFuncs = map[string]func(util.Reader) (ChannelRequest, error){
	"pty-req":       ParsePtyRequest,
	"x11-req":       ParseX11Request,
	"shell":         ParseShellRequest,
	"exec":          ParseExecRequest,
	"subsystem":     ParseSubsystemRequest,
	"window-change": ParseWindowChangeRequest,
	"signal":        ParseSignalRequest,
	"exit-status":   ParseExitStatusRequest,
	"exit-signal":   ParseExitSignalRequest,
}

Functions

This section is empty.

Types

type ChannelOpenConfirmationMessage

type ChannelOpenConfirmationMessage struct {
	MaxPacketSize uint64
}

func ParseChannelOpenConfirmationMessage

func ParseChannelOpenConfirmationMessage(buf util.Reader) (*ChannelOpenConfirmationMessage, error)

func (*ChannelOpenConfirmationMessage) Length

func (m *ChannelOpenConfirmationMessage) Length() int

func (*ChannelOpenConfirmationMessage) Write

func (m *ChannelOpenConfirmationMessage) Write(buf []byte) (consumed int, err error)

type ChannelOpenFailureMessage

type ChannelOpenFailureMessage struct {
	ReasonCode       uint64
	ErrorMessageUTF8 string
	LanguageTag      string
}

func ParseChannelOpenFailureMessage

func ParseChannelOpenFailureMessage(buf util.Reader) (*ChannelOpenFailureMessage, error)

func (*ChannelOpenFailureMessage) Length

func (m *ChannelOpenFailureMessage) Length() int

func (*ChannelOpenFailureMessage) Write

func (m *ChannelOpenFailureMessage) Write(buf []byte) (consumed int, err error)

type ChannelRequest

type ChannelRequest interface {
	Write(buf []byte) (n int, err error)
	Length() int
	RequestTypeStr() string
}

func ParseExecRequest

func ParseExecRequest(buf util.Reader) (ChannelRequest, error)

func ParseExitSignalRequest

func ParseExitSignalRequest(buf util.Reader) (ChannelRequest, error)

func ParseExitStatusRequest

func ParseExitStatusRequest(buf util.Reader) (ChannelRequest, error)

func ParseForwardingRequest

func ParseForwardingRequest(buf util.Reader) (ChannelRequest, error)

func ParsePtyRequest

func ParsePtyRequest(buf util.Reader) (ChannelRequest, error)

func ParseShellRequest

func ParseShellRequest(buf util.Reader) (ChannelRequest, error)

func ParseSignalRequest

func ParseSignalRequest(buf util.Reader) (ChannelRequest, error)

func ParseSubsystemRequest

func ParseSubsystemRequest(buf util.Reader) (ChannelRequest, error)

func ParseWindowChangeRequest

func ParseWindowChangeRequest(buf util.Reader) (ChannelRequest, error)

func ParseX11Request

func ParseX11Request(buf util.Reader) (ChannelRequest, error)

type ChannelRequestMessage

type ChannelRequestMessage struct {
	WantReply bool
	ChannelRequest
}

func ParseRequestMessage

func ParseRequestMessage(buf util.Reader) (*ChannelRequestMessage, error)

The buffer points to the request-type attribute

func (*ChannelRequestMessage) Length

func (m *ChannelRequestMessage) Length() (n int)

func (*ChannelRequestMessage) Write

func (m *ChannelRequestMessage) Write(buf []byte) (consumed int, err error)

type DataOrExtendedDataMessage

type DataOrExtendedDataMessage struct {
	DataType SSHDataType
	Data     string
}

func ParseDataMessage

func ParseDataMessage(buf util.Reader) (*DataOrExtendedDataMessage, error)

func ParseExtendedDataMessage

func ParseExtendedDataMessage(buf util.Reader) (*DataOrExtendedDataMessage, error)

func (*DataOrExtendedDataMessage) Length

func (m *DataOrExtendedDataMessage) Length() int

func (*DataOrExtendedDataMessage) Write

func (m *DataOrExtendedDataMessage) Write(buf []byte) (consumed int, err error)

type ExecRequest

type ExecRequest struct {
	Command string
}

func (*ExecRequest) Length

func (r *ExecRequest) Length() int

func (*ExecRequest) RequestTypeStr

func (r *ExecRequest) RequestTypeStr() string

func (*ExecRequest) Write

func (r *ExecRequest) Write(buf []byte) (int, error)

type ExitSignalRequest

type ExitSignalRequest struct {
	SignalNameWithoutSig string
	CoreDumped           bool
	ErrorMessageUTF8     string
	LanguageTag          string
}

func (*ExitSignalRequest) Length

func (r *ExitSignalRequest) Length() int

func (*ExitSignalRequest) RequestTypeStr

func (r *ExitSignalRequest) RequestTypeStr() string

func (*ExitSignalRequest) Write

func (r *ExitSignalRequest) Write(buf []byte) (consumed int, err error)

type ExitStatusRequest

type ExitStatusRequest struct {
	ExitStatus uint64
}

func (*ExitStatusRequest) Length

func (r *ExitStatusRequest) Length() int

func (*ExitStatusRequest) RequestTypeStr

func (r *ExitStatusRequest) RequestTypeStr() string

func (*ExitStatusRequest) Write

func (r *ExitStatusRequest) Write(buf []byte) (int, error)

type ForwardingRequest

type ForwardingRequest struct {
	Protocol      util.SSHForwardingProtocol
	AddressFamily util.SSHForwardingAddressFamily
	IpAddress     net.IP
	Port          uint16
}

func (*ForwardingRequest) Length

func (r *ForwardingRequest) Length() int

func (*ForwardingRequest) RequestTypeStr

func (r *ForwardingRequest) RequestTypeStr() string

func (*ForwardingRequest) Write

func (r *ForwardingRequest) Write(buf []byte) (consumed int, err error)

type Message

type Message interface {
	Write(buf []byte) (n int, err error)
	Length() int
}

func ParseMessage

func ParseMessage(r util.Reader) (Message, error)

type PtyRequest

type PtyRequest struct {
	Term                 string
	CharWidth            uint64
	CharHeight           uint64
	PixelWidth           uint64
	PixelHeight          uint64
	EncodedTerminalModes string
}

see RFC4254 Sec 6.2

func (*PtyRequest) Length

func (r *PtyRequest) Length() int

func (*PtyRequest) RequestTypeStr

func (r *PtyRequest) RequestTypeStr() string

func (*PtyRequest) Write

func (r *PtyRequest) Write(buf []byte) (consumed int, err error)

type SSHDataType

type SSHDataType uint64
const (
	SSH_EXTENDED_DATA_NONE   SSHDataType = 0
	SSH_EXTENDED_DATA_STDERR SSHDataType = 1
)

type ShellRequest

type ShellRequest struct{}

func (*ShellRequest) Length

func (r *ShellRequest) Length() int

func (*ShellRequest) RequestTypeStr

func (r *ShellRequest) RequestTypeStr() string

func (*ShellRequest) Write

func (r *ShellRequest) Write(buf []byte) (int, error)

type SignalRequest

type SignalRequest struct {
	SignalNameWithoutSig string
}

func (*SignalRequest) Length

func (r *SignalRequest) Length() int

func (*SignalRequest) RequestTypeStr

func (r *SignalRequest) RequestTypeStr() string

func (*SignalRequest) Write

func (r *SignalRequest) Write(buf []byte) (int, error)

type SubsystemRequest

type SubsystemRequest struct {
	SubsystemName string
}

func (*SubsystemRequest) Length

func (r *SubsystemRequest) Length() int

func (*SubsystemRequest) RequestTypeStr

func (r *SubsystemRequest) RequestTypeStr() string

func (*SubsystemRequest) Write

func (r *SubsystemRequest) Write(buf []byte) (int, error)

type WindowChangeRequest

type WindowChangeRequest struct {
	CharWidth   uint64
	CharHeight  uint64
	PixelWidth  uint64
	PixelHeight uint64
}

func (*WindowChangeRequest) Length

func (r *WindowChangeRequest) Length() int

func (*WindowChangeRequest) RequestTypeStr

func (r *WindowChangeRequest) RequestTypeStr() string

func (*WindowChangeRequest) Write

func (r *WindowChangeRequest) Write(buf []byte) (consumed int, err error)

type X11Request

type X11Request struct {
	SingleConnection          bool
	X11AuthenticationProtocol string
	X11AuthenticationCookie   string
	X11ScreenNumber           uint64
}

see RFC4254 Sec 6.3.1

func (*X11Request) Length

func (r *X11Request) Length() int

func (*X11Request) RequestTypeStr

func (r *X11Request) RequestTypeStr() string

func (*X11Request) Write

func (r *X11Request) Write(buf []byte) (consumed int, err error)

Jump to

Keyboard shortcuts

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