agentprotocol

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CONNECTION_TYPE_X11            = iota
	CONNECTION_TYPE_PORT_FORWARD   = iota
	CONNECTION_TYPE_PORT_DIAL      = iota
	CONNECTION_TYPE_SOCKET_FORWARD = iota
	CONNECTION_TYPE_SOCKET_DIAL    = iota
)
View Source
const (
	PROTOCOL_TCP  string = "tcp"
	PROTOCOL_UNIX string = "unix"
)
View Source
const (
	PACKET_SETUP = iota
	PACKET_SUCCESS
	PACKET_ERROR
	PACKET_DATA
	PACKET_NEW_CONNECTION
	PACKET_CLOSE_CONNECTION
	PACKET_NO_MORE_CONNECTIONS
)
View Source
const (
	CONNECTION_STATE_WAITINIT = iota
	CONNECTION_STATE_STARTED
	CONNECTION_STATE_WAITCLOSE
	CONNECTION_STATE_CLOSED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func (*Connection) Accept

func (c *Connection) Accept() error

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) CloseImm

func (c *Connection) CloseImm() error

func (*Connection) Details

func (c *Connection) Details() NewConnectionPayload

func (*Connection) Read

func (c *Connection) Read(p []byte) (n int, err error)

func (*Connection) Reject

func (c *Connection) Reject() error

func (*Connection) Write

func (c *Connection) Write(data []byte) (n int, err error)

type ForwardCtx

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

func NewForwardCtx

func NewForwardCtx(fromBackend io.Reader, toBackend io.Writer, logger log.Logger) *ForwardCtx

func (*ForwardCtx) Kill

func (c *ForwardCtx) Kill()

func (*ForwardCtx) NewConnectionTCP

func (c *ForwardCtx) NewConnectionTCP(
	connectedAddress string,
	connectedPort uint32,
	origAddress string,
	origPort uint32,
	closeFunc func() error,
) (io.ReadWriteCloser, error)

func (*ForwardCtx) NewConnectionUnix

func (c *ForwardCtx) NewConnectionUnix(
	path string,
	closeFunc func() error,
) (io.ReadWriteCloser, error)

func (*ForwardCtx) NoMoreConnections

func (c *ForwardCtx) NoMoreConnections() error

func (*ForwardCtx) StartClient

func (c *ForwardCtx) StartClient() (connectionType uint32, setupPacket SetupPacket, connChan chan *Connection, err error)

func (*ForwardCtx) StartReverseForwardClient

func (c *ForwardCtx) StartReverseForwardClient(bindHost string, bindPort uint32, singleConnection bool) (chan *Connection, error)

func (*ForwardCtx) StartReverseForwardClientUnix

func (c *ForwardCtx) StartReverseForwardClientUnix(path string, singleConnection bool) (chan *Connection, error)

func (*ForwardCtx) StartServerForward

func (c *ForwardCtx) StartServerForward() (chan *Connection, error)

func (*ForwardCtx) StartX11ForwardClient

func (c *ForwardCtx) StartX11ForwardClient(singleConnection bool, screen string, authProtocol string, authCookie string) (chan *Connection, error)

func (*ForwardCtx) WaitFinish

func (c *ForwardCtx) WaitFinish()

type NewConnectionPayload

type NewConnectionPayload struct {
	Protocol string

	ConnectedAddress  string
	ConnectedPort     uint32
	OriginatorAddress string
	OriginatorPort    uint32
}

type Packet

type Packet struct {
	Type         int
	ConnectionId uint64
	Payload      []byte
}

type SetupPacket

type SetupPacket struct {
	ConnectionType uint32
	BindHost       string
	BindPort       uint32
	Protocol       string

	Screen           string
	SingleConnection bool
	AuthProtocol     string
	AuthCookie       string
}

Jump to

Keyboard shortcuts

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