tboxcmds

package
v0.0.0-...-0c3ae5f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package tboxcmds provides a set of commands for the vmx.

Index

Constants

View Source
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
)
View Source
const (
	PowerStateHalt
	PowerStateReboot
	PowerStatePowerOn
	PowerStateResume
	PowerStateSuspend
)

vmware/guestrpc/powerops.h.

View Source
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

type DhcpConfigInfo struct {
	Enabled  bool
	Settings string
}

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

type GuestNicInfo struct {
	Version int32
	V3      *NicInfoV3 `xdr:"optional"`
}

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

type NetInterface struct {
	Name  string
	MAC   string // xx:xx:xx:xx:xx:xx
	Addrs []netip.Prefix
}

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

type PowerDelegate interface {
	Shutdown() error
	Reboot() error
}

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

type TypedIPAddress struct {
	Type    int32
	Address []byte
}

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

type VixDelegate interface {
	OSVersion() string
	OSVersionShort() string
	Hostname() string
}

VixDelegate is the interface that must be implemented by the delegate.

type WinsConfigInfo

type WinsConfigInfo struct {
	Primary   TypedIPAddress
	Secondary TypedIPAddress
}

WinsConfigInfo represents WINS configuration.

Jump to

Keyboard shortcuts

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