FLEXlm offers the most widely-used licensing API available—the FLEXlm API, which is used by over 500 software vendors worldwide. However, there has been much effort expended in the search for a “standard” licensing API.
FLEXlm offers the ISV the choice of three standard APIs:
FLEXlm is the only licensing system available which supports all three APIs.
The FLEXlm API has evolved since 1988, with the input of most of the major software vendors in the UNIX software industry. The goal of the FLEXlm API is to give you your choice of licensing models in an easy to implement, robust package. The FLEXlm API is documented in Chapter 4, “Incorporating FLEXlm Into Your Application.”
The Software License Working Group was a sub-group of the Network Computing Forum, organized by Apollo Computer in 1988. This group published a licensing system API which Globetrotter believes to be the most usable of all the “standard” licensing APIs in existence to date. FLEXlm has supported this interface since 1990. Even though this interface is vendor-neutral and well-designed, few software companies utilize this interface, and no other “standards” organizations adopted it.
![]() | Note: You cannot mix Software License Working Group calls with either the native FLEXlm calls or the LSAPI calls. |
![]() | Note: FLEXlm on Windows and Windows NT systems do not support this API. |
vendor_id (char *) | | |
vendor_key (VENDORCODE *) |
| |
job_id (LM_HANDLE *) |
| |
length (int) | Length of a string | |
text (char *) | String | |
status (int) | Status return from call | |
product_id (char *) |
| |
version (char *) | Version of feature | |
amount (int) | Number of licenses | |
queue (int) | Enqueue request flag | |
check_period (int) |
| |
license_handle (char *) |
| |
queue_position (int) |
|
ls_init (vendor_id, vendor_key, &job_id): |
| |
ls_terminate (job_id): |
| |
ls_log_message (job_id, length, text, &status): |
|
lb_request (job_id, product_id, version, amount, queue, check_period, &license_handle) | | |
lb_check_wait (license_handle, check_period, &queue_position) |
| |
lb_wait_remove (license_handle) |
| |
lb_confirm (license_handle, check_period) |
| |
lb_release (license_handle) |
| |
lb_get_cur_users (job_id, product_id, version, next, maximum_entries, queued, total_licenses, number_of_entries, entries) |
|
The LSAPI interface, a licensing API first proposed in May, 1992, was designed by a consortium of software vendors with participation from several licensing system vendors. The main “claim to fame” of this interface is that it attempts to provide a solution whereby the end-user can choose the license server product from the licensing system vendor of their own choice. While the LSAPI seems to be a simple API, it hides the fact that your code will increase in complexity in order to solve the problem of the replaceable license server, (since both the license server and the licensing system library are, in theory, replaceable by the end-user, any security must be built into your code, independent of the license server). The complexity is exposed to you in the “challenge mechanism”, which is a standard encryption technique known as “handshaking”.
![]() | Note: If you are considering using LSAPI in your product, you should read U.S. patent #5,375,206 issued to HP, and understand its implications. |
LSAPI has several significant drawbacks compared to the FLEXlm API. In addition, Globetrotter believes that the stated goal of license server independence cannot be met by the current version of the LSAPI spec (see last point below). Some of the drawbacks of LSAPI compared to the native FLEXlm API are:
Unreasonable error reporting (only a total of 14 error codes.)
No ability for the vendor to support license queueing.
No vendor-specific checkout filtering.
No provision to pass messages between the client and license server.
No way to get license status without doing I/O to the license server.
No way to support a node-locked license without a license server.
No way to retrieve information about the licensing policy.
No way to ship a vendor-neutral license. This means that, in order to accomplish the stated goal of allowing your end-user to select the licensing system from the vendor of their choice, YOU would have to provide licenses in the format required by EACH AND EVERY license system which your customer might want to choose. In practice, what this means is that you would need to build and test with every possible licensing system.
![]() | Note: You cannot mix LSAPI calls with either the native FLEXlm calls or the Software License Working Group calls. |
LS_ULONG | unsigned long | |
LS_STATUS_CODE |
| |
LS_STR | char | |
LS_CHALLENGE |
| |
LS_CHALLENGE_FLEXLM |
| |
LS_HANDLE | unsigned long | |
LS_VOID | void |
LS_STATUS_CODE LSGetMessage(LS_HANDLE Handle, LS_STATUS_CODE Value, LS_STR *Buffer, LS_ULONG BufferSize) |
|
LS_STATUS_CODE LSQuery(LS_HANDLE Handle, LS_ULONG Information, LS_VOID *InfoBuffer, LS_ULONG BufferSize, LS_ULONG *ActualBufferSize) |
|
LS_STATUS_CODE LSRelease(LS_HANDLE Handle, LS_ULONG TotUnitsConsumed, LS_STR *LogComment) |
|
LS_STATUS_CODE LSRequest(LS_STR *LicenseSystem, LS_STR *PublisherName, LS_STR *ProductName, LS_STR *Version, LS_ULONG TotUnitsReserved, LS_STR *LogComment, LS_CHALLENGE *Challenge, LS_ULONG *TotUnitsGranted, LS_HANDLE *Handle) |
|
![]() | Note: The challenge in your first LSRequest() call must be of type LS_CHALLENGE_FLEXLM, which is a FLEXlm vendor specific challenge mechanism. Challenge should be setup as in the following code example before calling LSRequest(): |
LS_CHALLENGE_FLEXLM *Challenge; LM_CODE(vendor_code, ENCRYPTION_CODE_1, ENCRYPTION_CODE_2, VENDOR_KEY1, VENDOR_KEY2, VENDOR_KEY3, VENDOR_KEY4, VENDOR_KEY5); ... Challenge->Protocol = LS_FLEXLM_PROTOCOL; strcpy( Challenge->ChallengeData.VendorName, VENDOR_NAME); Challenge->ChallengeData.VendorCode = vendor_code; Challenge->Size = sizeof(*Challenge); ... LSRequest( ...., (LS_CHALLENGE *)Challenge, ...); |
LS_STATUS_CODE LSUpdate(LS_HANDLE Handle, LS_ULONG TotUnitsConsumed, LS_ULONG TotUnitsReserved, LS_STR *LogComment, LS_CHALLENGE *lpChallenge, LS_ULONG *TotUnitsGranted) |
|
For more details on the LSAPI interface, see the “License Service Application Programming Interface, API Specification v1.1,” or contact Microsoft via e-mail at “lsapi@microsoft.com”, or Dave Berry, Microsoft Developer Relations, 1 Microsoft Way, 4/2, Redmond, WA 98052-6399.
Remember, you cannot mix LSAPI and native FLEXlm calls in a single application. The license servers can support a mix of applications which use either native FLEXlm or LSAPI, but a single executable must use either native FLEXlm or LSAPI.