patchpanel

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package patchpanel interacts with the patchpanel system daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a wrapper around patchpanel DBus API.

func New

func New(ctx context.Context) (*Client, error)

New connects to the patchpanel daemon via D-Bus and returns a patchpanel Client object. TODO(crbug.com/1135106): Implement missing patchpanel D-Bus API methods.

func (*Client) ConnectNamespace

func (c *Client) ConnectNamespace(ctx context.Context, pid int32, outboundPhysicalDevice string,
	forwardUserTraffic bool) (local *os.File, response *pp.ConnectNamespaceResponse, retErr error)

ConnectNamespace sends a ConnectNamespaceRequest for the given namespace pid. Returns a pair with a open file descriptor and the ConnectNamespaceResponse proto message received if the request succeeded. Closing the file descriptor will teardown the veth and routing setup and free the allocated IPv4 subnet.

func (*Client) GetDevices

func (c *Client) GetDevices(ctx context.Context) (*pp.GetDevicesResponse, error)

GetDevices gets all patchpanel managed devices information.

func (*Client) NotifyTerminaVMShutdown

func (c *Client) NotifyTerminaVMShutdown(ctx context.Context, cid uint32) error

NotifyTerminaVMShutdown sends a TerminaVmShutdownRequest for the given container id.

func (*Client) NotifyTerminaVMStartup

func (c *Client) NotifyTerminaVMStartup(ctx context.Context, cid uint32) (response *pp.TerminaVmStartupResponse, retErr error)

NotifyTerminaVMStartup sends a TerminaVmStartupRequest for the given container id. The ID must be unique in the system.

Jump to

Keyboard shortcuts

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