Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The LMX_Hostid function retrieves the HostID values from the computer system.

Prototype

Code Block
languagecpp
LMX_STATUS LMX_Hostid

...


(
   LMX_HANDLE LmxHandle,

...


   LMX_HOSTID_TYPE eHostidType,

...


   LMX_HOSTID *lpHostid,

...


   int *npHostids

...


);

Parameters

LmxHandle
[in/out] LM-X handle.

...

When using LMX_HOSTID_ALL, all HostIDs are returned, with the HostID type prefixing the HostID; for example, "ETHERNET=0123456789012345,USERNAME=MyUserName,HOSTNAME=MyHostName,...", etc. Otherwise, the HostID is returned without the HostID type prefixing the HostID; for example, for HostID type LMX_HOSTID_ETHERNET, the string in the preceding example would appear as "0123456789012345".

Examples:

Code Block
languagecpp
LMX_HOSTID Hostids[LMX_MAX_HOSTIDS];

...


int nHostids;

...


int i, j;

...


LMX_Hostid(LmxHandle, LMX_HOSTID_ETHERNET, Hostid, &nHostids);

...


for (i = 0; i < nHostids; i++) 

...


  printf("Hostid: %s\n", Hostid[i].szValue);

To make use of custom HostIDs, you must set a callback function using LMX_SetOption with the flag LMX_OPT_CUSTOM_HOSTID_FUNCTION.