Knowledgebase Home | Favorites | Login Knowledgebase Home | Favorites | Login
Search the Knowledgebase Browse by Category or Article ID
How to do custom comparison of hostids?
User Opinions (2 votes)
100% thumbs up 0% thumbs down

Thank you for rating this answer.
Article ID: 238

Last Updated: 20th August 2010 10:48:33 am

This tutorial describes how to do custom comparison of hostids. This is useful when you want to implement custom verification. For example, you can specify match rules that allow a license to succeed when 2 of 3 hostids are valid, rather than requiring strict 1:1 matching. 

Start by setting a custom hostid function. This allows you to make custom hostids in license files with type HOSTID_CUSTOM:
LMX_SetOption(LmxHandle, LMX_OPT_CUSTOM_HOSTID_FUNCTION, (LMX_OPTION) MyHostid);

Next line lets you customize comparison of hostids in order to allow partial matching instead of 1:1 matching.
LMX_SetOption(LmxHandle, LMX_OPT_HOSTID_COMPARE_FUNCTION, (LMX_OPTION) HostidCompare);

MyHostid and HostidCompare functions must be implemented, obviousely:
LMX_STATUS LMX_CALLBACK MyHostid(LMX_HOSTID *pHostid, int *npHostids) {...}
LMX_STATUS LMX_CALLBACK HostidCompare(int nKeyHostidType, const LMX_HOSTID pLicenseHostid[], int nLicenseHostids, const LMX_HOSTID pSystemHostid[], int nSystemHostids) {...}


More detailed  code example is available on request.

Related Content
Related Articles
Attachments
No attachments were found.
All Content Copyright © 2002-2012 X-Formation. All Rights Reserved.