vsock

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextID

func ContextID() (uint32, error)

ContextID retrieves the local context ID for this system.

func Listen

func Listen(cid, port uint32) (net.Listener, error)

Listen returns a net.Listener which can accept connections on the given cid and port.

func NewVSock

func NewVSock(s string, d proxy.Dialer, p proxy.Proxy) (*vsock, error)

NewVSock returns vm socket proxy.

func NewVSockDialer

func NewVSockDialer(s string, d proxy.Dialer) (proxy.Dialer, error)

NewVSockDialer returns a vm socket dialer.

func NewVSockServer

func NewVSockServer(s string, p proxy.Proxy) (proxy.Server, error)

NewVSockServer returns a vm socket server.

func SocketMode

func SocketMode(m string)

SocketMode is a NOOP on Linux.

Types

type Addr

type Addr struct {
	CID  uint32
	Port uint32
}

Addr represents the address of a vsock end point.

func (Addr) Network

func (a Addr) Network() string

Network returns the network type for a Addr

func (Addr) String

func (a Addr) String() string

String returns a string representation of a Addr

type Conn

type Conn interface {
	net.Conn
	CloseRead() error
	CloseWrite() error
	File() (*os.File, error)
}

Conn is a vsock connection which supports half-close.

func Dial

func Dial(cid, port uint32) (Conn, error)

Dial connects to the CID.Port via virtio sockets.

Jump to

Keyboard shortcuts

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