bridge

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 50 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	GlobalRdrDeviceName                   = `\\?\GLOBALROOT\Device\LanmanRedirector`
	GlobalVsmbDeviceName                  = `\\?\GLOBALROOT\Device\vmsmb`
	GlobalVsmbInstanceName                = `\Device\vmsmb`
	GlobalVsmbTransportName               = `\Device\VMBus\{4d12e519-17a0-4ae4-8eaa-5270fc6abdb7}-{dcc079ae-60ba-4d07-847c-3493609c0870}-0000`
	SeLoadDriverName                      = "SeLoadDriverPrivilege"
	FsctlLmrStartInstance                 = 0x001403A0
	FsctlLmrBindToTransport               = 0x001401B0
	LmrInstanceFlagRegisterFilesystem     = 0x2
	LmrInstanceFlagUseCustomTransports    = 0x4
	LmrInstanceFlagAllowGuestAuth         = 0x8
	LmrInstanceFlagSupportsDirectmappedIo = 0x10
	SmbCeTransportTypeVmbus               = 3

	FileReadAttributes      = 0x00000080
	FileFlagBackupSemantics = 0x02000000
)
View Source
const (
	UVMContainerID = "00000000-0000-0000-0000-000000000000"
)

Variables

This section is empty.

Functions

func UnknownMessage

func UnknownMessage(r *request) error

UnknownMessage represents the default handler logic for an unmatched request type sent from the bridge.

func VsmbMain added in v0.15.0

func VsmbMain() (windows.Handle, error)

Types

type Bridge

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

func NewBridge

func NewBridge(shimConn io.ReadWriteCloser, inboxGCSConn io.ReadWriteCloser, initialEnforcer securitypolicy.SecurityPolicyEnforcer, logWriter io.Writer) *Bridge

func (*Bridge) AssignHandlers

func (b *Bridge) AssignHandlers()

AssignHandlers creates and assigns appropriate event handlers for the different bridge message types.

func (*Bridge) Handle

func (b *Bridge) Handle(rpcProcID prot.RPCProc, handlerFunc HandlerFunc)

Handle registers the handler for the given message id and protocol version.

func (*Bridge) HandleFunc

func (b *Bridge) HandleFunc(rpcProcID prot.RPCProc, handler func(*request) error)

func (*Bridge) ListenAndServeShimRequests

func (b *Bridge) ListenAndServeShimRequests() error

ListenAndServeShimRequests listens to messages on the hcsshim and inbox GCS connections and schedules them for processing. After processing, messages are forwarded to inbox GCS on success and responses from inbox GCS or error messages are sent back to hcsshim via bridge connection.

func (*Bridge) ServeMsg

func (b *Bridge) ServeMsg(r *request) error

ServeMsg serves request by calling appropriate handler functions.

type Container added in v0.15.0

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

func (*Container) GetProcess added in v0.15.0

func (c *Container) GetProcess(pid uint32) (*containerProcess, error)

GetProcess returns the Process with the matching 'pid'. If the 'pid' does not exit returns error.

type HandlerFunc

type HandlerFunc func(*request) error

HandlerFunc is an adapter to use functions as handlers.

type Host

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

func NewHost

func NewHost(initialEnforcer securitypolicy.SecurityPolicyEnforcer, logWriter io.Writer) *Host

func (*Host) AddContainer added in v0.15.0

func (h *Host) AddContainer(ctx context.Context, id string, c *Container) error

func (*Host) GetCreatedContainer added in v0.15.0

func (h *Host) GetCreatedContainer(ctx context.Context, id string) (*Container, error)

func (*Host) RemoveContainer added in v0.15.0

func (h *Host) RemoveContainer(ctx context.Context, id string) error

type IOStatusBlock added in v0.15.0

type IOStatusBlock struct {
	Status      uintptr
	Information uintptr
}

type LMRBindUnbindTransportRequest added in v0.15.0

type LMRBindUnbindTransportRequest struct {
	StructureSize     uint16
	Flags             uint16
	Type              uint32
	TransportIDLength uint32
}

type LMRConnectionProperties added in v0.15.0

type LMRConnectionProperties struct {
	Flags1                          byte
	Flags2                          byte
	Padding                         [2]byte
	SessionTimeoutInterval          uint32
	CAHandleKeepaliveInterval       uint32
	NonCAHandleKeepaliveInterval    uint32
	ActiveIOKeepaliveInterval       uint32
	DisableRdma                     uint32
	ConnectionCountPerRdmaInterface uint32
	AlternateTCPPort                uint16
	AlternateQuicPort               uint16
	AlternateRdmaPort               uint16
	Padding2                        [2]byte
}

type LMRStartInstanceRequest added in v0.15.0

type LMRStartInstanceRequest struct {
	StructureSize               uint32
	IoTimeout                   uint32
	IoRetryCount                uint32
	Flags                       uint16
	Padding1                    uint16
	Reserved1                   uint32
	InstanceConfig              SMB2InstanceConfiguration
	DefaultConnectionProperties LMRConnectionProperties
	InstanceID                  byte
	Reserved2                   byte
	DeviceNameLength            uint16
}

type SMB2InstanceConfiguration added in v0.15.0

type SMB2InstanceConfiguration struct {
	DormantDirectoryTimeout             uint32
	DormantFileTimeout                  uint32
	DormantFileLimit                    uint32
	FileInfoCacheLifetime               uint32
	FileNotFoundCacheLifetime           uint32
	DirectoryCacheLifetime              uint32
	FileInfoCacheEntriesMax             uint32
	FileNotFoundCacheEntriesMax         uint32
	DirectoryCacheEntriesMax            uint32
	DirectoryCacheSizeMax               uint32
	ReadAheadGranularity                uint32
	VolumeFeatureSupportCacheLifetime   uint32
	VolumeFeatureSupportCacheEntriesMax uint32
	FileAbeStatusCacheLifetime          uint32
	RequireSecuritySignature            byte
	RequireEncryption                   byte
	Padding                             [2]byte
}

Structs

Jump to

Keyboard shortcuts

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