vix

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropertyGuestToolsAPIOptions = 4501
	PropertyGuestOsFamily        = 4502
	PropertyGuestOsVersion       = 4503
	PropertyGuestToolsProductNam = 4511
	PropertyGuestToolsVersion    = 4500
	PropertyGuestName            = 4505
	PropertyGuestOsVersionShort  = 4520

	PropertyGuestStartProgramEnabled            = 4540
	PropertyGuestListProcessesEnabled           = 4541
	PropertyGuestTerminateProcessEnabled        = 4542
	PropertyGuestReadEnvironmentVariableEnabled = 4543

	PropertyGuestMakeDirectoryEnabled                 = 4547
	PropertyGuestDeleteFileEnabled                    = 4548
	PropertyGuestDeleteDirectoryEnabled               = 4549
	PropertyGuestMoveDirectoryEnabled                 = 4550
	PropertyGuestMoveFileEnabled                      = 4551
	PropertyGuestCreateTempFileEnabled                = 4552
	PropertyGuestCreateTempDirectoryEnabled           = 4553
	PropertyGuestListFilesEnabled                     = 4554
	PropertyGuestChangeFileAttributesEnabled          = 4555
	PropertyGuestInitiateFileTransferFromGuestEnabled = 4556
	PropertyGuestInitiateFileTransferToGuestEnabled   = 4557
)

Property ID enum as defined in open-vm-tools/lib/include/vixOpenSource.h

View Source
const (
	CommandMagicWord = 0xd00d0001

	CommandGetToolsState = 62

	CommandStartProgram     = 185
	CommandListProcessesEx  = 186
	CommandReadEnvVariables = 187
	CommandTerminateProcess = 193

	CommandCreateDirectoryEx        = 178
	CommandMoveGuestFileEx          = 179
	CommandMoveGuestDirectory       = 180
	CommandCreateTemporaryFileEx    = 181
	CommandCreateTemporaryDirectory = 182
	CommandSetGuestFileAttributes   = 183
	CommandDeleteGuestFileEx        = 194
	CommandDeleteGuestDirectoryEx   = 195

	CommandListFiles                     = 177
	HgfsSendPacketCommand                = 84
	CommandInitiateFileTransferFromGuest = 188
	CommandInitiateFileTransferToGuest   = 189

	// VIX_USER_CREDENTIAL_NAME_PASSWORD
	UserCredentialTypeNamePassword = 1

	// VIX_E_* constants from vix.h
	OK                 = 0
	Fail               = 1
	InvalidArg         = 3
	FileNotFound       = 4
	FileAlreadyExists  = 12
	FileAccessError    = 13
	AuthenticationFail = 35

	UnrecognizedCommandInGuest = 3025
	InvalidMessageHeader       = 10000
	InvalidMessageBody         = 10001
	NotAFile                   = 20001
	NotADirectory              = 20002
	NoSuchProcess              = 20003
	DirectoryNotEmpty          = 20006

	// VIX_COMMAND_* constants from Commands.h
	CommandGuestReturnsBinary = 0x80

	// VIX_FILE_ATTRIBUTES_ constants from vix.h
	FileAttributesDirectory = 0x0001
	FileAttributesSymlink   = 0x0002
)
View Source
const (
	FileAttributeSetAccessDate      = 0x0001
	FileAttributeSetModifyDate      = 0x0002
	FileAttributeSetReadonly        = 0x0004
	FileAttributeSetHidden          = 0x0008
	FileAttributeSetUnixOwnerid     = 0x0010
	FileAttributeSetUnixGroupid     = 0x0020
	FileAttributeSetUnixPermissions = 0x0040
)

SetGuestFileAttributes flags as defined in vixOpenSource.h

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) int

ErrorCode does its best to map the given error to a VIX error code. See also: Vix_TranslateErrno

Types

type CommandHgfsSendPacket

type CommandHgfsSendPacket struct {
	CommandRequestHeader

	Body struct {
		PacketSize uint32
		Timeout    int32
	}

	Packet []byte
}

func (*CommandHgfsSendPacket) MarshalBinary

func (r *CommandHgfsSendPacket) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*CommandHgfsSendPacket) UnmarshalBinary

func (r *CommandHgfsSendPacket) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type CommandRequestHeader

type CommandRequestHeader struct {
	Header

	OpCode       uint32
	RequestFlags uint32

	TimeOut uint32

	Cookie         uint64
	ClientHandleID uint32

	UserCredentialType uint32
}

type CreateTempFileRequest

type CreateTempFileRequest struct {
	CommandRequestHeader

	Body struct {
		Options             int32
		FilePrefixLength    uint32
		FileSuffixLength    uint32
		DirectoryPathLength uint32
		PropertyListLength  uint32
	}

	FilePrefix    string
	FileSuffix    string
	DirectoryPath string
}

func (*CreateTempFileRequest) MarshalBinary

func (r *CreateTempFileRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*CreateTempFileRequest) UnmarshalBinary

