portfwd

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IPv4loopback1 = limayaml.IPv4loopback1

Functions

func Control

func Control(_, _ string, c syscall.RawConn) (err error)

func HandleTCPConnection

func HandleTCPConnection(ctx context.Context, client *guestagentclient.GuestAgentClient, conn net.Conn, guestAddr string)

func HandleUDPConnection

func HandleUDPConnection(ctx context.Context, client *guestagentclient.GuestAgentClient, conn net.PacketConn, guestAddr string)

func Listen

func Listen(ctx context.Context, listenConfig net.ListenConfig, hostAddress string) (net.Listener, error)

func ListenPacket

func ListenPacket(ctx context.Context, listenConfig net.ListenConfig, hostAddress string) (net.PacketConn, error)

Types

type ClosableListeners

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

func NewClosableListener

func NewClosableListener() *ClosableListeners

func (*ClosableListeners) Forward

func (p *ClosableListeners) Forward(ctx context.Context, client *guestagentclient.GuestAgentClient,
	protocol string, hostAddress string, guestAddress string,
)

func (*ClosableListeners) Remove

func (p *ClosableListeners) Remove(_ context.Context, protocol, hostAddress, guestAddress string)

type Forwarder

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

func NewPortForwarder

func NewPortForwarder(rules []limayaml.PortForward, ignoreTCP, ignoreUDP bool) *Forwarder

func (*Forwarder) OnEvent

func (fw *Forwarder) OnEvent(ctx context.Context, client *guestagentclient.GuestAgentClient, ev *api.Event)

type GrpcClientRW

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

func (*GrpcClientRW) Close added in v1.0.3

func (g *GrpcClientRW) Close() error

func (*GrpcClientRW) LocalAddr added in v1.0.3

func (g *GrpcClientRW) LocalAddr() net.Addr

func (*GrpcClientRW) Read

func (g *GrpcClientRW) Read(p []byte) (n int, err error)

func (*GrpcClientRW) RemoteAddr added in v1.0.3

func (g *GrpcClientRW) RemoteAddr() net.Addr

func (*GrpcClientRW) SetDeadline added in v1.0.3

func (g *GrpcClientRW) SetDeadline(_ time.Time) error

func (*GrpcClientRW) SetReadDeadline added in v1.0.3

func (g *GrpcClientRW) SetReadDeadline(_ time.Time) error

func (*GrpcClientRW) SetWriteDeadline added in v1.0.3

func (g *GrpcClientRW) SetWriteDeadline(_ time.Time) error

func (*GrpcClientRW) Write

func (g *GrpcClientRW) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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