rootd

package
v2.9.5-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessName = "daemon"
)

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Command returns the telepresence sub-command "daemon-foreground".

func WithNewServiceFunc added in v2.9.0

func WithNewServiceFunc(ctx context.Context, f NewServiceFunc) context.Context

func WithNewSessionFunc added in v2.9.0

func WithNewSessionFunc(ctx context.Context, f NewSessionFunc) context.Context

Types

type NewServiceFunc added in v2.9.0

type NewServiceFunc func(*scout.Reporter, *client.Config) *Service

func GetNewServiceFunc added in v2.9.0

func GetNewServiceFunc(ctx context.Context) NewServiceFunc

type NewSessionFunc added in v2.9.0

type NewSessionFunc func(context.Context, *scout.Reporter, *rpc.OutboundInfo) (*Session, error)

func GetNewSessionFunc added in v2.9.0

func GetNewSessionFunc(ctx context.Context) NewSessionFunc

type Service added in v2.9.0

type Service struct {
	rpc.UnsafeDaemonServer
	// contains filtered or unexported fields
}

Service represents the state of the Telepresence Daemon.

func NewService added in v2.9.0

func NewService(sr *scout.Reporter, cfg *client.Config) *Service

func (*Service) As added in v2.9.0

func (s *Service) As(ptr any)

func (*Service) Connect added in v2.9.0

func (s *Service) Connect(ctx context.Context, info *rpc.OutboundInfo) (*rpc.DaemonStatus, error)

func (*Service) Disconnect added in v2.9.0

func (s *Service) Disconnect(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

func (*Service) GetNetworkConfig added in v2.9.0

func (s *Service) GetNetworkConfig(ctx context.Context, e *empty.Empty) (nc *rpc.NetworkConfig, err error)

func (*Service) Quit added in v2.9.0

func (s *Service) Quit(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

func (*Service) SetDnsSearchPath added in v2.9.0

func (s *Service) SetDnsSearchPath(ctx context.Context, paths *rpc.Paths) (*empty.Empty, error)

func (*Service) SetLogLevel added in v2.9.0

func (s *Service) SetLogLevel(ctx context.Context, request *manager.LogLevelRequest) (*empty.Empty, error)

func (*Service) Status added in v2.9.0

func (s *Service) Status(_ context.Context, _ *empty.Empty) (*rpc.DaemonStatus, error)

func (*Service) Version added in v2.9.0

func (s *Service) Version(_ context.Context, _ *empty.Empty) (*common.VersionInfo, error)

func (*Service) WaitForNetwork added in v2.9.0

func (s *Service) WaitForNetwork(ctx context.Context, e *empty.Empty) (*empty.Empty, error)

func (*Service) WithSession added in v2.9.0

func (s *Service) WithSession(f func(context.Context, *Session) error) error

type Session added in v2.9.0

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

Session resolves DNS names and routes outbound traffic that is centered around a TUN device. The router is similar to a TUN-to-SOCKS5 but uses a bidirectional gRPC muxTunnel instead of SOCKS when communicating with the traffic-manager. The addresses of the device are derived from IP addresses sent to it from the user daemon (which in turn receives them from the cluster).

Data sent to the device is received as L3 IP-packets and parsed into L4 UDP and TCP before they are dispatched over the muxTunnel. Returned payloads are wrapped as IP-packets before written back to the device. This L3 <=> L4 conversation is made using gvisor.dev/gvisor/pkg/tcpip.

Connection pooling:

For UDP and TCP packets, a ConnID is created which uniquely identifies a combination of protocol, source IP, source port, destination IP, and destination port. A handler is then obtained that matches that ID (active handlers are cached in a tunnel.Pool) and the packet is then sent to that handler. The handler typically sends the ConnID and the payload of the packet over to the traffic-manager using the gRPC ClientTunnel. At the receiving en din the traffic-manager, a similar tunnel.Pool obtains a corresponding handler which manages a net.Conn matching the ConnID in the cluster.

A zero Session is invalid; you must use newSession.

func NewSession added in v2.9.0

func NewSession(c context.Context, scout *scout.Reporter, mi *rpc.OutboundInfo) (*Session, error)

NewSession returns a new properly initialized session object.

func (*Session) Done added in v2.9.3

func (s *Session) Done() chan struct{}

func (*Session) SetSearchPath added in v2.9.0

func (s *Session) SetSearchPath(ctx context.Context, paths []string, namespaces []string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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