Documentation ¶
Overview ¶
Package tboxcmds provides a set of commands for the vmx.
Index ¶
- Constants
- func RegisterGuestInfoCommands(svc *nanotoolbox.Service, delegate NicDelegate)
- func RegisterPowerDelegate(svc *nanotoolbox.Service, delegate PowerDelegate)
- func RegisterVixCommand(svc *nanotoolbox.Service, delegate VixDelegate)
- type DNSConfigInfo
- type DhcpConfigInfo
- type GuestInfoCommands
- func (cmd *GuestInfoCommands) BroadcastIPOptionHandler(string, string)
- func (cmd *GuestInfoCommands) GuestNicInfo() *GuestNicInfo
- func (cmd *GuestInfoCommands) PrimaryIP() string
- func (cmd *GuestInfoCommands) PushGuestInfo()
- func (cmd *GuestInfoCommands) SendGuestInfo(kind int, buf []byte)
- func (cmd *GuestInfoCommands) SendGuestInfoDNSName()
- func (cmd *GuestInfoCommands) SendGuestInfoNIC()
- func (cmd *GuestInfoCommands) SendGuestInfoOSName()
- func (cmd *GuestInfoCommands) SendGuestInfoOSNameFull()
- func (cmd *GuestInfoCommands) SendGuestInfoString(kind int, str string)
- func (cmd *GuestInfoCommands) SendGuestInfoXDR(kind int, v interface{})
- type GuestNicInfo
- type GuestNicV3
- type IPAddressEntry
- type InetCidrRouteEntry
- type NetInterface
- type NicDelegate
- type NicInfoV3
- type PowerDelegate
- type PowerHandler
- type TypedIPAddress
- type VixCommandHandler
- type VixCommandServer
- type VixDelegate
- type WinsConfigInfo
Constants ¶
const ( // GuestInfoDNSName is the guest info kind for the DNS name. GuestInfoDNSName // GuestInfoOSNameFull is the guest info kind for the full OS name. GuestInfoOSNameFull // GuestInfoOSName is the guest info kind for the OS name. GuestInfoOSName // GuestInfoIPAddressV3 is the guest info kind for the IP address. GuestInfoIPAddressV3 )
const ( PowerStateHalt PowerStateReboot PowerStatePowerOn PowerStateResume PowerStateSuspend )
vmware/guestrpc/powerops.h.
const ( // VixToolsFeatureSupportGetHandleState defines the VixToolsFeatureSupportGetHandleState feature. VixToolsFeatureSupportGetHandleState = 1 // VixGuestOfFamilyLinux defines the VixGuestOfFamilyLinux family. VixGuestOfFamilyLinux = 1 )
Variables ¶
This section is empty.
Functions ¶
func RegisterGuestInfoCommands ¶
func RegisterGuestInfoCommands(svc *nanotoolbox.Service, delegate NicDelegate)
RegisterGuestInfoCommands registers the guest info commands.
func RegisterPowerDelegate ¶
func RegisterPowerDelegate(svc *nanotoolbox.Service, delegate PowerDelegate)
RegisterPowerDelegate registers the power operations with the service.
func RegisterVixCommand ¶
func RegisterVixCommand(svc *nanotoolbox.Service, delegate VixDelegate)
RegisterVixCommand registers the Vix command.
Types ¶
type DNSConfigInfo ¶
type DNSConfigInfo struct { HostName *string `xdr:"optional"` DomainName *string `xdr:"optional"` Servers []TypedIPAddress Search *string `xdr:"optional"` }
DNSConfigInfo represents DNS configuration.
type DhcpConfigInfo ¶
DhcpConfigInfo represents DHCP configuration.
type GuestInfoCommands ¶
type GuestInfoCommands struct {
// contains filtered or unexported fields
}
GuestInfoCommands provides a set of commands for the vmx.
func (*GuestInfoCommands) BroadcastIPOptionHandler ¶
func (cmd *GuestInfoCommands) BroadcastIPOptionHandler(string, string)
BroadcastIPOptionHandler handles the broadcast IP option.
func (*GuestInfoCommands) GuestNicInfo ¶
func (cmd *GuestInfoCommands) GuestNicInfo() *GuestNicInfo
GuestNicInfo represents the guest NIC info.
func (*GuestInfoCommands) PrimaryIP ¶
func (cmd *GuestInfoCommands) PrimaryIP() string
PrimaryIP returns the primary IP address.
func (*GuestInfoCommands) PushGuestInfo ¶
func (cmd *GuestInfoCommands) PushGuestInfo()
PushGuestInfo pushes the guest info.
func (*GuestInfoCommands) SendGuestInfo ¶
func (cmd *GuestInfoCommands) SendGuestInfo(kind int, buf []byte)
SendGuestInfo sends the guest info.
func (*GuestInfoCommands) SendGuestInfoDNSName ¶
func (cmd *GuestInfoCommands) SendGuestInfoDNSName()
SendGuestInfoDNSName sends the guest info DNS name.
func (*GuestInfoCommands) SendGuestInfoNIC ¶
func (cmd *GuestInfoCommands) SendGuestInfoNIC()
SendGuestInfoNIC sends the guest info NIC.
func (*GuestInfoCommands) SendGuestInfoOSName ¶
func (cmd *GuestInfoCommands) SendGuestInfoOSName()
SendGuestInfoOSName sends the guest info OS name.
func (*GuestInfoCommands) SendGuestInfoOSNameFull ¶
func (cmd *GuestInfoCommands) SendGuestInfoOSNameFull()
SendGuestInfoOSNameFull sends the guest info OS full name.
func (*GuestInfoCommands) SendGuestInfoString ¶
func (cmd *GuestInfoCommands) SendGuestInfoString(kind int, str string)
SendGuestInfoString sends the guest info string.
func (*GuestInfoCommands) SendGuestInfoXDR ¶
func (cmd *GuestInfoCommands) SendGuestInfoXDR(kind int, v interface{})
SendGuestInfoXDR sends the guest info XDR.
type GuestNicInfo ¶
GuestNicInfo represents NIC information.
func NewGuestNicInfo ¶
func NewGuestNicInfo() *GuestNicInfo
NewGuestNicInfo creates a new 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"` }
GuestNicV3 represents NIC information.
func (*GuestNicV3) AddIP ¶
func (nic *GuestNicV3) AddIP(prefix netip.Prefix)
AddIP adds an IP address to the NIC.
type IPAddressEntry ¶
type IPAddressEntry struct { Address TypedIPAddress PrefixLength uint32 Origin *int32 `xdr:"optional"` Status *int32 `xdr:"optional"` }
IPAddressEntry represents an IP address with prefix length, origin, and status.
type InetCidrRouteEntry ¶
type InetCidrRouteEntry struct { Dest TypedIPAddress PrefixLength uint32 NextHop *TypedIPAddress `xdr:"optional"` IfIndex uint32 Type int32 Metric uint32 }
InetCidrRouteEntry represents a route entry.
type NetInterface ¶
NetInterface represents a network interface.
type NicDelegate ¶
type NicDelegate interface { NetInterfaces() []NetInterface Hostname() string OSVersion() string OSVersionShort() string }
NicDelegate is the interface that must be implemented by the delegate.
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"` }
NicInfoV3 contains NIC information.
type PowerDelegate ¶
PowerDelegate is the interface that must be implemented by the delegate.
type PowerHandler ¶
type PowerHandler func() error
PowerHandler is the type of the function that handles power operations.
type TypedIPAddress ¶
TypedIPAddress represents an IP address with a type.
type VixCommandHandler ¶
type VixCommandHandler func(vix.CommandRequestHeader, []byte) ([]byte, error)
VixCommandHandler is a function that handles a Vix command.
type VixCommandServer ¶
type VixCommandServer struct {
// contains filtered or unexported fields
}
VixCommandServer provides a set of commands for the vmx.
func (*VixCommandServer) Dispatch ¶
func (c *VixCommandServer) Dispatch(data []byte) ([]byte, error)
Dispatch dispatches the Vix command.
func (*VixCommandServer) GetToolsState ¶
func (c *VixCommandServer) GetToolsState(_ vix.CommandRequestHeader, _ []byte) ([]byte, error)
GetToolsState returns the tools state.
func (*VixCommandServer) RegisterHandler ¶
func (c *VixCommandServer) RegisterHandler(op uint32, handler VixCommandHandler)
RegisterHandler registers the Vix command handler.
type VixDelegate ¶
VixDelegate is the interface that must be implemented by the delegate.
type WinsConfigInfo ¶
type WinsConfigInfo struct { Primary TypedIPAddress Secondary TypedIPAddress }
WinsConfigInfo represents WINS configuration.