package toolbox
import "github.com/vmware/govmomi/toolbox"
Index ¶
- Variables
- func DecodeXDR(buf []byte, val interface{}) error
- func DefaultIP() string
- func DefaultStartCommand(m *process.Manager, r *vix.StartProgramRequest) (int64, error)
- func EncodeXDR(val interface{}) ([]byte, error)
- func GuestInfoCommand(kind int, req []byte) []byte
- func GuestInfoNicInfoRequest() ([]byte, error)
- func Halt() error
- func Reboot() error
- type Channel
- func NewBackdoorChannelIn() Channel
- func NewBackdoorChannelOut() Channel
- func NewTraceChannel(c Channel) Channel
- type ChannelOut
- type CommandHandler
- type CommandServer
- func (c *CommandServer) CreateDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) CreateTemporaryDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) CreateTemporaryFile(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) DeleteDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) DeleteFile(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) Dispatch(data []byte) ([]byte, error)
- func (c *CommandServer) GetToolsState(_ vix.CommandRequestHeader, _ []byte) ([]byte, error)
- func (c *CommandServer) InitiateFileTransferFromGuest(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) InitiateFileTransferToGuest(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) KillProcess(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) ListFiles(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) ListProcesses(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) MoveDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) MoveFile(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) ProcessHgfsPacket(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) ReadEnvironmentVariables(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) RegisterHandler(op uint32, handler CommandHandler)
- func (c *CommandServer) SetGuestFileAttributes(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- func (c *CommandServer) StartCommand(header vix.CommandRequestHeader, data []byte) ([]byte, error)
- type DNSConfigInfo
- type DhcpConfigInfo
- type GuestNicInfo
- type GuestNicV3
- type Handler
- type IPAddressEntry
- type InetCidrRouteEntry
- type NicInfoV3
- type PowerCommand
- type PowerCommandHandler
- type Service
- func NewService(rpcIn Channel, rpcOut Channel) *Service
- func (s *Service) CapabilitiesRegister([]byte) ([]byte, error)
- func (s *Service) Dispatch(request []byte) []byte
- func (s *Service) Ping([]byte) ([]byte, error)
- func (s *Service) RegisterHandler(name string, handler Handler)
- func (s *Service) Reset([]byte) ([]byte, error)
- func (s *Service) SendGuestInfo()
- func (s *Service) SetOption(args []byte) ([]byte, error)
- func (s *Service) Start() error
- func (s *Service) Stop()
- func (s *Service) Wait()
- type TraceChannel
- func (d *TraceChannel) Receive() ([]byte, error)
- func (d *TraceChannel) Send(buf []byte) error
- func (d *TraceChannel) Start() error
- func (d *TraceChannel) Stop() error
- type TypedIPAddress
- type WinsConfigInfo
Variables ¶
var ( Trace = false )
Functions ¶
func DecodeXDR ¶
func DefaultIP ¶
func DefaultIP() string
DefaultIP is used by default when responding to a Set_Option broadcastIP request It can be overridden with the Service.PrimaryIP field
func DefaultStartCommand ¶
func EncodeXDR ¶
func GuestInfoCommand ¶
func GuestInfoNicInfoRequest ¶
func Halt ¶
func Halt() error
func Reboot ¶
func Reboot() error
Types ¶
type Channel ¶
Channel abstracts the guest<->vmx RPC transport
func NewBackdoorChannelIn ¶
func NewBackdoorChannelIn() Channel
NewBackdoorChannelIn creates a Channel for use with the TCLO protocol
func NewBackdoorChannelOut ¶
func NewBackdoorChannelOut() Channel
NewBackdoorChannelOut creates a Channel for use with the RPCI protocol
func NewTraceChannel ¶
type ChannelOut ¶
type ChannelOut struct { Channel }
ChannelOut extends Channel to provide RPCI protocol helpers
func (*ChannelOut) Request ¶
func (c *ChannelOut) Request(request []byte) ([]byte, error)
Request sends an RPC command to the vmx and checks the return code for success or error
type CommandHandler ¶
type CommandHandler func(vix.CommandRequestHeader, []byte) ([]byte, error)
type CommandServer ¶
type CommandServer struct { Out *ChannelOut ProcessManager *process.Manager Authenticate func(vix.CommandRequestHeader, []byte) error ProcessStartCommand func(*process.Manager, *vix.StartProgramRequest) (int64, error) FileServer *hgfs.Server // contains filtered or unexported fields }
func (*CommandServer) CreateDirectory ¶
func (c *CommandServer) CreateDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) CreateTemporaryDirectory ¶
func (c *CommandServer) CreateTemporaryDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) CreateTemporaryFile ¶
func (c *CommandServer) CreateTemporaryFile(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) DeleteDirectory ¶
func (c *CommandServer) DeleteDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) DeleteFile ¶
func (c *CommandServer) DeleteFile(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) Dispatch ¶
func (c *CommandServer) Dispatch(data []byte) ([]byte, error)
func (*CommandServer) GetToolsState ¶
func (c *CommandServer) GetToolsState(_ vix.CommandRequestHeader, _ []byte) ([]byte, error)
func (*CommandServer) InitiateFileTransferFromGuest ¶
func (c *CommandServer) InitiateFileTransferFromGuest(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) InitiateFileTransferToGuest ¶
func (c *CommandServer) InitiateFileTransferToGuest(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) KillProcess ¶
func (c *CommandServer) KillProcess(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) ListFiles ¶
func (c *CommandServer) ListFiles(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) ListProcesses ¶
func (c *CommandServer) ListProcesses(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) MoveDirectory ¶
func (c *CommandServer) MoveDirectory(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) MoveFile ¶
func (c *CommandServer) MoveFile(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) ProcessHgfsPacket ¶
func (c *CommandServer) ProcessHgfsPacket(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) ReadEnvironmentVariables ¶
func (c *CommandServer) ReadEnvironmentVariables(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) RegisterHandler ¶
func (c *CommandServer) RegisterHandler(op uint32, handler CommandHandler)
func (*CommandServer) SetGuestFileAttributes ¶
func (c *CommandServer) SetGuestFileAttributes(header vix.CommandRequestHeader, data []byte) ([]byte, error)
func (*CommandServer) StartCommand ¶
func (c *CommandServer) StartCommand(header vix.CommandRequestHeader, data []byte) ([]byte, error)
type DNSConfigInfo ¶
type DNSConfigInfo struct { HostName *string `xdr:"optional"` DomainName *string `xdr:"optional"` Servers []TypedIPAddress Search *string `xdr:"optional"` }
type DhcpConfigInfo ¶
type GuestNicInfo ¶
func DefaultGuestNicInfo ¶
func DefaultGuestNicInfo() *GuestNicInfo
func NewGuestNicInfo ¶
func NewGuestNicInfo() *GuestNicInfo
type GuestNicV3 ¶
type GuestNicV3 struct { MacAddress string IPs []IPAddressEntry DNSConfigInfo *DNSConfigInfo `xdr:"optional"` WinsConfigInfo *WinsConfigInfo `xdr:"optional"` DhcpConfigInfov4 *DhcpConfigInfo `xdr:"optional"` DhcpConfigInfov6 *DhcpConfigInfo `xdr:"optional"` }
func (*GuestNicV3) AddIP ¶
func (nic *GuestNicV3) AddIP(addr net.Addr)
type Handler ¶
Handler is given the raw argument portion of an RPC request and returns a response
type IPAddressEntry ¶
type IPAddressEntry struct { Address TypedIPAddress PrefixLength uint32 Origin *int32 `xdr:"optional"` Status *int32 `xdr:"optional"` }
type InetCidrRouteEntry ¶
type InetCidrRouteEntry struct { Dest TypedIPAddress PrefixLength uint32 NextHop *TypedIPAddress `xdr:"optional"` IfIndex uint32 Type int32 Metric uint32 }
type NicInfoV3 ¶
type NicInfoV3 struct { Nics []GuestNicV3 Routes []InetCidrRouteEntry DNSConfigInfo *DNSConfigInfo `xdr:"optional"` WinsConfigInfo *WinsConfigInfo `xdr:"optional"` DhcpConfigInfov4 *DhcpConfigInfo `xdr:"optional"` DhcpConfigInfov6 *DhcpConfigInfo `xdr:"optional"` }
type PowerCommand ¶
type PowerCommand struct { Handler func() error // contains filtered or unexported fields }
func (*PowerCommand) Dispatch ¶
func (c *PowerCommand) Dispatch([]byte) ([]byte, error)
type PowerCommandHandler ¶
type PowerCommandHandler struct { Halt PowerCommand Reboot PowerCommand PowerOn PowerCommand Resume PowerCommand Suspend PowerCommand }
type Service ¶
type Service struct { Command *CommandServer Power *PowerCommandHandler PrimaryIP func() string // contains filtered or unexported fields }
Service receives and dispatches incoming RPC requests from the vmx
func NewService ¶
NewService initializes a Service instance
func (*Service) CapabilitiesRegister ¶
func (*Service) Dispatch ¶
Dispatch an incoming RPC request to a Handler
func (*Service) Ping ¶
Ping is the default Handler for ping requests
func (*Service) RegisterHandler ¶
RegisterHandler for the given RPC name
func (*Service) Reset ¶
Reset is the default Handler for reset requests
func (*Service) SendGuestInfo ¶
func (s *Service) SendGuestInfo()
func (*Service) SetOption ¶
SetOption is the default Handler for Set_Option requests
func (*Service) Start ¶
Start initializes the RPC channels and starts a goroutine to listen for incoming RPC requests
func (*Service) Stop ¶
func (s *Service) Stop()
Stop cancels the RPC listener routine created via Start
func (*Service) Wait ¶
func (s *Service) Wait()
Wait blocks until Start returns, allowing any current RPC in progress to complete.
type TraceChannel ¶
type TraceChannel struct { Channel // contains filtered or unexported fields }
func (*TraceChannel) Receive ¶
func (d *TraceChannel) Receive() ([]byte, error)
func (*TraceChannel) Send ¶
func (d *TraceChannel) Send(buf []byte) error
func (*TraceChannel) Start ¶
func (d *TraceChannel) Start() error
func (*TraceChannel) Stop ¶
func (d *TraceChannel) Stop() error
type TypedIPAddress ¶
type WinsConfigInfo ¶
type WinsConfigInfo struct { Primary TypedIPAddress Secondary TypedIPAddress }
Source Files ¶
backdoor.go channel.go command.go guest_info.go power.go service.go toolbox_linux.go trace_channel.go
Directories ¶
Path | Synopsis |
---|---|
toolbox/hgfs | |
toolbox/process | |
toolbox/toolbox | |
toolbox/vix |
- Version
- v0.48.1 (latest)
- Published
- Feb 11, 2025
- Platform
- linux/amd64
- Imports
- 24 packages
- Last checked
- 2 months ago –
Tools for package owners.