OSAPI  0.29
Open System API
MACHINE

The machine management module. More...

Collaboration diagram for MACHINE:

Functions

t_status internal_cpu_amd_getFeatures (uint32_t featLevel, t_cpu_feature_list *p_list)
 Obtain the AMD CPU available features/functions. More...
 
t_status internal_cpu_intel_getFeatures (uint32_t featLevel, t_cpu_feature_list *p_list)
 Obtain the Intel CPU available features/functions. More...
 
t_status machine_module_supported (void)
 Declares if the module is supported on the current implementation. More...
 
t_status machine_cpu_getArch (const char **arch)
 Retrieve the target (compiled) CPU architecture. More...
 
t_status machine_cpu_getSummary (t_cpu_summary *summary)
 Obtain summary information about machine CPUs. More...
 
t_status machine_cpu_getInfo (t_cpu *info)
 Obtain information about a machine CPU. More...
 
t_status machine_cpu_isFeatureAvailable (const t_cpu *cpu, unsigned int fid, bool *available)
 Retrieve a name that corresponds to a feature ID. More...
 
t_status machine_cpu_id (uint32_t op, uint32_t param, t_cpu_regs *regs)
 Execute a CPUID machine instruction Provides raw access to the underline CPUID instruction. More...
 
t_status machine_cpu_getEndian (t_cpu_endian *endian)
 Retrieve the endianess of a CPU architecture. More...
 
t_status machine_cpu_getEndianString (const char **endian)
 Retrieve the string describing the endianess of a CPU architecture. More...
 
t_status machine_cpuVendor_getName (t_size nsize, char **name)
 Retrieve the CPU Vendor name. More...
 
t_status machine_cpuVendor_getNameFromId (uint16_t id, const char **name)
 Retrieve the CPU Vendor name form the Vendor ID. More...
 
t_status machine_cpuVendor_getIDFromName (const char *name, int *id)
 Retrieve the CPU Vendor Identification from a Vendors name. More...
 
t_status machine_cpuFeature_supports (void)
 Check if the OSAPI library or the CPU supports features. More...
 
t_status machine_cpuFeature_getAll (t_cpu_feature_list *list)
 Retrieval all supported CPU features. More...
 
t_status machine_cpuFeature_isAvailable (const t_cpu_feature_list *list, unsigned int id, bool *available)
 Check if a feature is available in the feature list. More...
 
t_status machine_cpuFeature_getName (unsigned int fid, const char **name)
 Retrieve a name that corresponds to a feature ID. More...
 
t_status machine_cpuFeature_getDescription (unsigned int fid, const char **desc)
 Retrieve a descroption that corresponds to a feature ID. More...
 
t_status machine_cpuFeature_count (const t_cpu_feature_list *list, t_size *nfeatures)
 Count number of available features in list. More...
 
t_status machine_cpuFeature_getListName (const t_cpu_feature_list *features, t_list *list)
 Retrieve a list containing pointers to Feature Names. More...
 
t_status machine_cpuFeature_getListDescription (const t_cpu_feature_list *features, t_list *list)
 Retrieve a list containing pointers to Feature Descriptions. More...
 
t_status machine_device_getNumber (t_size *number)
 Obtain the number of machine devices. More...
 
t_status machine_device_getList (t_list *devList)
 Get a list of machine devices. More...
 
t_status machine_domain_getName (t_size maxlen, t_char *domainname)
 Get the machine domain name. More...
 
t_status machine_domain_setName (t_char *domainname)
 Set the machine domain name. More...
 
t_status machine_host_getName (t_size maxlen, t_char *hostname)
 Obtain the machine hostname. More...
 
t_status machine_host_setName (t_char *hostname)
 Set the machine hostname. More...
 
t_status machine_ip_getNumber (t_protocol selector, t_size *number)
 Obtain the number of IPs for the given protocol. More...
 
t_status machine_ip_getList (t_protocol selector, t_size number, t_ip *list)
 Retrieves a list containing the machine IPs. More...
 
t_status machine_virtual_is (bool *result)
 Is this process running inside a Virtual machine? More...
 
t_status machine_virtual_getInfo (t_vm *vm)
 Obtain information about a virtual machine. More...
 
t_status machine_virtual_getVendor (t_vm *vm, char **vendor)
 Obtain information about a virtual machine. More...
 

Detailed Description

The machine management module.


