Documentation ¶
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
- 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 (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
- type TypedIPAddress
- type WinsConfigInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotVirtualWorld = errors.New("not in a virtual world")
)
View Source
var (
Trace = false
)
Functions ¶
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 GuestInfoCommand ¶
func GuestInfoNicInfoRequest ¶
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
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) 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 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 }
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) RegisterHandler ¶
RegisterHandler for the given RPC name
func (*Service) SendGuestInfo ¶
func (s *Service) SendGuestInfo()
func (*Service) Start ¶
Start initializes the RPC channels and starts a goroutine to listen for incoming RPC requests
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 ¶
Click to show internal directories.
Click to hide internal directories.