...
Code Block | ||
---|---|---|
| ||
LMX_STATUS LMX_CALLBACK MyHostidCallback(LMX_HOSTID *pHostid, int *npHostids) { printf("My HostID called\n"); /* Set the length of the data of this HostID. */ /* Its length can be up to LMX_MAX_SHORT_STRING_LENGTH */ strcpy(pHostid[0].szValue, "abcd"); /* Set optional description. */ /* Its length can be up to LMX_MAX_SHORT_STRING_LENGTH */ strcpy(pHostid[0].szDescription, "my HostID"); /* Now we do it once more for a 2nd HostID. */ strcpy(pHostid[1].szValue, "12345"); strcpy(pHostid[1].szDescription, "my HostID2"); /* Set that we return 2 custom HostIDs. */ *npHostids = 2; /* The function must return either LMX_SUCCESS or LMX_UNKNOWN_ERROR. */ return LMX_SUCCESS; /* return LMX_UNKNOWN_ERROR; */ } |
The same callback function is also required to use custom HostIDs on a license server. In lmxserverconf lmx_server_conf.c you can set the custom HostID callback function to create licenses that are locked to a license server with a custom HostID.
...