Function Documentation

◆ internal_cpu_amd_getFeatures()

t_status internal_cpu_amd_getFeatures ( uint32_t  featLevel,
t_cpu_feature_list p_list 
)

Obtain the AMD CPU available features/functions.

Parameters
[in]featLevel- The maximum feature level supported by the CPU
[out]p_list- List of supported CPU features
Returns
Operation status

◆ internal_cpu_intel_getFeatures()

t_status internal_cpu_intel_getFeatures ( uint32_t  featLevel,
t_cpu_feature_list p_list 
)

Obtain the Intel CPU available features/functions.

Parameters
[in]featLevel- The maximum feature level supported by the CPU
[out]p_list- List of supported CPU features
Returns
Operation status
Here is the caller graph for this function:

◆ machine_cpu_getArch()

t_status machine_cpu_getArch ( const char **  arch)

Retrieve the target (compiled) CPU architecture.

Parameters
[out]arch- Name of CPU Architecture
Returns
Operation status

◆ machine_cpu_getEndian()

t_status machine_cpu_getEndian ( t_cpu_endian *  endian)

Retrieve the endianess of a CPU architecture.

Parameters
[out]endian- Get the CPU endianess
Returns
Operation status
Here is the caller graph for this function:

◆ machine_cpu_getEndianString()

t_status machine_cpu_getEndianString ( const char **  endian)

Retrieve the string describing the endianess of a CPU architecture.

Parameters
[out]endian- Get the CPU endianess string
Returns
Operation status

◆ machine_cpu_getInfo()

t_status machine_cpu_getInfo ( t_cpu info)

Obtain information about a machine CPU.

Parameters
[out]info- CPU information
Returns
Operation status

◆ machine_cpu_getSummary()

t_status machine_cpu_getSummary ( t_cpu_summary summary)

Obtain summary information about machine CPUs.

Parameters
[out]summary- Machine CPU summary information
Returns
Operation status
Here is the call graph for this function:

◆ machine_cpu_id()

t_status machine_cpu_id ( uint32_t  op,
uint32_t  param,
t_cpu_regs regs 
)

Execute a CPUID machine instruction Provides raw access to the underline CPUID instruction.

Parameters
[in]op- Specific operation to execute
[in]param- Parameter to the operation (If none, set it to 0)
[out]regs- List of CPU registers (machine architecture dependent)
Returns
Operation status

◆ machine_cpu_isFeatureAvailable()

t_status machine_cpu_isFeatureAvailable ( const t_cpu cpu,
unsigned int  fid,
bool *  available 
)

Retrieve a name that corresponds to a feature ID.

Parameters
[in]cpu- Machine CPU information
[in]fid- Feature ID
[out]available- True if available. False otherwise (Only if call is successful)
Returns
Operation status

◆ machine_cpuFeature_count()

t_status machine_cpuFeature_count ( const t_cpu_feature_list list,
t_size nfeatures 
)

Count number of available features in list.

Parameters
[in]list- A list of features
[out]nfeatures- Number of features found in list
Returns
Operation status

◆ machine_cpuFeature_getAll()

t_status machine_cpuFeature_getAll ( t_cpu_feature_list list)

Retrieval all supported CPU features.

Parameters
[out]list- A list to contain the CPU supported features
Returns
Operation status
Here is the call graph for this function:

◆ machine_cpuFeature_getDescription()

t_status machine_cpuFeature_getDescription ( unsigned int  fid,
const char **  desc 
)

Retrieve a descroption that corresponds to a feature ID.

Parameters
[in]fid- Item identifier
[out]desc- Feature description
Returns
Operation status

◆ machine_cpuFeature_getListDescription()

t_status machine_cpuFeature_getListDescription ( const t_cpu_feature_list features,
t_list list 
)

Retrieve a list containing pointers to Feature Descriptions.

Parameters
[in]features- The feature list
[out]list- A list of pointers to feature descriptions
Returns
Operation status

◆ machine_cpuFeature_getListName()

t_status machine_cpuFeature_getListName ( const t_cpu_feature_list features,
t_list list 
)

Retrieve a list containing pointers to Feature Names.

Parameters
[in]features- The feature list
[out]list- A list of pointers to feature names
Returns
Operation status

◆ machine_cpuFeature_getName()

t_status machine_cpuFeature_getName ( unsigned int  fid,
const char **  name 
)

