Coding a Standard License Authorization/Request

Declare Variables/Constants

#define FEATURE_NAME           "Feature1"
#define CONTACT_SERVER         "no-net"

sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_app_context_t *pAppContext = NULL;
sntl_licensing_login_session_t *pLoginSession = NULL;

API Calls

To request a license, execute the APIs in the specified sequential order only:

sntl_licensing_attr_new(&pAttrAppContext);
sntl_licensing_attr_set_appcontext_contact_server (pAttrAppContext, CONTACT_SERVER);
sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);
sntl_licensing_login(pAppContext, FEATURE_NAME, &pLoginSession);

NOTE   If instead the LSFORCEHOST or LSHOST environment variables are set, then the above-mentioned steps are not required.

Notes

>In the use case described above, a license is being requested in standalone licensing environment. For network licensing scenario, you need to change the CONTACT_SERVER constant to the IP address or hostname of the system hosting the Sentinel RMS License Manager. For example,

#define CONTACT_SERVER         "50.155.68.24"

>If the License Manager is running on the same system as the client application.

#define CONTACT_SERVER         "localhost"

>In the case you want to include additional parameters (like feature version or vendor usage data) at the time of a license request, then you may use sntl_licensing_login_attr along with sntl_licensing_attr_set API function (or a related macros as described below):

To associate a feature version, use the macro sntl_licensing_attr_set_feature_version prior to the sntl_licensing_login_attr call.

To associate vendor usage data, use the macro sntl_licensing_attr_set_login_vendor_usage_data prior to the sntl_licensing_login_attr call.

>Refer to the C sample of the Unified API (installed in the Sentinel RMS SDK) for a specific API function, its parameters, and usage.