func (r *CreateTempFileRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type DirRequest

type DirRequest struct {
	CommandRequestHeader

	Body struct {
		FileOptions          int32
		GuestPathNameLength  uint32
		FilePropertiesLength uint32
		Recursive            bool
	}

	GuestPathName string
}

func (*DirRequest) MarshalBinary

func (r *DirRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*DirRequest) UnmarshalBinary

func (r *DirRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type Error

type Error int

func (Error) Error

func (err Error) Error() string

type FileRequest

type FileRequest struct {
	CommandRequestHeader

	Body struct {
		FileOptions         int32
		GuestPathNameLength uint32
	}

	GuestPathName string
}

func (*FileRequest) MarshalBinary

func (r *FileRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*FileRequest) UnmarshalBinary

func (r *FileRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type Header struct {
	Magic          uint32
	MessageVersion uint16

	TotalMessageLength uint32
	HeaderLength       uint32
	BodyLength         uint32
	CredentialLength   uint32

	CommonFlags uint8
}

type InitiateFileTransferToGuestRequest

type InitiateFileTransferToGuestRequest struct {
	CommandRequestHeader

	Body struct {
		Options             int32
		GuestPathNameLength uint32
		Overwrite           bool
	}

	GuestPathName string
}

func (*InitiateFileTransferToGuestRequest) MarshalBinary

func (r *InitiateFileTransferToGuestRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*InitiateFileTransferToGuestRequest) UnmarshalBinary

func (r *InitiateFileTransferToGuestRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type KillProcessRequest

type KillProcessRequest struct {
	CommandRequestHeader

	Body struct {
		Pid     int64
		Options uint32
	}
}

func (*KillProcessRequest) MarshalBinary

func (r *KillProcessRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*KillProcessRequest) UnmarshalBinary

func (r *KillProcessRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type ListFilesRequest

type ListFilesRequest struct {
	CommandRequestHeader

	Body struct {
		FileOptions         int32
		GuestPathNameLength uint32
		PatternLength       uint32
		Index               int32
		MaxResults          int32
		Offset              uint64
	}

	GuestPathName string
	Pattern       string
}

func (*ListFilesRequest) MarshalBinary

func (r *ListFilesRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*ListFilesRequest) UnmarshalBinary

func (r *ListFilesRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type ListProcessesRequest

type ListProcessesRequest struct {
	CommandRequestHeader

	Body struct {
		Key     uint32
		Offset  uint32
		NumPids uint32
	}

	Pids []int64
}

func (*ListProcessesRequest) MarshalBinary

func (r *ListProcessesRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*ListProcessesRequest) UnmarshalBinary

func (r *ListProcessesRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type Property

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

func NewBlobProperty

func NewBlobProperty(ID int32, val []byte) *Property

func NewBoolProperty

func NewBoolProperty(ID int32, val bool) *Property

func NewInt32Property

func NewInt32Property(ID int32, val int32) *Property

func NewInt64Property

func NewInt64Property(ID int32, val int64) *Property

func NewStringProperty

func NewStringProperty(ID int32, val string) *Property

func (*Property) MarshalBinary

func (p *Property) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*Property) UnmarshalBinary

func (p *Property) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type PropertyList

type PropertyList []*Property

func (*PropertyList) MarshalBinary

func (l *PropertyList) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*PropertyList) UnmarshalBinary

func (l *PropertyList) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type ReadEnvironmentVariablesRequest

type ReadEnvironmentVariablesRequest struct {
	CommandRequestHeader

	Body struct {
		NumNames    uint32
		NamesLength uint32
	}

	Names []string
}

func (*ReadEnvironmentVariablesRequest) MarshalBinary

func (r *ReadEnvironmentVariablesRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*ReadEnvironmentVariablesRequest) UnmarshalBinary

func (r *ReadEnvironmentVariablesRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type RenameFileRequest

type RenameFileRequest struct {
	CommandRequestHeader

	Body struct {
		CopyFileOptions      int32
		OldPathNameLength    uint32
		NewPathNameLength    uint32
		FilePropertiesLength uint32
		Overwrite            bool
	}

	OldPathName string
	NewPathName string
}

func (*RenameFileRequest) MarshalBinary

func (r *RenameFileRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*RenameFileRequest) UnmarshalBinary

func (r *RenameFileRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type SetGuestFileAttributesRequest

type SetGuestFileAttributesRequest struct {
	CommandRequestHeader

	Body struct {
		FileOptions         int32
		AccessTime          int64
		ModificationTime    int64
		OwnerID             int32
		GroupID             int32
		Permissions         int32
		Hidden              bool
		ReadOnly            bool
		GuestPathNameLength uint32
	}

	GuestPathName string
}

func (*SetGuestFileAttributesRequest) IsSet

func (*SetGuestFileAttributesRequest) MarshalBinary

func (r *SetGuestFileAttributesRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*SetGuestFileAttributesRequest) UnmarshalBinary

func (r *SetGuestFileAttributesRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type StartProgramRequest

type StartProgramRequest struct {
	CommandRequestHeader

	Body struct {
		StartMinimized    uint8
		ProgramPathLength uint32
		ArgumentsLength   uint32
		WorkingDirLength  uint32
		NumEnvVars        uint32
		EnvVarLength      uint32
	}

	ProgramPath string
	Arguments   string
	WorkingDir  string
	EnvVars     []string
}

func (*StartProgramRequest) MarshalBinary

func (r *StartProgramRequest) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*StartProgramRequest) UnmarshalBinary

func (r *StartProgramRequest) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type UserCredentialNamePassword

type UserCredentialNamePassword struct {
	Body struct {
		NameLength     uint32
		PasswordLength uint32
	}

	Name     string
	Password string
}

func (*UserCredentialNamePassword) MarshalBinary

func (c *UserCredentialNamePassword) MarshalBinary() ([]byte, error)

func (*UserCredentialNamePassword) UnmarshalBinary

func (c *UserCredentialNamePassword) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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