Retrieve a name that corresponds to a feature ID.

Parameters
[in]fid- Feature ID
[out]name- Name of feature
Returns
Operation status

◆ machine_cpuFeature_isAvailable()

t_status machine_cpuFeature_isAvailable ( const t_cpu_feature_list list,
unsigned int  id,
bool *  available 
)

Check if a feature is available in the feature list.

Parameters
[in]list- List of available CPU features
[in]id- Feature ID
[out]available- True if available. False otherwise (Only if call is successful)
Returns
Operation status

◆ machine_cpuFeature_supports()

t_status machine_cpuFeature_supports ( void  )

Check if the OSAPI library or the CPU supports features.

Returns
Success if feature reporting is available, otherwise Failure

◆ machine_cpuVendor_getIDFromName()

t_status machine_cpuVendor_getIDFromName ( const char *  name,
int *  id 
)

Retrieve the CPU Vendor Identification from a Vendors name.

Parameters
[in]name- The Vendor name
[out]id- The Vendor ID
Returns
Operation status
Here is the caller graph for this function:

◆ machine_cpuVendor_getName()

t_status machine_cpuVendor_getName ( t_size  nsize,
char **  name 
)

Retrieve the CPU Vendor name.

Parameters
[in]nsize- The size of the buffer where the name will be stored
[out]name- The Vendor name
Returns
Operation status

◆ machine_cpuVendor_getNameFromId()

t_status machine_cpuVendor_getNameFromId ( uint16_t  id,
const char **  name 
)

Retrieve the CPU Vendor name form the Vendor ID.

Parameters
[in]id- The Vendor ID
[out]name- The Vendor name
Returns
Operation status

◆ machine_device_getList()

t_status machine_device_getList ( t_list devList)

Get a list of machine devices.

Parameters
[out]devList- Device List
Returns
Operation status

◆ machine_device_getNumber()

t_status machine_device_getNumber ( t_size number)

Obtain the number of machine devices.

Parameters
[out]number- The count of devices reported by the OS
Returns
Operation status

◆ machine_domain_getName()

t_status machine_domain_getName ( t_size  maxlen,
t_char domainname 
)

Get the machine domain name.

Parameters
[in]maxlen- The size of C-String
[out]domainname- The name of the machine domain
Returns
Operation status

◆ machine_domain_setName()

t_status machine_domain_setName ( t_char domainname)

Set the machine domain name.

Parameters
[in]domainname- New domain name
Returns
Operation status

◆ machine_host_getName()

t_status machine_host_getName ( t_size  maxlen,
t_char hostname 
)

Obtain the machine hostname.

Parameters
[in]maxlen- The size of C-String
[out]hostname- The name of the machine
Returns
Operation status

◆ machine_host_setName()

t_status machine_host_setName ( t_char hostname)

Set the machine hostname.

Parameters
[in]hostname- New hostname
Returns
Operation status

◆ machine_ip_getList()

t_status machine_ip_getList ( t_protocol  selector,
t_size  number,
t_ip list 
)

Retrieves a list containing the machine IPs.

Parameters
[in]selector- The IP protocol (IPv4/6 or all)
[in]number- The maximum size of the IP List
[out]list- The machine IPs
Returns
Operation status

◆ machine_ip_getNumber()

t_status machine_ip_getNumber ( t_protocol  selector,
t_size number 
)

Obtain the number of IPs for the given protocol.

Parameters
[in]selector- The IP protocol (IPv4/6 or all)
[out]number- Number of machine IPs matching the selector
Returns
Operation status

◆ machine_module_supported()

t_status machine_module_supported ( void  )

Declares if the module is supported on the current implementation.

Returns
SUCCESS or FAILURE

◆ machine_virtual_getInfo()

t_status machine_virtual_getInfo ( t_vm vm)

Obtain information about a virtual machine.

Parameters
[out]vm- Virtual machine information
Returns
Operation status

◆ machine_virtual_getVendor()

t_status machine_virtual_getVendor ( t_vm vm,
char **  vendor 
)

Obtain information about a virtual machine.

Parameters
[in]vm- Virtual machine information
[out]vendor- The VM provider
Returns
Operation status

◆ machine_virtual_is()

t_status machine_virtual_is ( bool *  result)

Is this process running inside a Virtual machine?

Parameters
[out]result- True if running in a VM. False otherwise.
Returns
Operation status