FLEXlm Reference Manual PDF
FLEXlm Reference Manual PDF
Reference
Manual
VERSION 9.5
AUGUST 2004
COPYRIGHT NOTICE
TRADEMARKS
RESTRICTED RIGHTS LEGEND
Globetrotter, Macrovision, FLEXlm,
FLEXlock, FLEXbill, Flexible Use, duplication, or disclosure by the
License Manager, and GTlicensing are government is subject to restrictions as
registered trademarks or trademarks of set forth in subparagraph (c)(1)(ii) of
Macrovision Corporation. the Rights of Technical Data and
All other brand and product names Computer Software clause of DFARS
mentioned herein are the trademarks 252.227-0713 and FAR52.227-19
and registered trademarks of their and/or applicable Federal Acquisition
respective owners. Regulation protecting the commercial
ownership rights of independently
developed commercial software.
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1 FLEXlm APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1.1 Trivial and Simple APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1.2 FLEXible API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.1.3 Migrating to the FLEXible API . . . . . . . . . . . . . . . . . . . . . . . 18
1.2 FLEXlm Terms and Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 2 The License File: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1 Format of the License File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Hostids for FLEXlm-Supported Machines . . . . . . . . . . . . . . . . . . . 25
2.3 Types of License Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.1 Simple Uncounted License . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.2 Expiring Demo License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.3 Simple Floating (Counted) License . . . . . . . . . . . . . . . . . . . . 27
2.3.4 Floating with Three Server Redundancy . . . . . . . . . . . . . . . . 28
2.3.5 Mixed Floating (Counted) and Uncounted . . . . . . . . . . . . . . . 28
2.4 License in a Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 3 The License File: Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1 General Syntax Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.1.1 Comment Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.1.2 Line Continuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2 SERVER Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3 VENDOR Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.4 USE_SERVER Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5 FEATURE /INCREMENT Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5.1 Feature Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.2 Vendor Daemon Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.3 Feature Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.4 Expiration Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.5 Number of Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Product Information
FLEXlm is a software licensing package that allows licensing a software
application on a concurrent-usage as well as on a per-computer basis. FLEXlm
allows the implementation of a wide variety of license policies by the
developer of an application.
With FLEXlm, you, the application developer, can restrict the use of your
software packages to a:
• Single specified computer
• Specified number of users on a network of one or more computer systems
FLEXlm is available on UNIX and Windows. FLEXlm features include:
• Operation in a heterogeneous network of supported computer systems
• Transparent reconnection of applications when their license server process
becomes unavailable, including conditions of license server node failure
Typographic Conventions
The following typographic conventions are used in this manual:
• The first time a new term is used it is presented in italics.
• Commands and path, file, and environment variable names are presented
in a fixed_font.
• Other variable names are in an italic_fixed_font.
• API function calls are in a sans-serif font.
xiv
Contacting Technical Support
xvi
Chapter 1
Introduction
18 Introduction
FLEXlm Terms and Definitions
20 Introduction
FLEXlm Terms and Definitions
Uncounted license A license that does not restrict the number of uses
of an application. Uncounted licenses must be
node-locked to a machine hostid—node-locked,
uncounted licenses do not require a license server.
Vendor daemon The server process that dispenses licenses for the
requested features. This binary is built by an
application’s vendor (from libraries supplied by
Macrovision) and contains the vendor’s unique
encryption seeds.
Vendor name The name of the vendor as found in lm_code.h.
Used as the name of the vendor daemon.
22 Introduction
Chapter 2
This chapter provides an overview of the license file format and examples of
license file types. Once you have an idea of the license file format for your
FLEXlm-enabled product, proceed to Chapter 3, “The License File: Syntax,”
for specific syntactical information.
Note: See the FLEXlm Programmers Guide for information on lmcrypt and
makekey, the license generation utilities. Also see Section 6.4.4,
“lc_cryptstr(),” for generating licenses with a C function call.
Vendors and license administrators read the license file to understand how the
licensing behaves, for example, what features are licensed, the number of
licenses, whether these features are node-locked, if the features are demo or
regular, etc.
The SERVER hostids and everything on a FEATURE line, except the vendor
daemon name and lowercase keyword=value pairs, are input to the
authentication algorithm to generate the signature for that FEATURE line. If
the authenticated portions are edited, an LM_BADCODE error will result
when the FLEXlm-enabled product tries to checkout a license for that feature.
In summary, the only data items in the license file that are editable by the end
user are:
• Host names on SERVER lines
• Port numbers on the SERVER or VENDOR lines
• Path names on VENDOR lines
• Options file path names on VENDOR lines
• Lowercase keyword=value pairs on FEATURE lines
Any amount of white space can separate the components of license file lines;
data can be entered via any plain text editor. Vendors can therefore distribute
license data via fax or telephone.
8-bit Latin-based characters are fully supported in license files, options files,
log files, and client environments.
VENDOR demo
• Host name can be changed by the end user. If host name is this_host,
clients running on the same node as the server work fine. Clients on other
nodes fail unless the host name is changed, or the clients use @host (or
port@host if a port number is specified on the SERVER line) to find the
server.
This chapter is a reference for license file syntax. It is divided up into sections
which correspond to the different license file sections as outlined in Section
2.1, “Format of the License File.” For an overview of license files, see Chapter
2, “The License File: Overview.”
Table 3-1 lists the license file sections described in this chapter.
Section Synopsis
General Syntax Issues Syntax rules common to all sections.
Server Information
SERVER Lines Contains information about the
machines running the license server,
lmgrd.
Section Synopsis
FEATURE /INCREMENT Lines Describes the licensed features
available for the specified vendor’s
products.
UPGRADE Lines Creates a new version of the license,
thereby replacing the older one.
A SERVER line specifies the name and hostid of the license server machine
and, optionally, the TCP/IP port number through which to communicate to
lmgrd. A license file may have one or three SERVER lines. The SERVER
node name in the license file can be any network alias for the node.
Note: The SERVER line must apply to all lines in the license file. It is permitted to
combine license files from different vendors, but only if the SERVER hostids
are identical in all files that are to be combined. A license-file list can be used
if hostids are not identical, but refer to the same machine.
SEE ALSO
• FLEXlm End Users Guide
• Section 3.5.10, “HOSTID”
• Chapter 15, “Vendor-Defined Hostid Types”
The VENDOR line specifies the name and location of a vendor daemon, as
well as the location of the end user’s options file.
Note: A port number must be specified in the VENDOR line when you are
connecting to the vendor daemon through a firewall.
UNIX EXAMPLES
VENDOR acmed
VENDOR acmed /etc/acmed
VENDOR acmed /etc/acmed options=/usr/local/licenses/acmed.opts
WINDOWS EXAMPLES
VENDOR acmed C:\Windows\system\acmed.exe
VENDOR acmed C:\Windows\system\acmed.exe \
options=C:\licenses\acmed.opts
USE_SERVER takes no arguments and has no impact on the server. When the
client application sees a USE_SERVER line, it ignores everything in the
license file except the preceding SERVER lines. In effect, USE_SERVER
forces the application to behave as though LM_LICENSE_FILE were set to
port@host or @host. USE_SERVER is recommended because it improves
performance when a license server is used.
The advantages to USE_SERVER are that the application’s license file:
• Does not need to match the one the server uses
• Requires only SERVER and USE_SERVER lines
The optional keywords must appear after all positional fields, but can appear
in any order. User keywords are not involved in license authentication. This
means they can be modified and the license will remain valid. The signature is
required to be last. Table 3-2 summarizes the FEATURE/INCREMENT fields
and keywords.
Keyword
Positional Fields — in required order
Feature Name
Vendor Daemon Name
Feature Version
Expiration Date
Number of Licenses
Authenticated Vendor Keywords
BORROW
DUP_GROUP
FLOAT_OK
HOST_BASED
HOSTID
ISSUED
MINIMUM
OVERDRAFT
PLATFORMS
START
SUITE_DUP_GROUP
SUPERSEDE
Keyword
TS_OK
USER_BASED
VENDOR_STRING
NOTICE
SN
Unauthenticated Keywords
asset_info
dist_info
user_info
vendor_info
sort
Signature
SIGN
There are two formats for FEATURE; pre-v3.0 and current. The older format
is still understood and correct with new clients and servers, but the current
format is more flexible.
LICENSE POOLS
INCREMENT lines form license groups, called license pools, based on the
following fields:
• feature name
• version
• DUP_GROUP
• FLOAT_OK
• HOST_BASED
• HOSTID
• PLATFORM
• USER_BASED
• VENDOR_STRING (if configured by the vendor as a pooling component)
If two lines differ by any of these fields, a new license pool is created in the
vendor daemon, and this group is counted independently from other license
pools with the same feature name. A FEATURE line does not give an
additional number of licenses, whereas an INCREMENT line always gives an
additional number of licenses.
Consider the following example that demonstrates license pooling:
SERVER speedy 08002b32b161
VENDOR demo
INCREMENT f1 demo 2.0 permanent 1 SIGN=2B8F621C172C
INCREMENT f1 demo 2.0 permanent 2 SIGN=2B9F124C142C
• INCREMENT — the server adds up licenses for all lines for the same
feature name forming a license pool for feature “f1.” The concurrent
usage limit is 3 (1 + 2).
• The first INCREMENT line could be a FEATURE line and the behavior
would be the same.
Now, in contrast, this next example shows separate pooling:
SERVER speedy 08002b32b161
VENDOR demo
INCREMENT f1 demo 2.0 permanent 1 HOSTID=80029a3d \
SIGN=7B9F02AC0645
INCREMENT f1 demo 2.0 permanent 2 HOSTID=778da450 \
SIGN=6BAFD2BC1C3D
These lines form two separate license pools, one with 3 licenses for v1.0 and
one with 4 licenses for v2.0. A request for 5 licenses for version v1.0 is denied
because neither pool has 5 licenses.
FEATURE/INCREMENT EXAMPLE
To illustrate the difference between FEATURE and INCREMENT, consider
these feature lines:
FEATURE f1 demo 1.0 permanent 4 ....
FEATURE f1 demo 2.0 permanent 5 ....
They result in four licenses for v1.0 or five licenses for v2.0, depending on
their order in the file. Now, consider:
INCREMENT f1 demo 1.0 permanent 4 ....
INCREMENT f1 demo 2.0 permanent 5 ....
• These result in four licenses for v1.0 and five licenses for v2.0 and below
being available, giving a total of nine licenses for “f1.”
• INCREMENT lines must differ in some way — otherwise only one is
used.
COUNTED VS. UNCOUNTED
To contrast counted with uncounted licenses, consider the following
FEATURE line:
FEATURE f1 demo 1.0 1-jan-2005 uncounted HOSTID=DEMO \
SIGN=123456789012
This feature has unlimited usage on any hostid, requires no license server and
is, therefore, could be a complete license file by itself. It also happens to be an
expiring license and will not allow use of the feature after 1-jan-2005.
In contrast, because it is counted, the following feature requires a license server
with a vendor daemon named “demo”:
FEATURE f1 demo 1.0 permanent 5 HOSTID=INTERNET=195.186.*.* \
SIGN=123456789012
It limits license usage to five users on any host with an Internet IP address
matching 195.186.*.* and it never expires. It must be in a license file with
SERVER and VENDOR lines.
SEE ALSO
• Chapter 15, “Vendor-Defined Hostid Types”
• Section 8.3.9, “ls_use_all_feature_lines”
• Section 13.2.4, “ls_compare_vendor_on_increment and
ls_compare_vendor_on_upgrade”
• Section 8.2.5, “LM_A_CRYPT_CASE_SENSITIVE”
3.5.1 Feature Name
feature is the name given to the feature by the vendor. Legal feature names
in FLEXlm must contain only letters, numbers, and underscore characters.
Letters in the feature name are case insensitive by default. If case
sensitivity is desired, see Section 8.2.10,
“LM_A_LICENSE_CASE_SENSITIVE.”
3.5.2 Vendor Daemon Name
vendor is the vendor daemon name from a VENDOR line. This vendor
daemon serves this feature.
3.5.3 Feature Version
The feat_version is the latest (highest-numbered) version of this feature
that is supported by this license file. The version is in floating-point format,
with a ten character maximum.
Optional field. Enables mobile licensing via FLEXid with FLOAT_OK for a
particular FEATURE/INCREMENT line (see the FLEXlm Programmers
Guide for more information about mobile licensing). This
FEATURE/INCREMENT line must also be node-locked to a FLEXid.
When FLOAT_OK=server_hostid is specified on a FEATURE line:
• The server_hostid must refer to the same host that appears on the
SERVER line of the license file.
• The license server can only be run on the machine with the hostid that
lmhostid returns equal to the server_hostid specified with
FLOAT_OK.
• A user can run on the license server machine, but he can use only the
license being served by the license server, not the node-locked license.
Otherwise an extra use for each FLOAT_OK license could occur.
• The hostid on the FLOAT_OK FEATURE line must be only a single
hostid. For multiple dongles, use individual FEATURE lines for each
dongle.
3.5.9 HOST_BASED
HOST_BASED[=n]
3.5.10 HOSTID
HOSTID="hostid1 hostid2 ... hostidn"
If a list of hostids is used, the feature is granted on any one of the hostids in the
list.
HOSTID LIST CONSIDERATIONS
For uncounted licenses, the following line:
FEATURE f0 ... uncounted HOSTID="hostid1 hostid2 hostid3"
However, providing the following three FEATURE lines, each with one
license node-locked to one hostid, provides three licenses:
FEATURE f0 ... 1 HOSTID=hostid1
FEATURE f0 ... 1 HOSTID=hostid2
FEATURE f0 ... 1 HOSTID=hostid3
SEE ALSO
• FLEXlm End Users Guide for information about platform-specific and
special hostids.
• Section 3.2, “SERVER Lines”
3.5.11 ISSUED
ISSUED=dd-mmm-yyyy
Optional field. Date that the license was issued. Can be used in conjunction
with SUPERSEDE.
3.5.12 ISSUER
ISSUER="..."
Note that the trailing digit in the FLEXlm platform name is ignored, and can
be optionally left off in the name.
If the platform list differs in any way for two INCREMENT lines for the same
feature name, they are pooled and counted separately.
Examples:
FEATURE f1 ... PLATFORMS=sun4_u5
INCREMENT f2 ... 1 PLATFORMS="i86_n hp700_u"
INCREMENT f2 ... 1 PLATFORMS="i86_n"
Required field. Signature for this FEATURE line. signature is from 12-20
characters long and is produced by lc_cryptstr() in lmcrypt or makekey, or by
a vendor-defined utility that calls lc_crypstr(). When using lmcrypt, put
SIGN=0 at the end of each FEATURE line, and lmcrypt will replace the 0
with the correct signature.
3.5.18 SN
SN=serial_num
3.5.19 START
START=dd-mmm-yyyy
Optional field. Feature start date. If the license is used before this date, the
checkout fails with LM_TOOEARLY.
3.5.20 SUITE_DUP_GROUP
SUITE_DUP_GROUP=NONE|SITE|[UHDV]
Note: If SUITE_DUP_GROUP is not specified, the parent will have the same
duplicate grouping as the components.
Optional field. Replaces existing lines in a license file. Without the optional list
of features, allows vendors to sum up a set of INCREMENT lines in a single,
new FEATURE (or INCREMENT) line, which supersedes all INCREMENT
lines for the same feature name with previous START or ISSUED dates. With
the optional list of features, it replaces all previously issued lines for feat1
through featn.
Specifying the start date with the ISSUED= keyword makes this date explicit
(e.g., ISSUED=1-jan-2005). If the ISSUED date is set, then SUPERSEDE uses
it, otherwise it uses the START= date.
For example
The second line supersedes the first, and causes FLEXlm to ignore the first
line.
FEATURE f1 ... 1 ... ISSUED=1-jan-2003
FEATURE f2 ... 1 ... ISSUED=1-jan-2003
FEATURE f3 ... 4 ... SUPERSEDE="f1 f2" ISSUED=2-jan-2003
“f3” supersedes “f1” and “f2” and causes FLEXlm to support only “f3.”
Multiple INCREMENT lines for the same feature both specifying
SUPERSEDE with the same ISSUED= date will be pooled together rather than
superseding one another. The resulting license pool will collectively supersede
the older feature. For example:
INCREMENT f1 ... 1 ... ISSUED=1-jan-2005
INCREMENT f1 ... 4 ... SUPERSEDE ISSUED=1-jan-2007
INCREMENT f1 ... 3 ... SUPERSEDE ISSUED=1-jan-2007
2. Feature name.
3. FEATURE before INCREMENT.
4. Uncounted before counted.
5. Version, lower versions before higher versions.
6. Issued date, in reverse order, newest first. The date is taken from ISSUED=
or START=.
7. Original order is otherwise maintained.
To turn off automatic ordering, add sort=nnn, where nnn is the same on all
lines. Automatic ordering does not affect the order of features returned by
lc_feat_list().
3.5.28 user_info
user_info="..."
All the data is the same as for a FEATURE or INCREMENT line, with the
addition of the from_feat_version field. An UPGRADE line removes up
to the number of licenses specified by num_lic from any old version (>=
from_feat_version) and creates a new version with that same number of
licenses.
UPGRADE operates on preceding FEATURE or INCREMENT lines, starting
with the first one with the lowest version, whose version number is >=
from_feat_version, and < to_feat_version.
For example, the two lines:
INCREMENT f1 demo 1.0 1-jan-2005 5 SIGN=9BFAC03164ED
UPGRADE f1 demo 1.0 2.0 1-jan-2005 2 SIGN=1B9A30316207
result in 3 licenses for v1.0, the original 4 licenses for v2.0, and 2 licenses for
v3.0 (taken from the original group of five v1.0 licenses).
Now consider this scenario:
INCREMENT f1 demo 1.0 1-jan-2005 5 SIGN=9BFAC03164ED
INCREMENT f1 demo 2.0 1-jan-2005 4 SIGN=8BF3fb031643
UPGRADE f1 demo 1.0 3.0 1-jan-2005 10 SIGN=afb303162056
This results in 9 licenses for v3.0 (5 v1.0 plus 4 v2.0 all upgraded to v3.0) and
1 unused upgrade.
LICENSE POOL CONSIDERATIONS
Multiple UPGRADE lines applied to a set of FEATURE and INCREMENT
lines can have the result of creating separate license pools where they did not
previously exist. Subsequent checkout requests are subject to multiple license
pool restrictions. For example,
INCREMENT f1 demo 1.0 1-jan-2005 8 SIGN=9BFAC03164ED
UPGRADE f1 demo 1.0 2.0 1-jan-2005 5 SIGN=afb303162056
UPGRADE f1 demo 1.0 3.0 1-jan-2005 3 SIGN=afb303162056
This upgrade scenario results in breaking up the one license pool of 8 licenses
for v1.0 into two license pools: one with 5 licenses for v2.0 and one with 3
licenses for v3.0. A checkout request of 6 licenses for v1.0 is denied because
neither pool has 6 licenses; whereas, before the upgrade it would be granted
because of the single pool of 8 licenses for v1.0.
where:
For the above PACKAGE and FEATURE line, note the following:
• The FEATURE line enables the PACKAGE line.
• The each component inherits information from the enabling FEATURE
line. In this example, they all inherit the expiration date, number of
licenses, and hostid.
• The enabling FEATURE line must match the name, version, and vendor
name of the PACKAGE line.
• The PACKAGE line can be shipped with the product, since it contains no
customer-specific fields.
• PACKAGE lines can be shipped in a separate file that never needs end-
user editing, so long as the file is include in the license-file list.
• These PACKAGE and FEATURE lines, together, are a more efficient way
of delivering the following 7 FEATURE lines:
FEATURE c1 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=D03F02432106
FEATURE c2 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=99375F40FD85
FEATURE c3 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=68FAC130DB90
FEATURE c4 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=D3D617E2075A
FEATURE c5 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=5A91D6EFB68C
FEATURE c6 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=8F75798EB975
FEATURE c7 demo 1.0 permanent uncounted HOSTID=778da450 SIGN=790545E90575
This license file defines a package suite named office with three
components: write, paint, and draw. Note that the suite duplicate grouping
criterion, SUITE_DUP_GROUP=U, is defined in this example to the user level
(the feature duplicate grouping criterion, DUP_GROUP=NONE, is the default
and is supplied in this example for clarity). At most two distinct users can be
granted licenses at any one time and once one component is checked out, the
others in the package are reserved for that user. This concept is illustrated in
the following table with two users.
License
Requested
Checkout User Result Explanation
Feature
Attempt
#1 u1 write granted User u1 checks out
one component,
thereby reserving
one package
license.
#2 u2 paint granted User u2 checks out
one component,
thereby reserving
the second
package license.
#3 u1 write denied Maximum number
of package
licenses exceeded
#4 u3 paint denied Maximum number
of package
licenses exceeded..
#5 u1 paint granted A paint license is
available for user
u1.
License
Requested
Checkout User Result Explanation
Feature
Attempt
#7 u2 write granted User u2 rightfully
gets the second
write license.
Now, consider this variation where one user grabs both package licenses:
License
Requested
Checkout User Result Explanation
Feature
Attempt
#1 u1 write granted User u1 checks out
one component,
thereby reserving
one package
license.
#2 u1 write granted User u1 checks out
another
component,
thereby reserving
the second
package license.
#3 u2 write, denied Maximum number
paint, of package
or draw licenses exceeded
License
Requested
Checkout User Result Explanation
Feature
Attempt
#4 u1 draw granted Both draw license
are reserved for
#5 u1 draw granted user u1.
Note that both available sets of package components are reserved for user u1
by virtue of that user initially being granted two identical component licenses.
In the example depicted above, user u1 gets both of the grants for write,
thereby reserving the rest of the components from both available packages for
him. This paradigm shuts out user u2 from any of the licenses in the package.
DUPLICATE GROUPING CONSIDERATIONS
When OPTIONS=SUITE_RESERVED is specified in the PACKAGE line, set
DUP_GROUP=NONE in the component FEATURE lines. Specifying
DUP_GROUP with any other setting masks the “reserved” feature and the
behavior is as if OPTIONS=SUITE had been specified in the PACKAGE line.
Consider the following license file with DUP_GROUP set:
PACKAGE office demo 1.0 COMPONENTS="write paint draw" \
OPTIONS=SUITE_RESERVED SIGN=00504091605D
FEATURE office demo 1.0 permanent 2 \
SUITE_DUP_GROUP=U DUP_GROUP=U SIGN=DB5CC00101A7
This variation has the same behavior as in “A Fixed Number of Users with
Unlimited Component Usage” below.
SEE ALSO
• Section 7.3.10, “LM_A_LICENSE_DEFAULT”
3.7.3 PACKAGE SUITE Example
A package suite provides more flexibility in the way floating licenses are used
than just granting a license that applies to one feature. Within a package suite,
a floating license is shared among the component of the package rather than
being applied to one specific feature.
Various license sharing scenarios are created within the package suite
paradigm using feature and suite duplicate grouping. The examples given
below use the U (user) duplicate grouping criterion. Other criteria — H (host),
D (display), and V (vendor defined) — can be used to provide a finer
This license file defines a package suite named office with three
components: write, paint, and draw. Additionally, the suite and feature
duplicate grouping criteria, SUITE_DUP_GROUP=U and DUP_GROUP=U, are
defined to the user level. At most two distinct users at any one time can be
granted unlimited licenses. This concept is illustrated in the following table.
License
Requested
Checkout User Result Explanation
Feature
Attempt
#1 u1 write, paint, unlimited Unlimited licenses
or draw grant available for at
most two distinct
#2 u2 write, paint, unlimited users.
or draw grant
#3 u3 write, paint, denied Maximum number
or draw of distinct users
exceeded.
This license file defines a package suite named office with three
components: write, paint, and draw. Additionally, the suite duplicate
grouping criterion, SUITE_DUP_GROUP=U, is defined to the user level (the
feature duplicate grouping criterion, DUP_GROUP=NONE, is the default and is
supplied in this example for clarity). At most two distinct users can be granted
licenses at any one time and at most two licenses can be granted for each suite
component at any one time. Once the licenses are consumed, no further
licenses are available for checkout. This concept is illustrated in the following
table.
License
Requested
Checkout User Result Explanation
Feature
Attempt
#1 u1 or u2 write granted Two write
licenses available
#2 u1 or u2 write granted for at most two
distinct users.
#3 u1 or u2 write denied Maximum number
of write licenses
exceeded
#4 u3 paint denied Maximum number
of distinct users
exceeded.
#5 u1 or u2 paint granted Two paint
licenses available
#6 u1 or u2 paint granted for at most two
distinct users.
License
Requested
Checkout User Result Explanation
Feature
Attempt
#7 u1 or u2 paint denied Maximum number
of paint licenses
exceeded.
#8 u3 draw denied Maximum number
of distinct users
exceeded.
#9 u1 or u2 draw granted Two draw licenses
available for at
#10 u1 or u2 draw granted most two distinct
users.
#11 u1 or u2 draw denied Maximum number
of draw licenses
exceeded.
Note that components are not reserved for a given user by virtue of that user
being granted one component. In the example depicted above, user u1 getting
both of the grants for paint does not reserve the rest of the components for
him. This paradigm allows user u2 to get the remaining four grants: two for
paint and two for draw.
SHARING A FLOATING LICENSE
Without feature or suite duplicate grouping constraints specified in the
components of package suite, a floating license is shared among the
components of the package regardless of the number of users. Consider the
following example:
PACKAGE office demo 1.0 COMPONENTS="write paint draw" \
OPTIONS=SUITE SIGN=00504091605D
FEATURE office demo 1.0 permanent 1 SIGN=DB5CC00101A7
License
Requested
Checkout User Result Explanation
Feature
Attempt
#1 any write, paint, granted One license is
or draw available for any one
of the components.
#2 any write, paint, denied Maximum number of
or draw licenses exceeded
If needed, decimal lines can be mixed with readable format lines in a license
file.
End users will normally use the lminstall command to install decimal
format licenses. Note that lminstall converts the decimal lines to readable
format. lminstall does not, however, know where your application expects
to find the license file. You will need to make the license file location clear to
the end user. Refer to the FLEXlm End Users Guide for more information on
lminstall.
Decimal format:
demo-f0-16641-00780-63392-57302-22216-00830-23011-18641-4
demo-f1-16641-00780-35488-34267-28385-54
Note that the first decimal line includes the SERVER/VENDOR information,
and the second (and any subsequent lines) are much shorter.
DEMO LICENSE:
FEATURE f2 demo 1.0 1-jun-2005 uncounted HOSTID=DEMO \
SIGN=6E06CC47D2AB
Decimal format:
demo-f2-23169-24979-00024-12403-47718-23830-1
The line includes a checksum, which can detect all single-digit errors and most
multi-digit errors in lines that are typed incorrectly.
3.8.4 Hints on Using the Decimal Format
There are some “tricks” that are used internally to make decimal lines shorter.
Knowledge of these can be useful when designing FEATURE lines.
TEXT IN OPTIONAL ATTRIBUTES
Text in the optional feature attributes are normally three times longer in the
decimal format than in the “normal” format. For example:
VENDOR_STRING=“limit 3” would require about 21 characters in the
decimal version. There’s a trick to making this shorter: If the text portion is a
decimal or hex number, then it’s stored compressed in the decimal version, and
the conversion is about 1:1 instead of 1:3.
For example: VENDOR_STRING=12345 consumes about five characters in
the decimal format. VENDOR_STRING=abcd (valid hex characters) will also
consume about five characters in the decimal format. Knowing this, you might
choose to “encode” information in the VENDOR_STRING in a numeric
format. This enhancement only applies to numbers <= 0xffffffff. For example,
VENDOR_STRING=12345678901234 will require about 14*3 = 42
characters in the decimal format.
FEATURE NAMES
Avoid underscore “_” in feature names; it’s hard to distinguish from a hyphen
“-.” For example:
demo-prod_1a-10449-31786-63556-56877-09398-10373-137
This is hard to read, and if the user mixes up the “-” and “_”, the license will
be invalid. Since you also can’t use “-” in a feature name, this means that
feature names won’t have any kind of separator. Therefore, in the example, we
suggest simply “prod1a.”
EXPIRATION DATES
For non-expiring licenses, use “permanent” or “1-jan-0” as the expiration date.
Some older format, but still valid, expiration dates are not supported in the
decimal format. For example: “3-mar-0” is functionally identical to
“permanent,” but because the decimal format supports only “permanent” or “1-
jan-0,” “3-mar-0” is unsupported. Dates farther in the future require many
decimals to represent. Therefore 1-jan-9999 takes about 14 characters while
“permanent” requires about 1.
SEE ALSO
• lminstall in the FLEXlm End Users Guide
Trivial API
Note: You cannot mix function-based and macro-based Trivial API calls nor Trivial
API calls with any other API calls.
Programming examples using the Trivial API and instructions for building
your licensed application are located in the FLEXlm Programmers Guide.
4.1.1 License Acquisition
These are the basic functions which acquire and release a license. They are
required and constitute the minimum Trivial API implementation.
Function Description
lt_checkin(), Releases a license and frees all FLEXlm memory.
CHECKIN()
Function Description
lt_heartbeat(), Sends a heartbeat, manually, to the license server.
HEARTBEAT()
Function Description
lt_errstring(), Returns a string describing the most recent error.
ERRSTRING()
66 Trivial API
Trivial API Descriptions
Function Description
lt_perror(), Presents current error message to user.
PERROR()
SEE ALSO
• Section 7.1, “Trivial and Simple API License Policies”
• Section 7.2, “Trivial and Simple API Policy Modifiers”
68 Trivial API
Trivial API Descriptions
SEE ALSO
• Section 7.2.1, “LM_MANUAL_HEARTBEAT”
• Section 7.2.2, “LM_RETRY_RESTRICTIVE”
• Chapter 12, “Heartbeats”
4.2.5 lt_perror(), PERROR()
SYNTAX
(void) lt_perror(string)
(void) PERROR(string)
DESCRIPTION
Presents string and a description of the most recent error to the user. On
Windows this appears in a dialog.
PARAMETERS
70 Trivial API
Trivial API Descriptions
PARAMETERS
72 Trivial API
Chapter 5
Simple API
Note: You cannot mix calls to Simple API functions with calls to any other API
functions.
Programming examples using the Simple API and instructions for building
your licensed application are located in the FLEXlm Programmers Guide.
5.1.1 Checkin and Checkout Functions
These are the basic functions which acquire and release a license. They are
required and constitute the minimum Simple API implementation.
Function Description
lp_checkin() Releases a license and frees all FLEXlm memory.
lp_checkout() Acquires a license.
Function Description
lp_heartbeat() Sends a manual heartbeat to the license server.
Function Description
lp_errstring() Returns a string describing the most recent error.
lp_perror() Presents current error message to user.
lp_pwarn() Presents current warning message to user.
lp_warning() Returns a string describing the most recent
warning.
74 Simple API
Simple API Function Descriptions
PARAMETER
5.2.2 lp_checkout()
SYNTAX
#include "lmpolicy.h"
LP_HANDLE *lp_handle;
status = lp_checkout(LPCODE, policy, feature, version, num_lic,
license_file_list, &lp_handle)
DESCRIPTION
Acquires a license for a feature.
PARAMETERS
76 Simple API
Simple API Function Descriptions
5.2.3 lp_errstring()
SYNTAX
string = lp_errstring(lp_handle)
DESCRIPTION
Returns a string describing the previous FLEXlm error.
PARAMETER
RETURN
5.2.4 lp_heartbeat()
SYNTAX
status = lp_heartbeat(lp_handle, num_reconnects, num_minutes)
DESCRIPTION
lp_heartbeat() sends heartbeat messages to and receives acknowledgments
from the license server. By default, these activities are handled automatically
by FLEXlm via a separate, dedicated application thread. See Section 12.1,
“Automatic Heartbeats,” for more details on automatic heartbeat messages.
This function provides manual control of heartbeat messages; thereby,
overriding the automatic mechanism. To use lp_heartbeat(), you must first turn
off the automatic mechanism by setting the LM_MANUAL_HEARTBEAT
policy modifier in the lp_checkout() call.
If the license server goes down and later comes back up, lp_heartbeat()
automatically reconnects and checks the license out. On failure, it returns the
cumulative number of failed attempts to reconnect to the license server, each
call to lp_heartbeat() making one attempt. In which case, applications should
at a minimum notify the user of the failure. Applications can set a limit to the
number of reconnects before exiting. In addition, applications may want to exit
if reconnections succeed more than three or four times in a relatively short
period (e.g. ten minutes), which may indicate a user restarting the license
server in an attempt to acquire extra licenses.
PARAMETERS
78 Simple API
Simple API Function Descriptions
RETURN
SEE ALSO
• Section 7.2.1, “LM_MANUAL_HEARTBEAT”
• Chapter 12, “Heartbeats”
5.2.5 lp_perror()
SYNTAX
(void) lp_perror(lp_handle, string)
DESCRIPTION
Presents string and a description of the most recent error to the user. On
Windows this appears in a dialog.
PARAMETERS
5.2.6 lp_pwarn()
SYNTAX
(void) lp_pwarn(lp_handle, string)
DESCRIPTION
Presents string and a description of the most recent warning to the user. On
Windows this appears in a dialog; on other systems, it prints to stderr. This is
useful with policy set to LM_LENIENT or LM_FAILSAFE. Nothing is
printed if there is no warning.
PARAMETERS
5.2.7 lp_warning()
SYNTAX
string = lp_warning(lp_handle)
DESCRIPTION
Returns a string describing the last FLEXlm warning.
PARAMETERS
RETURN
80 Simple API
Chapter 6
FLEXible API
This is the most powerful API available for license management. As such, it
contains many options enabling considerable flexibility. Where possible, new
licensed applications should use the Trivial or Simple APIs which are
documented in Chapter 4, “Trivial API” and Chapter 5, “Simple API,”
respectively. There is, however, no reason to change APIs in applications
which already use the FLEXible API. Some FLEXlm functionality is available
only in this API. For example, the C interface to license generation,
lc_cryptstr(), is available only in the FLEXible API.
SEE ALSO
• Section 8.1, “Advanced FLEXible API Functions”
• Section D.1, “Obsolete FLEXible API Functions”
82 FLEXible API
FLEXible API Functions by Category
84 FLEXible API
FLEXible API Functions by Category
6.2.4 Informational
Table 6-5 lists the informational functions and attributes. They provide status
and usage information not critical to the license management process.
86 FLEXible API
FLEXible API Functions by Category
Attributes
LM_A_LICENSE_FMT_VER Specifies the version format of the
license that lc_cryptstr() generates.
88 FLEXible API
Commonly Used FLEXible API Functions
These and additional functions are documented in this chapter, and other
functions are documented in Appendix D, “Obsolete FLEXible API Features.”
It is rare that an application will require the functions in this appendix, and care
should be used when calling them.
90 FLEXible API
FLEXible API Function Descriptions
PARAMETERS
RETURN
ERROR RETURNS
Note: If you want a checkout to depend on information in the license file, call
lc_set_attr() with LM_A_CHECKOUTFILTER, LM_A_CHECKOUTFILTER_EX, or
LM_A_CHECKOUTFILTERLAST_EX before the call to lc_checkout().
SEE ALSO
• lmclient.h for the CONFIG struct definition
• Section 6.4.11, “lc_get_attr()”
• Section 6.4.3, “lc_checkout()”
• Section 8.2.3, “LM_A_CHECKOUTFILTER,
LM_A_CHECKOUTFILTER_EX”
• Section 8.2.4, “LM_A_CHECKOUTFILTERLAST_EX”
6.4.2 lc_checkin()
SYNTAX
(void) lc_checkin(job, feature, keep_conn)
DESCRIPTION
Checks in the licenses of the specified feature. For TCP clients, the daemon
will detect the fact that the client exited, and return any licenses that were
checked out back to the available pool. For TCP, this function is called if the
application has need of a feature for a period of time, then no longer needs it.
The second parameter is used for TCP clients to tell FLEXlm to keep the
connection open to the server for cases where another feature will be needed
shortly after this one is released. If the communications protocol is TCP, there
is no appreciable time delay incurred in returning the license if the program
exits rather than returning the license via lc_checkin(). For reporting purposes
in the report log file, it is preferable to check in a license with lc_checkin()
rather than simply exiting, because these two types of events are recorded
differently in the report log file.
PARAMETERS
92 FLEXible API
FLEXible API Function Descriptions
Place the call to lc_checkout() in an executable that is active whenever the user
is using the feature. If flag is specified as LM_CO_WAIT, then the process
will wait until the number of licenses requested for this feature are available.
The license file must specify a version that is greater than or equal to the
version in the call to lc_checkout().
If the license file is counted, that is, if the number of users specified on the
FEATURE line is non-zero, lc_checkout() will request the license from a
license server. If the number of users on the FEATURE line is uncounted, it
will grant permission based on the contents of the license file only—hostid,
version, expiration date, etc.
• Before a call to the checkout() function, it is recommended that the
application first indicate the expected license file location, with:
lc_set_attr(job, LM_A_LICENSE_DEFAULT, \
(LM_A_VAL_TYPE)license_file_list)
The license_file_list is a location in your installation hierarchy
which indicates the expected license file location. This is a directory
containing one or more license files with a .lic extension. If 0, this
argument is unused. See the FLEXlm Programmers Guide for more
information on how this location is used by the licensed application.
• Multiple checkout requests from the same process in the same license job
will not result in additional licenses being checked out, unless a new
request specifies more licenses than were previously checked out. That is,
two calls to lc_checkout(...,1,...) will result in only one license being
checked out, not two. A second call to request two licenses would result in
a total of two licenses.
• For improved security, it is recommended that the parameters feature,
version, etc., be “hidden”—the string should not be directly declared in
source code. It should be built up chars or smaller strings, and then created
via sprintf(). That way, it is more difficult for users to change the license
being checked out by altering the string in the binary.
PARAMETERS
94 FLEXible API
FLEXible API Function Descriptions
Value: Meaning:
LM_DUP_NONE Every process gets a new
license.
LM_DUP_USER All requests from this user
name share the same license.
LM_DUP_HOST All requests from this host
name share the same licenses.
This is a “floating node-
locked” license.
LM_DUP_DISP All requests from this display
share the same license. (Useful
for display or GUI based
products, like a window
system.)
LM_DUP_VENDOR All requests with the same
vendor-defined data, use the
same license. (Useful for
sharing licenses among
otherwise unrelated processes.)
If LM_DUP_VENDOR is used,
LM_A_CHECKOUT_DATA
must be set.
LM_DUP_USER | All requests from this user
LM_DUP_HOST name on this host name use the
same license.
96 FLEXible API
FLEXible API Function Descriptions
RETURN
ERROR RETURNS
98 FLEXible API
FLEXible API Function Descriptions
Note: If you want a checkout to depend on information in the license file, call
lc_set_attr() LM_A_CHECKOUTFILTER, LM_A_CHECKOUTFILTER_EX, or
LM_A_CHECKOUTFILTERLAST_EX before the call to lc_checkout().
If you want to display information to the user from a license file line (but not
have a checkout depend on the returned information), call lc_auth_data() after
a successful checkout. Because lc_auth_data() returns only features which
have been successfully checked out, the returned data is authenticated. If you
call lc_checkout() with the LM_CO_LOCALTEST flag, use the alternate function
lc_test_conf() to retrieve the desired license file line instead of lc_auth_data().
SEE ALSO
• machind/lmflex.c
• Section 6.4.1, “lc_auth_data()”
• Section 8.2.2, “LM_A_CHECKOUT_DATA”
• Section 6.4.20, “lc_set_attr()”
lc_cryptstr() calculates the signature and returns the complete, valid license
certificate in return_str:
FEATURE f1 demo 1.5 01-jan-2005 uncounted HOSTID=08002b32b161 \
SIGN=2C817A5100D8
If flag has LM_CRYPT_ONLY set, then the function returns the signature
for the first FEATURE, INCREMENT, PACKAGE, or UPGRADE line in the
certificate. If LM_CRYPT_ONLY is cleared, then the entire certificate is
signed and returned as a string. If flag has LM_CRYPT_FORCE set, then the
signature is recomputed for every line, even if the signature is defined.
Comment lines are retained in the return_str output.
If you want to specify a start date, then add the following keyword to the
license line template using the following syntax:
START=dd-mmm-yyyy
Example:
START=1-jan-2005
LM_HANDLE *lm_job;
LM_CODE(code, ENCRYPTION_SEED1, ENCRYPTION_SEED2, VENDOR_KEY1,
VENDOR_KEY2, VENDOR_KEY3, VENDOR_KEY4, VENDOR_KEY5);
[...]
[C code:]
char *errors;
char *return_str;
int flag = LM_CRYPT_FORCE;
char *filename = "myfile.lic";
char str[MAX_CONFIG_LINE * 100]; /* if maximum license is 100
lines */
[...]
[set up str variable with valid license syntax]
[...]
LM_CODE_GEN_INIT(&code);
if (lc_init(0, VENDOR_NAME, &code, &lm_job))
{
/* present error */
}
/* Initialization complete */
[...]
if (lc_cryptstr(lm_job, str, &return_str, &code, flag,
filename, &errors))
{
/* present error, and if non-null, print it out */
}
if (return_str)
{
/* return_str is the correct license-file string */
}
RETURN
ERROR RETURNS
Because different errors can occur on every line of the input str, lc_cryptstr()
must be able to report all these errors independently, and does so via the
errors parameter. The errors parameter is used for both errors and
Error reported:
stdin:line 1:Bad version number - must be floating point number,
with no letters
With this error, no signature is generated and return_str will be the same as
the input str.
SEE ALSO
• Section 8.1.3, “lc_check_key()”
• Section 8.1.5, “lc_convert()”
• Section 6.4.11, “lc_get_attr()”
• Section 6.4.15, “lc_init()”
• Section 7.3.11, “LM_A_LICENSE_FMT_VER”
• machind/lmcrypt.c
• machind/makekey.c
6.4.5 lc_err_info()
SYNTAX
err_info = lc_err_info(job)
DESCRIPTION
Returns a pointer to a LM_ERR_INFO struct, which contains all necessary
information to present an error message to the user. This is the supported
method for internationalization and localization of FLEXlm error messages.
The format of LM_ERR_INFO is:
RETURN
SEE ALSO
• Section 6.4.19, “lc_perror()”
6.4.6 lc_errstring()
SYNTAX
string = lc_errstring(job)
DESCRIPTION
Returns the FLEXlm error string for the most recent FLEXlm error, along with
the major and minor error number. If a UNIX error is involved, the UNIX error
description will also be included in the message, along with the UNIX errno.
For internationalization of error messages, use lc_err_info().
This memory is managed by the FLEXlm library. Do not attempt to free it. This
string is freed and reset when another FLEXlm error occurs, so it’s only valid
between calls to FLEXlm functions. Check that the call to the previous
FLEXlm function has returned an error before calling lc_errstring().
PARAMETERS
RETURN
EXAMPLES
No such feature exists (-5,116)
Cannot find license file, (-1,73:2), No such file or directory
SEE ALSO
• Section 6.4.19, “lc_perror()”
• Section 6.4.5, “lc_err_info()”
6.4.7 lc_expire_days()
days = lc_expire_days(job, conf)
DESCRIPTION
Returns the number of days until a license expires.
PARAMETERS
RETURN
ERROR RETURNS
LM_BADPARAM conf is 0.
SEE ALSO
• Section 6.4.3, “lc_checkout()”
• Section 8.1.10, “lc_next_conf()”
6.4.8 lc_feat_list()
SYNTAX
list = lc_feat_list(job, flags, dupaction)
DESCRIPTION
Gets the list of all features in the license file.
PARAMETERS
RETURN
ERROR RETURNS
6.4.9 lc_first_job()
SYNTAX
job = lc_first_job(job)
DESCRIPTION
lc_first_job() is used to find the first job in a list of jobs.
CODING EXAMPLE
LM_HANDLE *job
job = lc_first_job(job);
while (job)
{
/*processing*/
job = lc_next_job(job);
}
PARAMETER
ERROR RETURNS
None.
SEE ALSO
• Section 6.4.10, “lc_free_job()”
• Section 6.4.17, “lc_new_job()”
• Section 6.4.18, “lc_next_job()”
• Section 11.4, “Multiple Jobs”
6.4.10 lc_free_job()
SYNTAX
(void) lc_free_job(job)
DESCRIPTION
lc_free_job() frees the memory associated with a job, which has been allocated
by lc_new_job(). Calls to this function are needed only by an application that
uses a large number of jobs over its lifetime.
lc_free_job() removes everything associated with job; this includes any
timers, memory and licenses.
For dynamically linked Windows applications or FLEXenabled DLLs, it is
required to call lc_cleanup() after the last call to lc_free_job().
PARAMETERS
RETURN
None.
ERROR RETURNS
SEE ALSO
• Section 6.4.15, “lc_init()”
• Section 6.4.17, “lc_new_job()”
• Section 6.4.20, “lc_set_attr()”
• Section 8.1.4, “lc_cleanup() (Windows only)”
• Section 11.4, “Multiple Jobs”
6.4.11 lc_get_attr()
SYNTAX
#include "lm_attr.h"
status = lc_get_attr(job, attr, value)
DESCRIPTION
Retrieves a FLEXlm attribute. attr describes which attribute to retrieve, and
the value is a pointer to the value for the attribute. See lm_attr.h for attr
constants and value types. Attribute descriptions can also be found in Section
7.3, “FLEXible API Attributes set by lc_set_attr(),” and Section 8.2,
“Advanced FLEXible API Attributes.”
Types of char * are handled a little differently than other types. Types of int
or short are declared, and a pointer to the declared variable is passed as an
argument. Types of char * are declared as char *, and the variable itself is
passed.
PARAMETERS
RETURN
ERROR RETURNS
LM_NOADMINAPI LM_A_VD_GENERIC_INFO or
LM_A_VD_FEATURE_INFO only—
request was made to other company’s
vendor daemon.
LM_NOSERVSUPP LM_A_VD_GENERIC_INFO or
LM_A_VD_FEATURE_INFO only—
pre-v4.0 server does not support these
requests.
SEE ALSO
• Section 6.4.20, “lc_set_attr()”
• Section 7.3, “FLEXible API Attributes set by lc_set_attr()”
6.4.12 lc_heartbeat()
SYNTAX
status = lc_heartbeat(job, num_reconnects, num_minutes)
DESCRIPTION
lc_heartbeat() sends heartbeat messages to and receives acknowledgments
from the license server. By default, these activities are handled automatically
by FLEXlm via a separate, dedicated application thread. This function
provides manual control of heartbeat messages; thereby, overriding the
automatic mechanism.
The purpose of heartbeat messages is to:
• Keep license server informed that the application is still using its license
— otherwise the license server may timeout and check in the license.
• Keep the application informed that the license server is continually
running — unchecked license server stops and starts may indicate
unauthorized license usage.
lc_heartbeat() performs the following activities:
• It attempts to read the acknowledgement from the previous heartbeat.
• It sends out a heartbeat message or, if there is no acknowledgement from
the previous one, it makes one attempt to reconnect to the license server.
• If reconnection is successful, re-checks out the original complement of
licenses from the license server.
Heartbeat messages ensure that licenses are re-checked out from a restarted
server. Heartbeats are not needed for the server to retain a client’s license—the
server retains the license until the client exits. If lc_heartbeat() is called, the
client will automatically reconnect and re-checkout from a license server that
has restarted. It also informs the application of a number of states that may
indicate attempted tampering with the license server.
• The return value, if non-zero, indicates that the license server is down, and
how many reconnect attempts have been made. This information can be
used, for example, to inform the end user the license server is down and
possibly to deny use after a specified number of failures.
• The arguments num_reconnects and num_minutes, if used, can
indicate the rate a server has been stopped and started, possibly signifying
attempted theft.
PARAMETERS
RETURN
HOSTID TYPES
There are two groups of hostid types: those valid for a specific platform and
those valid on all platforms. Table 6-11 lists the valid hostid types for a specific
platform.
HOSTID_FLEXID9 FLEXID=9
All • Mfg: Aladdin
Knowledge Systems
• Device: HASP® 4 M1
USB memory key
HOSTID_FLEXID8 FLEXID=8
• Mfg: Dallas
Semiconductor/Maxim
Integrated Products, Inc.
• Device: 1-Wire® parallel
port adapter
HOSTID_FLEXID9 FLEXID=9
• Mfg: Aladdin
Knowledge Systems
• Device: HASP® 4 M1
USB memory key
(except NT)
The following table lists the hostid types common to all platforms.
id_type Description
HOSTID_COMPOSITE Composite hostid, if defined. See Chapter
14, “Composite Hostids,” and Section 8.1.9,
“lc_init_simple_composite().”
HOSTID_DEFAULT Default hostid type on the system.
HOSTID_DISPLAY Display name.
HOSTID_HOSTNAME Node name.
HOSTID_INTERNET Internet IP address.
HOSTID_USER User name.
id_type Description
HOSTID_VENDOR Vendor-defined hostid, if defined. See
Chapter 15, “Vendor-Defined Hostid Types.”
RETURN
ERROR RETURNS
SEE ALSO
• machind/lmclient.h for valid hostid type definitions
• FLEXlm End Users Guide, Appendix A, “Hostids for FLEXlm-Supported
Machines,” for a list of the default hostid for each supported platform
6.4.14 lc_idle()
SYNTAX
(void) lc_idle(job, flag)
DESCRIPTION
Informs FLEXlm when the process is idle. lc_idle() enables the end user feature
inactivity TIMEOUT to allow idle licenses to be reclaimed. Use of lc_idle() is
recommended for end users to take advantage of the TIMEOUT option.
lc_idle() also affects vendor daemon timeout due to LM_A_TCP_TIMEOUT.
lc_idle() can be used to bracket a portion of the application code that prompts
for user input, so that when the user is not using the application, the vendor
daemon can detect the fact that the application is idle. lc_idle() only sets a flag
internally in the application; it is therefore safe to call as often as necessary.
A typical use would be:
lc_idle(job, 1); /* Process is idle now */
... wait for input from user...
lc_idle(job, 0); /* Process is no longer idle */
PARAMETERS
RETURN
None.
SEE ALSO
• Section 6.4.12, “lc_heartbeat()”
• Section 7.3.17, “LM_A_TCP_TIMEOUT”
• Section 13.2.9, “ls_minimum_user_timeout”
6.4.15 lc_init()
SYNTAX
#include "lm_code.h"
status = lc_init(job, VENDOR_NAME, &code, &lm_job)
DESCRIPTION
lc_init() initializes FLEXlm and creates a license job. Subsequent calls to
lc_init() create new license jobs; each job is independent. lc_init() is only to be
used with license generators and not in licensed applications shipped to end
users. Licensed applications use lc_new_job(), instead, for initialization and
job creation because it offers enhanced security.
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Section 6.4.4, “lc_cryptstr()”
• Section 6.4.17, “lc_new_job()”
6.4.16 lc_log()
SYNTAX
(void) lc_log(job, msg)
DESCRIPTION
Logs a message in the debug log file, if the license is served by lmgrd.
PARAMETERS
RETURN
None.
ERROR RETURNS
6.4.17 lc_new_job()
SYNTAX
VENDORCODE code;
LM_HANDLE *job = (LM_HANDLE *)NULL;
status = lc_new_job(prevjob, lc_new_job_arg2, &code, &job);
DESCRIPTION
lc_new_job() initializes FLEXlm and creates a license job. Subsequent calls to
lc_new_job() create new license jobs. Each license job is independent.
lc_new_job() is used with licensed applications. For license generators (like
lmcrypt and makekey) use lc_init() instead.
All applications must link lm_new.o (lm_new.obj on Windows) into the
application executable. Failing to link lm_new.o into the executable will
result in unresolved references to l_n36_buf.
Note: The application must call lc_new_job() before calling any other FLEXlm
function, including lc_set_attr() and lc_get_attr().
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Section 6.4.15, “lc_init()”
• Section 6.4.10, “lc_free_job()”
• Section 11.4, “Multiple Jobs”
6.4.18 lc_next_job()
SYNTAX
LM_HANDLE *job
job = lc_first_job(job);
while (job)
{
/*processing*/
job = lc_next_job(job);
}
DESCRIPTION
lc_next_job() is used to walk the list of jobs. This only works properly if all
calls to lc_new_job() have a pointer to the current job as the first parameter.
PARAMETERS
RETURN
ERROR RETURNS
None.
SEE ALSO
• Section 6.4.9, “lc_first_job()”
• Section 6.4.10, “lc_free_job()”
• Section 6.4.17, “lc_new_job()”
• Section 11.4, “Multiple Jobs”
6.4.19 lc_perror()
SYNTAX
(void) lc_perror(job, string)
DESCRIPTION
Prints a FLEXlm error message, in the same format as the UNIX function
perror(), e.g.:
"string": FLEXlm error-string
RETURN
None.
SEE ALSO
• Section 6.4.5, “lc_err_info()”
RETURN
ERROR RETURNS
SEE ALSO
• Section 7.3, “FLEXible API Attributes set by lc_set_attr()”
6.4.21 lc_status()
SYNTAX
status = lc_status(job, feature)
DESCRIPTION
Returns the status of the requested feature.
A call to this function is made when QUEUEing for a license. Normally
QUEUEing is done in the following manner:
status = lc_checkout(....LM_CO_NOWAIT,...);
if (status == LM_MAXUSERS || status == LM_USERSQUEUED)
{
printf("Waiting for license...");
status = lc_checkout(....LM_CO_WAIT,...);
}
However, in the above example, the application must pend on the call to
lc_checkout(). If the application needs to continue doing processing, use
LM_CO_QUEUE in the call to lc_checkout(). Call lc_status() immediately
after the call to lc_checkout() and any other lc_xxx() function until the license
is granted or denied. This might be coded in the following manner:
status = lc_checkout(...,LM_CO_QUEUE,...)
switch (status)
{
case 0:
break; /* got the license */
case LM_MAXUSERS:
case LM_USERSQUEUED:
case LM_FEATQUEUE:
printf("Waiting for license...");
while (lc_status(job, feature))
{
/* processing */
}
break; /* got the license */
default:
lc_perror(job, "Checkout for license failed");
}
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Section 6.4.3, “lc_checkout()”
6.4.22 lc_userlist()
SYNTAX
LM_USERS *users;
users = lc_userlist(job, feature)
DESCRIPTION
Provides a list of who is using the feature, including information about the
users of the license. This output is used by lmstat. See the FLEXlm End Users
Guide for the behavior of lmstat.
PARAMETERS
Note: The call to lc_userlist() is potentially expensive (it may cause a lot of network
traffic), depending on the number of users of feature. Therefore this function
must be used with caution. In particular, it is a good idea to call lc_userlist()
when a checkout fails with LM_MAXUSERS/LM_USERSQUEUED error, to
inform who is using the feature. However, do not call lc_userlist() before every
call to lc_checkout(), because this will be guaranteed to cause network load
problems when a large number of licenses are checked out.
RETURN
If successful, lc_userlist() returns a pointer to a linked list of structures, one for
each user of the license. This data should not be modified by the caller. It will
be freed on the next call to lc_userlist().
See lmclient.h for a description of the LM_USERS struct.
The list of users returned by lc_userlist() includes a special record, indicated by
an empty user name (name[0]==0), which contains the total number of
licenses supported by the daemon for the specified feature (in the nlic field),
and the daemon’s idea of the current time (in the time field).
If there is an error, lc_userlist() returns NULL and sets the job error status.
lc_userlist() returns only information about users the server knows about,
therefore it will not return any information about users of node-locked
uncounted or DEMO licenses, unless the server’s license file includes the
node-locked licenses and the client is not reading the license file (via @host,
port@host or USE_SERVER). Queued users and licenses shared due to
duplicate grouping are also not returned by lc_userlist().
Reserved licenses are indicated by the lm_isres() macro (defined in
lmclient.h). In this case, the name contains the entity that the reservation is
for.
ERROR RETURNS
SEE ALSO
• machind/lmclient.h for LM_USERS structure definition.
6.4.23 lc_vsend()
SYNTAX
rcv_str = lc_vsend(job, send_str)
DESCRIPTION
Sends a message to the vendor daemon and returns a result string. If the client
is not already connected to a server, this function will connect to the first server
in the first license file in its list. The string can be up to 140 bytes.
You must set up a processing routine in your vendor daemon to receive the
message from lc_vsend() and send the reply. This routine is specified in
lsvendor.c in the variable ls_vendor_msg.
PARAMETERS
RETURN
SEE ALSO
• Section 13.2.15, “ls_vendor_msg”
7.1.2 LM_QUEUE
This policy is the same as LM_RESTRICTIVE, except that the checkout call
will wait for a license if the licenses are all currently in use. To the end user,
the application will appear to “hang” until the license is available.
7.1.3 LM_FAILSAFE
With this policy, the application will attempt a checkout, but no checkout
failures of any kind will be reported to the calling application. This policy
provides “optional” licensing to the user. If the user wants to use licensing, he
can, in which case the checkout will succeed. If the user doesn’t want to use
licensing, or if licensing is for some reason broken, applications will always
continue to run.
In the case where all licenses are currently in use, the application will still run.
The end user could use SAMreport to report on historical usage, which will
show when licensed use is exceeded. Application users will never be denied
usage. Errors that normally make a checkout fail are available as warnings.
7.1.4 LM_LENIENT
In this policy, if all licenses are in use, the checkout will return a failure status
showing that all licenses are in use. For any other error, no error is returned.
This is another form of “optional” end user licensing, where the user is not
penalized if licensing is not set up or if an operational error occurs. Errors that
would normally make a checkout fail are available as warnings.
The essential FLEXible API attribute which should be set by every FLEXible
API licensed application is LM_A_LICENSE_DEFAULT. This attribute
defines the default license file location.
The following attributes are often useful:
• Vendor-defined Hostid:
LM_A_VENDOR_ID_DECLARE
• Customized checkout:
LM_A_BORROW_EXPIRE
• Information useful for error, or informational, reporting:
LM_A_BORROW_STAT
LM_A_LF_LIST
LM_A_VD_GENERIC_INFO, LM_A_VD_FEATURE_INFO
The attributes are described in the sections the follow; with one attribute per
section. The first line of each section is the data type of the attribute. All
attribute definitions are in lm_attr.h. The attributes are changed with
lc_set_attr() and are queried with lc_get_attr().
When using these attributes with lc_set_attr(), the argument must be of the
correct type (each attribute below lists its associated type) and must then be
cast to LM_A_VAL_TYPE. When using them with lc_get_attr(), the pointer
argument should point to a value of the correct type (noting that short and
int are different in this case), and must be cast to a short *.
SEE ALSO
• Section 8.2, “Advanced FLEXible API Attributes”
• Section D.2, “Obsolete FLEXible API Attributes”
7.3.1 LM_A_APP_DISABLE_CACHE_READ
Type: (int)
Default: 0
By default, after a successful checkout, the license file location used for the
feature is cached in the VENDOR_LICENSE_FILE variable in the registry
(Windows) or $HOME/.flexlmrc (UNIX). All subsequent checkouts for
features from this vendor will read the cache, first, to determine the license file
location.
To disable reading the cache, set this attribute to 1. Set this attribute
immediately after the call to lc_new_job() and before any other code in the
application.
SEE ALSO
• “Registry and $HOME/.flexlmrc”
• Section 7.3.6, “LM_A_CKOUT_INSTALL_LIC”
7.3.2 LM_A_BORROW_EXPIRE
Type: (char *)
Default: None
Date and optional time when a borrowed license expires.
If you want your end users to request license borrowing from within your
application, issue a license with the BORROW keyword on a feature line and
write an interface in which the user specifies the end date (and optionally time)
when the borrowed license will be returned. Before the call to lc_checkout(),
call:
lc_set_attr(job, LM_A_BORROW_EXPIRE, (LM_A_VAL_TYPE)datestring);
where datestring is the date (and optionally time) when the borrowed
license expires (provided by the user through the interface). The date in
datestring is in dd-mmm-yyyy[:hh:mm] format and the time is according
to a 24-hour clock. For example:
13-dec-2005:15:00
All subsequent license checkouts in this job will attempt to borrow licenses.
SEE ALSO
• Section 3.5.6, “BORROW”
• lmborrow command in FLEXlm Programmers Guide or FLEXlm End
Users Guide
7.3.3 LM_A_BORROW_STAT
Type: (LM_BORROW_STAT *)
Default: None
Use this attribute to retrieve information about features borrowed on the client
machine, that is, the machine where lmborrow was run. This is useful for
finding out which features have been borrowed while disconnected from the
network. After the call to lc_checkout() that activates borrowing, call:
LM_BORROW_STAT *s;
lc_get_attr(job, LM_A_BORROW_STAT, &s);
for (; s; s = s->next)
{
/* s contains local borrow status */
}
For additional security, each time that your application is installed, and the user
activates the FLEXlock operation, a random id number is generated. This
number can be used to identify work done with your application in this mode.
If this number is saved in the work and compared when accessing it, you may
be able to determine if your application has been re-installed. FLEXlock is
available only on Windows.
You can obtain this number by calling:
long code_id;
lc_get_attr(job, LM_A_FLEXLOCK_INSTALL_ID, (short *)&code_id);
A subkey for each feature is located inside the FLEXlock subkey and is a
combination of the vendor name and the feature name. If this subkey is deleted,
the program will act as if you had never activated the FLEXlock functionality.
(Familiarity with the registry editor is necessary for testing FLEXlock-enabled
features.)
See the FLEXlm Programmers Guide and Section 11.5, “FLEXlock,” for
additional information on FLEXlock.
7.3.9 LM_A_LF_LIST
Type: Pointer to (char **)
List of all license files searched for features. Useful for failure messages for
debugging. For example:
#include "lm_attr.h"
/*...*/
char **cp;
lc_get_attr(job, LM_A_LF_LIST, (short *)&cp);
if (cp)
{
puts("files searched are: ");
while (*cp)
printf("\t%s\n",(short *)*cp++);
}
7.3.10 LM_A_LICENSE_DEFAULT
Type: (char *)
Note: It is strongly recommended that this attribute be set in all licensed applications.
SEE ALSO
• Section 11.2, “Lingering Licenses”
7.3.13 LM_A_LONG_ERRMSG
Type: (int)
Default: True
The default is long error messages. Error messages can be presented in a long,
more descriptive format. The new format contains embedded newline
characters, which some applications may not be able to handle, or may need
special handling.
Applications will often find it useful to present the short error message first,
and then long error message upon user request. This can be done thus:
lc_set_attr(job, LM_A_LONG_ERRMSG, (LM_A_VAL_TYPE)0);
....
/*error occurs*/
lc_perror(job);
/* user requests long error message */
lc_set_attr(job, LM_A_LONG_ERRMSG, (LM_A_VAL_TYPE)1);
lc_perror(job);
Note that this only works if another FLEXlm error doesn’t occur in between,
which would change the error condition and message. Not all error conditions
have long explanations or context-sensitive information.
Example:
Invalid host
The hostid of this system does not match the hostid
specified in the license file
Hostid: 12345678
License path: ./file1.lic:./file2.lic:./file3.lic
FLEXlm error: -9,9
CALLBACK PARAMETERS
SEE ALSO
• Section 6.4.12, “lc_heartbeat()”
• Section 7.3.16, “LM_A_RETRY_COUNT,
LM_A_RETRY_INTERVAL”
• Section 8.2.17, “LM_A_VENDOR_CALLBACK_DATA”
7.3.19 LM_A_USER_RECONNECT,
LM_A_USER_RECONNECT_EX
Type: Pointer to a function returning int. Return value unused.
Default: No user reconnection handler
DESCRIPTION
The function pointer LM_A_USER_RECONNECT (or the extended version,
LM_A_USER_RECONNECT_EX) is set to point to a reconnection callback
routine. This routine is called each time just before a reconnection is attempted,
either by the automatic heartbeat mechanism, or as a result of the application
program calling lc_heartbeat().
The LM_A_USER_RECONNECT routine is called as follows:
(*reconnect)(feature, pass, total_attempts,
interval)
or, with LM_A_USER_RECONNECT_EX:
(*reconnectEx)(job, feature, pass, total_attempts,
interval, vendor_data)
CALLBACK PARAMETERS
7.3.20 LM_A_USER_RECONNECT_DONE,
LM_A_USER_RECONNECT_DONE_EX
Type: Pointer to a function returning int. Return value unused.
Default: None.
DESCRIPTION
The function pointer LM_A_USER_RECONNECT_DONE (or the extended
version, LM_A_USER_RECONNECT_DONE_EX) is set to point to a
callback routine. This routine is called when reconnection is successfully
completed.
The LM_A_USER_RECONNECT_DONE handler is called as follows:
(*reconnect_done)(feature, tries, total_attempts,
interval)
or, for LM_A_USER_RECONNECT_DONE_EX:
(*reconnect_doneEx)(job, feature, tries, total_attempts,
interval, vendor_data)
CALLBACK PARAMETERS
SEE ALSO
• Section 7.3.19, “LM_A_USER_RECONNECT,
LM_A_USER_RECONNECT_EX”
• Section 8.2.17, “LM_A_VENDOR_CALLBACK_DATA”
7.3.21 LM_A_VD_GENERIC_INFO, LM_A_VD_FEATURE_INFO
Type: Pointer to LM_VD_GENERIC_INFO or pointer to
LM_VD_FEATURE_INFO
Both attributes get information from your vendor daemon.
LM_A_VD_GENERIC_INFO gets information which is not specific to a
feature, and which is mostly found in lsvendor.c.
LM_A_VD_FEATURE_INFO gets information about a particular feature, and
provides an accurate count of licenses used, users queued, etc., and works
correctly when a license file has more than one FEATURE or INCREMENT
line for the same feature name. This will result in a LM_NOSERVSUPP error
if the particular CONFIG struct has been merged with another CONFIG in the
vendor daemon.
These attributes will only work on your vendor daemon. If a request is made
for a feature only served by a different vendor daemon, then the
LM_NOADMINAPI error results.
A pointer to a struct is given as an argument to lc_get_attr(); upon successful
return, this struct is filled with the appropriate information. The following
example illustrates the use of both attributes. Though lc_get_config() and
lc_next_conf() are described in Section 8.1, “Advanced FLEXible API
Functions,” one of their legitimate uses is with LM_A_VD_GENERIC_INFO
and LM_A_VD_FEATURE_INFO.
Note: If you are reporting on a feature that has been checked out successfully, use
lc_auth_data(), instead of lc_next_conf().
#include "lmclient.h"
#include "lm_code.h"
#include "lm_attr.h"
/* ... */
/*
* Print out GENERIC and FEATURE information for every
* license file line for a given feature name
*/
void
vendor_daemon_info(LM_HANDLE *job, char *feature)
{
CONFIG *conf, *c;
LM_VD_GENERIC_INFO gi;
LM_VD_FEATURE_INFO fi;
int first = 1;
c = (CONFIG *)0;
{
/*
* get generic daemon info
*/
gi.feat = conf;
if (lc_get_attr(job, LM_A_VD_GENERIC_INFO,
(short *)&gi))
{
lc_perror(job, "LM_A_VD_GENERIC_INFO");
}
else
{
printf(" conn-timeout %d\n",
gi.conn_timeout);
printf(" normal_hostid %d\n",
gi.normal_hostid);
printf(" minimum_user_timeout %d\n",
gi.minimum_user_timeout);
printf(" min_lmremove %d\n",
gi.min_lmremove);
printf(" use_featset %d\n",
gi.use_featset);
printf(" dup_sel 0x%x\n", gi.dup_sel);
printf(" use_all_feature_lines %d\n",
gi.use_all_feature_lines);
printf(" do_checkroot %d\n",
gi.do_checkroot);
else
printf("suite overdraft is %d\n", fi.overdraft);
}
SEE ALSO
• Section 8.1.7, “lc_get_config()”
• Section 8.1.10, “lc_next_conf()”
• Section 6.4.1, “lc_auth_data()”
7.3.22 LM_A_VENDOR_ID_DECLARE
Type: Pointer to LM_VENDOR_HOSTID struct.
Default: None
This is for supporting vendor-defined hostid. The struct defines and declares
the hostid to FLEXlm.
SEE ALSO
• Chapter 15, “Vendor-Defined Hostid Types.”
• machind/lmclient.h for LM_VENDOR_HOSTID definition
• examples/vendor_hostid directory
7.3.23 LM_A_VERSION, LM_A_REVISION
Type: (short)
Default: Version and revision of the libraries you have linked with
FLEXlm version. Cannot be set. Only for use with lc_get_attr().
7.3.24 LM_A_WINDOWS_MODULE_HANDLE (Windows only)
Type: (long)
Default: 0
This is only needed for a specific situation on Windows: You are building a
DLL, and the FLEXlm library (lmgr.lib) is linked into your DLL. Or put
another way, the FLEXlm functions are not in a static binary, but only in a
DLL. In this case, the DLL makes calls to the following functions before
calling lc_checkout():
lc_set_attr(job, LM_A_WINDOWS_MODULE_HANDLE,
(LM_A_VAL_TYPE)GetModuleHandle(dllname));
where dllname is the name of the DLL. If these calls are not made, Windows
dialogs and error messages do not work properly.
The FLEXible API functions, attributes, and vendor variables in this chapter
provide advanced FLEXlm functionality. Basic functionality is covered by the
material in Chapter 6, “FLEXible API,” Chapter 7, “Controlling Licensing
Behavior,” and Chapter 13, “Vendor Daemon.”
Function Description
l_new_hostid() Allocates a hostid structure.
lc_borrow_return() Returns a borrowed license early.
lc_check_key() Validates a license signature.
lc_cleanup() (Windows Cleans up FLEXlm resources after they are
only) no longer needed.
lc_convert() Converts a license file from one format to
the other. Formats include readable and
decimal.
lc_free_hostid() Frees the memory associated with a hostid
structure.
Function Description
lc_get_config() Returns license file data for a given feature.
lc_get_errno() Returns the most recent FLEXlm error.
lc_init_simple_composite() Initializes a composite hostid.
lc_next_conf() Returns the next line in the license file
matching the given feature.
lc_remove() Removes a given feature for the specified
user.
lc_shutdown() Shuts down the FLEXlm license servers.
lc_test_conf() Returns license file data for the most
recently tested feature.
8.1.1 l_new_hostid()
SYNTAX
hostid = l_new_hostid()
DESCRIPTION
Returns a malloc’d and zeroed hostid. Use lc_free_hostid() to free this
memory. This may be needed when doing vendor-defined hostids.
PARAMETERS
None.
RETURN
ERROR RETURNS
SEE ALSO
• Section 7.3.22, “LM_A_VENDOR_ID_DECLARE”
• Chapter 15, “Vendor-Defined Hostid Types”
8.1.2 lc_borrow_return()
SYNTAX
status = lc_borrow_return(job, feature, display)
DESCRIPTION
lc_borrow_return() is used to return a borrowed license to the pool of available
licenses before the borrow period expires. The application which calls this
routine must be running on the same machine from which the license was
originally borrowed.
In order for this routine to have an effect, the license server must be configured
to allow early return of borrowed licenses.
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Section 8.3.4, “ls_borrow_return_early”
8.1.3 lc_check_key()
SYNTAX
status = lc_check_key(job, conf, code)
DESCRIPTION
lc_check_key() determines if the signature in the CONFIG structure, pointed to
by conf, is valid. This function is optional and only for use during license
installation; it is not used in an application that also calls lc_checkout(). If
authenticated license information is needed without checking out a license, use
lc_checkout() with the LM_CO_LOCALTEST flag.
To verify a license file upon installation, use code similar to the following
example:
VENDORCODE code;
lc_new_job(..., &code, ...);
feats = lc_feat_list(...);
while (*feats)
{
pos = 0;
while (conf = lc_next_conf(job, *feats, &pos))
{
if (lc_check_key(job, conf, &code))
/*error*/
}
feats++;
}
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• examples/advanced/exinstal.c
• Section 8.1.10, “lc_next_conf()”
• Section 8.1.5, “lc_convert()”
• Section 6.4.8, “lc_feat_list()”
• Section 6.4.3, “lc_checkout()”
8.1.5 lc_convert()
SYNTAX
status = lc_convert(job, str, return_str, errors, flag)
DESCRIPTION
This is an API for companies that want to provide their own front-end for
installing license files. lc_convert() can be used in combination with
lc_check_key() to provide a user-friendly front-end.
lc_convert() also changes this_host in the SERVER line to the real host
name in either decimal or readable licenses. It does this only if lc_convert() is
run on the same hostid as appears on the SERVER line and does not do this for
hostids of DEMO or ANY.
If readable output is requested, the output will be compatible with the
LM_A_LICENSE_FMT_VER setting, which defaults to the current FLEXlm
version.
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• examples/advanced/exinstal.c for an example program
• Section 8.1.10, “lc_next_conf()”
• Section 8.1.5, “lc_convert()”
• Section 6.4.8, “lc_feat_list()”
RETURN
None.
ERROR RETURNS
SEE ALSO
• Section 8.1.1, “l_new_hostid()”
8.1.7 lc_get_config()
SYNTAX
conf = lc_get_config(job, feature)
DESCRIPTION
Gets the license file data for a given feature. FLEXlm allows multiple valid
FEATURE and INCREMENT lines (of the same feature name) in a license
file. lc_get_config() will return the first CONFIG struct, and lc_next_conf()
retrieves the next (lc_next_conf() can also find the first). lc_get_config() does
not authenticate feature lines. That is, a user can type in a FEATURE line with
an invalid signature, and lc_get_config() will still return it. lc_get_config() and
lc_next_conf() are usually needed only with LM_A_VD_GENERIC_INFO or
LM_A VD_FEATURE_INFO.
To get authenticated information from a FEATURE line, you must first check
out the feature, and then use lc_auth_data().
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Section 6.4.1, “lc_auth_data()”
• Section 8.2.3, “LM_A_CHECKOUTFILTER,
LM_A_CHECKOUTFILTER_EX”
• Section 6.4.3, “lc_checkout()”
RETURN
SEE ALSO
• Section 6.4.5, “lc_err_info()”
• Section 6.4.19, “lc_perror()”
• machind/lmclient.h
8.1.9 lc_init_simple_composite()
SYNTAX
status = lc_init_simple_composite(job, hostid_list, num_ids)
DESCRIPTION
This function initializes a vendor-defined composite hostid. Invoke this
function right after the call to lc_new_job(). The composite hostid is valid for
the life of the license job and is accessed by specifying the
HOSTID_COMPOSITE hostid type to lc_hostid().
A composite hostid is a 12-byte hashed hexidecimal value formed by
combining the values of one or more simple hostids types, as specified by
hostid_list. If an invalid hostid type for the platform appears in
hostid_list, lc_init_simple_composite() returns the value of the default
hostid type for that platform.
EXAMPLE
The following example demonstrates the definition and use of a composite
hostid made up from HOSTID_ETHER and HOSTID_DISPLAY.
#include lmclient.h
LM_HANDLE *job
char buf[MAX_CONFIG_LINE];
/* Set up the list of hostid types which comprise the
composite hostid, hostids must appear in the same order
as those in hostid lists specified in other components.
*/
int hostid_list[]={HOSTID_ETHER, HOSTID_DISPLAY};
int num_ids = 2;
/*...*/
lc_new_job(..., &job);
/* Register the composite hostid */
ret = lc_init_simple_composite(job, hostid_list, num_ids);
if (ret != 0)
{
/* error processing */
}
/* ... */
/* Now, access the composite hostid value */
if (lc_hostid(job, HOSTID_COMPOSITE, buf))
{
/* error processing */
}
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Section 6.4.13, “lc_hostid()”
• machind/lmclient.h
8.1.10 lc_next_conf()
SYNTAX
CONFIG *pos = 0;
conf = lc_next_conf(job, feature, &pos);
DESCRIPTION
Returns the next line in the license file, as a pointer to a CONFIG structure,
matching feature. The search is started from pos, where pos = 0 indicates
the first line. lc_next_conf() automatically updates pos, so it is ready to
retrieve the next feature line on a subsequent call.
lc_next_conf() does not authenticate FEATURE lines. That is, a user can type
in a FEATURE line with an invalid signature, and lc_next_conf() will still
return it. lc_get_config() and lc_next_conf() are usually needed only with
LM_A_VD_GENERIC_INFO or LM_A VD_FEATURE_INFO.
To get authenticated information from a FEATURE line, you must first check
out the feature, and then use lc_auth_data().
PARAMETERS
RETURN
ERROR RETURNS
See error returns for lc_get_config().
EXAMPLE
CONFIG *pos = 0, *conf;
while (conf = lc_next_conf(job, "myfeature", &pos))
{
/* ... */
}
SEE ALSO
• Section 6.4.1, “lc_auth_data()”
• Section 8.2.3, “LM_A_CHECKOUTFILTER,
LM_A_CHECKOUTFILTER_EX”
• Section 6.4.3, “lc_checkout()”
• Section 8.1.7, “lc_get_config()”
• Section 7.3.21, “LM_A_VD_GENERIC_INFO,
LM_A_VD_FEATURE_INFO”
8.1.11 lc_remove()
SYNTAX
status = lc_remove(job, feature, user, host, display)
DESCRIPTION
Removes the specified user’s license for feature. This is used by the
lmremove command, and has the same restrictions regarding the “lmadmin”
group. lc_remove() normally is only used when the client’s system has had a
hard crash, and the server does not detect the client node failure. If lc_remove()
is called on a healthy client, the license will be checked out again by the client
with its next heartbeat.
Note: If lmgrd is started with the -x lmremove flag, then lc_remove() has no effect.
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Chapter 10, “The License Manager Daemon”
• Section 13.2.8, “ls_min_lmremove”
• Section 6.4.12, “lc_heartbeat()”
8.1.12 lc_shutdown()
SYNTAX
status = lc_shutdown(job, prompt, print)
DESCRIPTION
Shuts down the FLEXlm servers. This is used by lmdown.
PARAMETERS
RETURN
ERROR RETURNS
SEE ALSO
• Chapter 10, “The License Manager Daemon”
8.1.13 lc_test_conf()
SYNTAX
conf = lc_test_conf(lm_job)
DESCRIPTION
Retrieves the license file line for the most recently tested feature. A feature is
tested, but not checked out, when the LM_CO_LOCALTEST flag is set in the
call to lc_checkout(). Use lc_test_conf() to retrieve information from a license
file for tested features. For checked out features, use lc_auth_data().
The behavior of lc_test_conf() is undefined if called in any other context other
than after a tested feature.
The following code excerpt demonstrates using this function. In this example,
the application obtains information for the feature just tested in order to display
various fields. For this example, consider the following feature line from the
license file:
FEATURE f1 demo 1.0 permanent 4 NOTICE="ab" \
SIGN=xxxxxxxxxxxx
PARAMETERS
RETURN
ERROR RETURNS
None.
SEE ALSO
• lmclient.h for the CONFIG struct definition
• Section 6.4.1, “lc_auth_data()”
• Section 6.4.3, “lc_checkout()”
• Section 8.1.7, “lc_get_config()”
• Section 8.1.10, “lc_next_conf()”
Attribute Description
LM_A_BEHAVIOR_VER Sets FLEXlm behavior to the
given version.
LM_A_CHECKOUT_DATA Allows labeling of a given
checkout request.
LM_A_CHECKOUTFILTER, Defines a pointer to a checkout
LM_A_CHECKOUTFILTER_EX filter function for feature pre-
processing.
LM_A_CHECKOUTFILTERLAST_EX Defines a pointer to a checkout
filter function for feature post-
processing.
LM_A_CRYPT_CASE_SENSITIVE Controls case-sensitivity of
license file authentication.
LM_A_DIAGS_ENABLED Controls the output of detailed
diagnostic data.
Attribute Description
LM_A_DISABLE_ENV Controls the use of the
LM_LICENSE_FILE
environment variable.
LM_A_DISPLAY_OVERRIDE Overrides the display name.
LM_A_HOST_OVERRIDE Overrides the host name.
LM_A_LICENSE_CASE_SENSITIVE Controls license file case-
sensitivity.
LM_A_MT_HEARTBEAT (UNIX Controls the use of multi-
Only) threaded heartbeats.
LM_A_PERIODIC_CALL Defines a pointer to a function
to be called after the specified
number of heartbeats.
LM_A_PERIODIC_COUNT Specifies the number of
heartbeats between calls to
function specified by
LM_A_PERIODIC_CALL.
8.2.1 LM_A_BEHAVIOR_VER
Type: (char *)
Default: LM_BEHAVIOR_V8
This sets the behavior of the FLEXlm-enabled application to the given version
of FLEXlm.
Valid values are LM_BEHAVIOR_Vx, where x is 2, 3, 4, 5, 5_1, 6, 7, 7_1,
8, 8_1, 8_2, or 8_3.
SEE ALSO
• Section 13.2.1, “ls_a_behavior_ver”
8.2.2 LM_A_CHECKOUT_DATA
Type: (char *)
Default: None
The LM_A_CHECKOUT_DATA attribute allows you to set a checkout-data
string. It is used to label the next successful checked out feature or to qualify a
feature check in request with the checkout-data label.
The checkout-data string is a character string, with a maximum size of
MAX_VENDOR_CHECKOUT_DATA bytes (32 bytes). The default value is
the NULL string. Each unique value of LM_A_CHECKOUT_DATA
represents a unique license group; the NULL string can be one of those unique
values. Like all other attributes, set this before the checkout or checkin request;
it takes effect for all subsequent calls to lc_checkout() or lc_checkin() until it is
changed.
There are two scenarios where a checkout-data string, defined via the
LM_A_CHECKOUT_DATA attribute setting, can be used:
• To force the license count to be accumulated incrementally across multiple
checkouts in the same license job rather than as an aggregate.
• To create a custom duplicate grouping criteria.
These scenarios are described below.
INCREMENTAL LICENSE COUNT
By default, checkout requests for the same feature and version from the same
license job have an aggregate affect on the number of licenses consumed. That
is, the FLEXlm client library checks out only as many additional licenses for
the feature as necessary to reach the count specified in the checkout request.
For example:
If an initial checkout request which asks for two licenses for feature “f1”
lc_checkout(lm_job, f1, "1.0", 2,...,LM_DUP_NONE);
is followed by a second call which asks for five licenses for the same feature,
lc_checkout(lm_job, f1, "1.0", 5,...,LM_DUP_NONE);
the second call checks out only three additional licenses (5 minus 2). If the
second call asks for the same or fewer number of licenses than were already
checked out, the second call does not check out additional licenses.
This makes it possible to have different sets of licenses for a given feature
without having to create a separate license job. Each set is labeled with a
different checkout-data string, and is tracked separately by the license server.
Subsequent check in requests then can qualify the feature with the checkout-
data string by setting it with the LM_A_CHECKOUT_DATA attribute before
calling lc_checkin(). Each checkout or checkin request uses the value of the
checkout-data string from the last call to lc_set_attr().
CUSTOM DUPLICATE GROUPING
Duplicate grouping based on USER, HOST, or DISPLAY may not represent
the duplicate grouping criteria you need. The checkout-data string can be used
to group duplicates via a custom vendor criteria, in addition to the
USER/HOST/DISPLAY duplicate grouping criteria. Set the checkout-data
string using the LM_A_CHECKOUT_DATA attribute and then, in the
subsequent call to lc_checkout(), set the LM_DUP_VENDOR bit in the
duplicate grouping bitmask. For example, if user A’s application performs the
following checkout request:
lc_set_attr(lm_job, LM_A_CHECKOUT_DATA, "dup1");
lc_checkout(lm_job, f1, "1.0", 1,...,LM_DUP_VENDOR)
then the two checkout requests are considered duplicates, based on the vendor
duplicate grouping criteria of dup1, and only one license is consumed.
Note: Duplicate grouping criteria can also be expressed in the license file via the
DUP_GROUP keyword on FEATURE/INCREMENT lines. See Section
3.5.7, “DUP_GROUP,” for further details.
USER VISIBILITY
You have the option in your vendor daemon of allowing the
LM_A_CHECKOUT_DATA string to be visible or not. The daemon variable
ls_show_vendor_def controls whether the checkout-data string is visible to
your end users via lmstat (or any utility which calls lc_userlist()).
If you are considering using this attribute, we recommend that you contact
Technical Support for guidance.
SEE ALSO
• Section 6.4.3, “lc_checkout()”
• Section 6.4.20, “lc_set_attr()”
• Section 11.4, “Multiple Jobs”
• Section 13.2.11, “ls_show_vendor_def”
8.2.3 LM_A_CHECKOUTFILTER,
LM_A_CHECKOUTFILTER_EX
Type: Pointer to a function returning int.
Default: None
DESCRIPTION
The function pointer LM_A_CHECKOUTFILTER (or the extended version,
LM_A_CHECKOUTFILTER_EX) is set to point to a checkout filter callback
function. This filter function is invoked each time lc_checkout() finds a
FEATURE/INCREMENT line that is a candidate for fulfilling the license
request. Candidates are selected based on the feature name.
This filter provides the application the opportunity to examine the
FEATURE/INCREMENT line before lc_checkout() processes it, and either
allows lc_checkout() to proceed processing the line or rejects this particular
line. lc_checkout() may still reject the line even though the filter function
allows processing to proceed.
The LM_A_CHECKOUTFILTER routine is called as follows:
status = (*myCheckoutFilter)(config);
CALLBACK PARAMETERS
RETURN VALUES
The return value from this function effects the outcome of the current checkout
request in the following ways
• If 0 is returned —
lc_checkout() continues to evaluate the FEATURE line in an attempt to
satisfy the license request.
• If a non-zero value is returned —
lc_checkout() does not continue to evaluate the current FEATURE line
but, instead, takes one of the following actions:
- Invokes this filter function, again, with a subsequent candidate
FEATURE line for the license request.
- If there are no more candidate FEATURE lines, lc_checkout() fails and
sets the FLEXlm error number to LM_LOCALFILTER; the license is
not checked out.
SEE ALSO
• Section 6.4.3, “lc_checkout()”
• Section 8.2.4, “LM_A_CHECKOUTFILTERLAST_EX”
• Section 8.2.17, “LM_A_VENDOR_CALLBACK_DATA”
8.2.4 LM_A_CHECKOUTFILTERLAST_EX
Type: Pointer to a function returning int.
Default: None
DESCRIPTION
The function pointer LM_A_CHECKOUTFILTERLAST_EX is set to point to
a checkout filter callback function. This filter function is invoked after
lc_checkout() authenticates a FEATURE/INCREMENT line locally as being
valid for fulfilling the license request.
This filter provides the application the opportunity to examine the
FEATURE/INCREMENT line after lc_checkout() authenticates it locally, and
either allows lc_checkout() to proceed processing the line or rejects this
particular line. If the filter function allows processing to proceed, lc_checkout()
passes a served license request to the license server where it still may get
denied.
The LM_A_CHECKOUTFILTER_EX routine is called as follows:
status = (*myCheckoutFilterLastEx)(job, config, vendor_data);
CALLBACK PARAMETERS
RETURN VALUES
The return value from this function effects the outcome of the current checkout
request in the following ways
• If 0 is returned —
For served licenses, lc_checkout() passes the license request to the license
server for further processing. For unserved licenses, lc_checkout() checks
out the license.
• If a non-zero value is returned —
lc_checkout() does not continue to evaluate the current FEATURE line
but, instead, takes one of the following actions:
- Invokes this filter function, again, with a subsequent authenticated
FEATURE line for the license request.
- If there are no more candidate FEATURE lines, lc_checkout() fails and
sets the FLEXlm error number to LM_LOCALFILTER; the license is
not checked out.
SEE ALSO
• Section 6.4.3, “lc_checkout()”
• Section 8.2.3, “LM_A_CHECKOUTFILTER,
LM_A_CHECKOUTFILTER_EX”
• Section 8.2.17, “LM_A_VENDOR_CALLBACK_DATA”
8.2.5 LM_A_CRYPT_CASE_SENSITIVE
Type: (short)
Default: Case-insensitive comparison
If specified as a non-zero integer, LM_A_CRYPT_CASE_SENSITIVE will
cause the output of the authentication function to be compared to the code in
the license file with a case-sensitive comparison.
8.2.6 LM_A_DIAGS_ENABLED
Type: (short)
Default: On (1)
This option allows FLEXlm to produce some diagnostic output for failures of
the lc_checkout() call if the environment variable FLEXLM_DIAGNOSTICS is
set. If LM_A_DIAGS_ENABLED is set to 0, this diagnostic information is
unconditionally disabled.
The FLEXLM_DIAGNOSTICS environment variable can be used by your end
users to obtain more information if a checkout fails. If FLEXLM_DIAGNOSTICS
is set, an lc_perror() call is made. If FLEXLM_DIAGNOSTICS is set to “2,” then
in addition to the lc_perror() call, the arguments to lc_checkout() (except for the
KEY information) are printed to stderr, also (on Windows, this is logged to
flex_err.log).
The diagnostics are enabled by default. Macrovision recommends that this be
left enabled. This will allow us to help you debug your end users’ problems
with error messages more explicit than, “can’t get license.” In these situations,
we are unable to help. We developed and distributed the
FLEXLM_DIAGNOSTICS to enable us (and your support people) to help your
end users more effectively.
8.2.7 LM_A_DISABLE_ENV
Type: (short)
Default: LM_LICENSE_FILE environment variable enabled
If set to a non-zero value, disable_env will force the FLEXlm client functions
to disregard the setting of the LM_LICENSE_FILE environment variable. It’s
rare that there’s a legitimate reason to use this, but it does come up with certain
utilities that may explicitly need to ignore the LM_LICENSE_FILE
8.2.8 LM_A_DISPLAY_OVERRIDE
Type: (char *)
Default: No override of display name
Note: This value cannot be changed for a job after the initial connection to the vendor
daemon.
WINDOWS PLATFORMS
This string, if specified, is used to override the display name as derived from
the WTSQuerySessionInformation() call from the Platform SDK Terminal
Services API. The most common use of this attribute is for setting the display
to the remote hostname in a Terminal Server environment.
UNIX PLATFORMS
This string, if specified, is used to override the display name as derived from
the UNIX ttyname() system call.
The most common use of this attribute is for setting the display to the X-
Display name. Unfortunately, the only reliable way of obtaining the name of
the X-Display is via a call to an X-based routine. Therefore, this can only be
done by the X-based application, after XOpenDisplay() (or XtAppInitialize())
has been called.
The Display name is available via the X macro DisplayString(display).
In addition, it is essential to note that there are at least three possible aliases for
using the monitor attached to the computer in use: localhost:0, unix:0,
and :0. If any of these are used, LM_A_DISPLAY_OVERRIDE should use the
result of gethostname() instead. Finally, it may be safest to use the IP address
as a string to avoid the problem of aliases for a particular display host.
8.2.9 LM_A_HOST_OVERRIDE
Type: (char *)
Default: No override of host name
This string, if specified, will be used to override the host name as derived from
the UNIX gethostname() system call.
Note: This value cannot be changed for a job after the initial connection to the vendor
daemon.
8.2.10 LM_A_LICENSE_CASE_SENSITIVE
Type: (int)
Default: False
If True, the license file is case-sensitive. This should be set to True to
generate license files compatible with older versions of FLEXlm. This attribute
is automatically set to True if the LM_A_LICENSE_FMT_VER or
LM_A_BEHAVIOR_VER attributes are set to LM_BEHAVIOR_V5_1 or
less.
SEE ALSO
• Section 13.2.3, “ls_a_license_case_sensitive”
8.2.11 LM_A_MT_HEARTBEAT (UNIX Only)
Type: (int)
Default: True
This flag applies to UNIX platforms only. If True, the automatic heartbeat
mechanism is controlled via a dedicated thread in the FLEXlm-enabled
application. The platform must support pthreads in order to implement a
dedicated thread for heartbeat messages.
If False, automatic heartbeats are controlled in the application’s main thread
using the SIGALRM signal.
SEE ALSO
• Chapter 12, “Heartbeats”
8.2.12 LM_A_PERIODIC_CALL
Type: Pointer to a function returning int. Return value not used.
Default: No periodic call
This function, if specified, will be called each LM_A_PERIODIC_COUNT
times that lc_heartbeat() is called. lc_heartbeat() is called directly or
automatically depending on the value of LM_A_CHECK_INTERVAL.
SEE ALSO
• Section 7.3.5, “LM_A_CHECK_INTERVAL”
• Section 6.4.12, “lc_heartbeat()”
8.2.13 LM_A_PERIODIC_COUNT
Type: (int)
Default: 0 (no PERIODIC_CALL)
This is the count of how many times lc_heartbeat() must be called before the
function specified by LM_A_PERIODIC_CALL is called. lc_heartbeat() is
called directly or automatically depending on the value of
LM_A_CHECK_INTERVAL.
SEE ALSO
• Section 7.3.5, “LM_A_CHECK_INTERVAL”
• Section 6.4.12, “lc_heartbeat()”
8.2.14 LM_A_PLATFORM_OVERRIDE
Type: (char *)
Default: No override of the FLEXlm platform name
This string, if specified, overrides the current platform name. The name can be
either a FLEXlm platform name or a vendor-defined name. This attribute is
used in conjunction with the PLATFORMS= keyword on
FEATURE/INCREMENT lines. The FLEXlm Release Notes contain the
currently supported platforms and their associated FLEXlm platform names.
SEE ALSO
• Section 3.5.16, “PLATFORMS”
• FLEXlm Release Notes located in the machind directory of the FLEXlm
SDK.
8.2.15 LM_A_RETRY_CHECKOUT
Type: (int)
Default: True
When True, checkouts that fail due to communications errors are automatically
retried once. Sometimes this second attempt will succeed on networks with
poor communications, but this makes failure take twice as long. This is default
behavior in all of the FLEXlm APIs.
8.2.16 LM_A_USER_OVERRIDE
Type: (char *)
Default: No override of user name
This string, if specified, will be used to override the user name as derived from
the UNIX password file. On Windows, the user name is set to the host name,
but can be overridden with this attribute.
Note: This value cannot be changed after the initial connection to the vendor daemon.
8.2.17 LM_A_VENDOR_CALLBACK_DATA
Type (void *)
Default: (void *) NULL
This attribute allows you to set a pointer to vendor-defined data. The pointer is
of type void regardless of the data type. This pointer is passed, as the last
argument, to the following callback functions, thus making this data available
to those functions.
• LM_A_CHECKOUTFILTER_EX
• LM_A_USER_EXITCALL_EX
• LM_A_USER_RECONNECT_EX
• LM_A_USER_RECONNECT_DONE_EX
Variable Description
ls_borrow_in Callback that removes the given
borrow-data record from a borrow-
data cache.
ls_borrow_init Callback that returns all borrow-data
records from a borrow-data cache.
ls_borrow_out Callback that adds the given
borrow-data record to a borrow-data
cache.
ls_borrow_return_early Controls ability for borrowed
licenses to be returned early.
ls_conn_timeout Controls vendor daemon connection
timeout.
ls_do_checkroot (UNIX Controls requirement for the vendor
Only) daemon’s residence on a real root
filesystem.
ls_dump_send_data Controls the output of transmitted
daemon data.
ls_hud_hostid_case_sensit Controls case sensitivity for hostid
ive types HOSTNAME, DISPLAY, and
USER.
8.3.1 ls_borrow_in
void (*ls_borrow_in) (char ** borrowdata, int datasize) =
default_BorrowIn;
This callback function removes the record that matches borrowdata from the
borrow-data cache. The license server calls this function, if set, every time a
borrow/lingered license expires or a borrowed license is returned.
By default, this callback is defined with an internal implementation that uses a
predefined borrow-data cache. You can override the internal implementation
with your own function that accesses your vendor-defined cache. Your
implementation needs to:
• Open your vendor-defined cache.
• Iterate through each record in the cache to find the one match that matches
borrowdata.
The initial field of each record (sizeof(int)) contains the size, in bytes, of
the record. The size of this initial field is included in the count.
• Remove the matching record from the cache.
• Cleanup the cache, as appropriate.
Note: Do not attempt to free the borrowdata buffer itself. It is allocated on the stack
and will get popped on return from the callback.
This function is one of the borrow-data cache management routines; the others
being ls_borrow_init and ls_borrow_out.
SEE ALSO
• Section 8.3.2, “ls_borrow_init”
• Section 8.3.3, “ls_borrow_out”
8.3.2 ls_borrow_init
void (*ls_borrow_init)(char ** borrowbuf, int * bufsize) =
default_BorrowInit;
The borrow-data cache contains a record with borrow data for each borrowed
license. The initial field of each record (sizeof(int)) contains the number of
bytes comprising that record. The first byte of the subsequent record
immediately follows the last byte of the previous record.
The license server, at start up time, calls this function if it is set. By default, this
callback is defined with an internal implementation that uses an internally-
defined borrow-data cache. You can override the internal implementation with
your own function that accesses your vendor-defined borrow-data cache. The
following code is a sample implementation of this function using the file,
myBorrowFile, as the vendor-defined borrow-data cache:
void
myBorrowInit(char **borrowbuf, int *bufsize)
{
int filesize = 0;
char filename[MAX_PATH] = "myBorrowFile";
FILE * fp = NULL;
*bufsize = 0;
.
.
.
/* open borrow-data file, "myBorrowFile" */
.
.
.
(void)fseek(fp, 0, SEEK_END);
filesize = ftell(fp); /* get size of "myBorrowFile" */
{
*borrowbuf = NULL;
*bufsize = 0;
}
This function is one of the borrow-data cache management routines; the others
being ls_borrow_in and ls_borrow_out.
SEE ALSO
• Section 8.3.1, “ls_borrow_in”
• Section 8.3.3, “ls_borrow_out”
8.3.3 ls_borrow_out
void (*ls_borrow_out) (char ** borrowdata, int datasize) =
default_BorrowOut;
Note: Do not attempt to free the borrowdata buffer itself. It is allocated on the stack
and will get popped on return from the callback.
This function is one of the borrow-data cache management routines; the others
being ls_borrow_in and ls_borrow_init.
SEE ALSO
• Section 8.3.1, “ls_borrow_in”
• Section 8.3.2, “ls_borrow_init”
8.3.4 ls_borrow_return_early
(int) ls_borrow_return_early = 0;
This variable controls whether the license server allows a borrowed license to
be returned before the borrow period is over.
This variable has two settings:
SEE ALSO
• Section 8.3.1, “ls_borrow_in”
• Section 8.3.2, “ls_borrow_init”
• Section 8.3.3, “ls_borrow_out”
8.3.5 ls_conn_timeout
(int) ls_conn_timeout = MASTER_WAIT;
/* How long to wait for a connection */
To require that your vendor daemon be running on a file system which has its
root directory as the “real” root directory of the disk, set this option. This
prevents an end user from cloning part of the UNIX file hierarchy and
executing the daemon with a chroot command. If this were done, the vendor
daemon locking would be bypassed and the user could run as many copies of
your vendor daemon as he desired.
Theft by using chroot is considered to be an obscure, difficult kind of theft.
The user has to have root permission, and setting up a phony / directory is a
non-trivial task. It requires that the necessary parts of the OS from /etc, /dev,
/bin, etc. be copied into this phony / directory and is an ongoing
administrative hassle.
This variable controls the debug output of transmitted daemon data. It should
normally be left set to 0.
8.3.8 ls_hud_hostid_case_sensitive
(int) ls_hud_hostid_case_sensitive = 0;
This variable controls the case sensitivity for hostid types HOSTNAME,
DISPLAY, and USER in the context of a served, node-locked license. When
ls_hud_hostid_case_sensitive is set to 0, the values for HOSTNAME,
DISPLAY, and USER hostids are treated as case insensitive. When set to 1, these
values are treated as case sensitive.
The default setting is 0 (case insensitive).
8.3.9 ls_use_all_feature_lines
(int) ls_use_all_feature_lines = 0;
/* Use ALL copies of feature lines that are...
The variable causes your vendor daemon to process every FEATURE line in
the license file as an INCREMENT line.
With ls_use_all_feature_lines set to a non-zero value, any old feature
lines which you may have shipped will now be “legal,” so, for example, if you
had shipped a customer a FEATURE line with a count of 5, then upgraded
them with a new line with a count of 7, they would now be able to use 12
licenses.
Also note that license borrowing depends on the INCREMENT line, so if you
use ls_use_all_feature_lines, then license borrowing will not be
available to you.
SEE ALSO
• Section 3.5, “FEATURE /INCREMENT Lines”
8.3.10 ls_user_lockfile
(char *) ls_user_lockfile = (char *)NULL;
By default, only one instance of a vendor daemon with the same name can run
on the same machine at one time; a lock file is used to prevent multiple copies
from executing at the same time. The default lock file names are:
Windows C:\flexlm\vendor
where vendor is the vendor daemon name, as on the VENDOR line in the
license file.
To change the location of the lock file, set ls_user_lockfile to the new
location. If ls_user_lockfile is NULL, the default lock file will be used.
Express the lock file name as the file’s full path name.
USAGE GUIDELINES FOR VENDOR DAEMON SYNCHRONIZATION
• Windows Platforms
- If one or more vendor daemons involved in the synchronization are pre-
v8.2, use this mechanism for all daemons in the group.
- If all vendor daemons involved in the synchronization are v8.2 or later,
see Section 8.3.11, “ls_user_lock (Windows only).”
• UNIX Platforms
- Use this mechanism regardless of vendor daemon version.
8.3.11 ls_user_lock (Windows only)
char *(*ls_user_lock)() = NULL;
By default, only one instance of a vendor daemon with the same name can run
on the same machine at one time. If you want to prevent multiple vendor
daemons that have different vendor names from running simultaneously, use
this callback mechanism.
License Models
This indicates the expiration date and the fact that it’s a demo license (node-
locked to HOSTID=DEMO). The product is fully usable until January 1, 2005.
FEATURE lines like this can be pre-printed with different expiration dates,
and given to salespeople and distributors. For example, you may distribute the
following file (the examples assume a vendor daemon named “corp” to avoid
confusion):
FEATURE f1 corp 1.0 1-jan-2005 uncounted HOSTID=DEMO SIGN=AB1CC0916A06
FEATURE f1 corp 1.0 1-feb-2005 uncounted HOSTID=DEMO SIGN=ABDCC0116A06
FEATURE f1 corp 1.0 1-mar-2005 uncounted HOSTID=DEMO SIGN=BBDCA0D151ED
FEATURE f1 corp 1.0 1-apr-2005 uncounted HOSTID=DEMO SIGN=BBDCB0E155F1
[...]
If the current date is February 1, 2005, then the salesperson would give an
evaluator the third line, which expires in a month, March 1, 2005. The
evaluator could simply save the FEATURE line in the license file where the
product expects it, and then the product will run for one month.
A PACKAGE line can be used to make this even easier for multiple features.
If a company ships features A through F, the company can initialize the
licenses with:
PACKAGE all corp 1.0 COMPONENTS="A B C D E F" SIGN=B0A0F011B491
Then appending a single demo FEATURE line can enable all these features:
FEATURE all corp 1.0 1-jan-2005 uncounted HOSTID=DEMO \
SIGN=AB1CC0916A06
The FEATURE line must appear after the PACKAGE line to work correctly.
9.1.2 Limited Functionality Demos
FLEXlm does do some security checks to prevent users from setting system
dates back. Though date-setback detection can be circumvented, most “honest
users” (customers who would pay for licenses that cannot be stolen) find that
working with incorrect system dates is annoying and too public a form of theft.
For companies that are more concerned with security, there are several things
that can be done to make date setback less feasible:
PROMINENTLY DISPLAY EXPIRATION DATE
After a successful checkout, call:
conf = lc_auth_data(job, feature)
to get an authenticated copy of the CONFIG struct that authorized the checkout.
Put the expiration date (CONFIG->date) in a prominent place in the GUI so
that the date-setback detection is more public.
PROVIDE AN INSISTENT REMINDER
If it is an expiring evaluation version, periodically do something annoying—
perhaps a popup that appears every few minutes which encourages the user to
purchase the product.
DISABLE SOME FUNCTIONALITY
A classic example is a word processing program that alters saved files so that,
when printed, the word “EVALUATION” is printed in large letters across
every page. This allows evaluators full functionality, without reasonable
utility.
The application needs to detect that the HOSTID is DEMO for this type of
evaluation, and lc_auth_data() is the correct function to use:
CONFIG *conf; /* outline of C source */
LM_HANDLE *job;
lc_new_job(...&job);
rc = lc_checkout(job, feature ... );
if (rc) return rc; /* error handling */
conf = lc_auth_data(job, feature);
if (conf->idptr && conf->idptr->type == HOSTID_DEMO)
{
/* it’s a demo license, disable some functionality... */
}
SEE ALSO
• Section 3.5, “FEATURE /INCREMENT Lines”
• Section 3.7, “PACKAGE Lines”
• Section 6.4.1, “lc_auth_data()”
• Section 7.2.3, “LM_CHECK_BADDATE”
• Section 13.2.2, “ls_a_check_baddate”
SEE ALSO
• Section 3.5, “FEATURE /INCREMENT Lines”
• Section 7.3.21, “LM_A_VD_GENERIC_INFO,
LM_A_VD_FEATURE_INFO”
where:
Note: The license-file list can also be specified by setting the environment variable
LM_LICENSE_FILE to the file’s path name. The -c path specification will
override the setting of LM_LICENSE_FILE.
The problem with running a server this way is that it occupies a window on the
screen, and may be difficult to start and stop. On Windows, lmgrd can be
installed as a service to allow it to be started and stopped through a user
interface and run in the background.
To get lmgrd to run as a service, you need to “install” it. Two methods are
available:
• Using the GUI application, LMTOOLS
• Using the command line utility, installs.exe
Both are located in the platform directory of your SDK installation. Using
LMTOOLS to install lmgrd as a service is the recommended technique (see
the FLEXlm Programmers Guide). If you prefer to use the installs utility,
see Section 18.9, “Installing lmgrd as a Service Using installs.”
If all the end user’s data is on a single file server, then there is no need for
redundant servers, and Macrovision recommends the use of a single server
node for the FLEXlm daemons. If the end user’s data is split among two or
more server nodes and work is still possible when one of these nodes goes
down or off the network, then multiple server nodes can be employed.
In all cases, an effort should be made to select stable systems as server nodes;
in other words, do not pick systems that are frequently rebooted or shut down
for one reason or another. Multiple server nodes can be any supported server
nodes—it is not required that they be the same architecture or operating
system.
FLEXlm supports two methods of redundancy: redundancy via a license-file
list in the LM_LICENSE_FILE environment variable and a set of three
redundant license servers.
See the FLEXlm Programmers Guide for more information on license servers
and recommendations about configuring license server machines.
Basic instructions for building your FLEXlm SDK, adding calls to the Simple
or Trivial API into your application, and building your application can be
found in the FLEXlm Programmers Guide. This chapter contains information
about some advanced FLEXlm features that can be implemented using the
FLEXible API and about FLEXlm security.
FLEXlm SDKs also contain an examples directory at the top level of the SDK
hierarchy. The examples directory contains example programs, which have
been put in the SDK to illustrate how to perform various operations with
FLEXlm. These programs are not supported, and Macrovision may not include
them in future FLEXlm releases.
/* error processing */
job2 = 0;
}
else
{
set_all_my_attr(job2);/* Reset attributes */
if (lc_checkout(job2, "f2", "1.0", 1,
LM_CO_NOWAIT, &code, LM_DUP_NONE))
{
/* error processing */ ;
}
}
}
/* application code here */
lc_checkin(job1, LM_CI_ALL_FEATURES, 0);
lc_free_job(job1);
if (job2 && job2 != job1)
{
lc_checkin(job2, LM_CI_ALL_FEATURES, 0);
lc_free_job(job2);
}
If the application is managing many jobs, you may want to free jobs with
lc_free_job() to save memory. When doing so, make sure that you do not delete
a job which still has a license checked out—this can result in a core dump.
Jobs can be found and managed using lc_first_job() and lc_next_job(), which
are used to walk the list of jobs. Attributes for jobs are set and retrieved with
lc_set_attr() and lc_get_attr().
SEE ALSO
• Section 6.4.10, “lc_free_job()”
• Section 6.4.11, “lc_get_attr()”
• Section 6.4.17, “lc_new_job()”
• Section 6.4.9, “lc_first_job()”
• Section 6.4.20, “lc_set_attr()”
11.5 FLEXlock
FLEXlock is available only on Windows.
If you are using FLEXlock and the FLEXible API and want to check out a
feature, you must call the LM_USE_FLEXLOCK() macro before the call to the
lc_checkout(). LM_USE_FLEXLOCK() can be used with the Trivial, Simple, or
FLEXible API.
LM_USE_FLEXLOCK();
status = lc_checkout(job, feature, version, num_lic, flag,
code, dup_group)
CHECKING OUT MORE THAN ONE FEATURE WITH FLEXLOCK ENABLED
If you are using FLEXlock and your application checks out more than one
feature, use the FLEXible API.
You will need a flag indicating that the first checkout was authorized by
FLEXlock. In the following example code, the flag is called flexlock_flag
and is initialized to 0.
After the first successful call to lc_checkout() returns, call:
CONFIG *conf;
extern int flexlock_flag;
conf = lc_auth_data(job, feature);
if (conf->idptr && (conf->idptr->type == HOSTID_FLEXLOCK))
{
flexlock_flag = 1;
}
where:
WINDOWS USAGE
lmstrip [-e] [-i] [-v | -q]
[-m[rw] [mapfile]] [-o string_file] filename
where:
Because symbol names do not appear in fully linked Windows binaries, this
procedure is not needed on Windows platforms.
PROVIDING ADDITIONAL SECURITY FOR LICENSING LIBRARIES
UNIX scenario:
1. ld -r my_routines.o liblmgr.a -o ofile.o
ofile.o now includes both the necessary FLEXlm functions referenced
from my_routines.o and the contents of my_routines.o.
2. lmstrip ofile.o my_symbol_1 my_symbol_2 my_symbol_3
This obfuscates the FLEXlm symbol names as well as the additional
vendor-specified symbols.
3. You then ship ofile.o to your customers, knowing that the FLEXlm
symbol names and the specified vendor symbol names are not detectable
in the resulting object file.
Windows scenario:
1. lib my_routines.lib lmgr.lib /out:ofile.lib
ofile.lib now includes the contents from both my_routines.lib and
lmgr.lib.
2. lmstrip -o mystrings ofile.lib
Where mystrings contains lines similar to the following:
+my_symbol_1
+my_symbol_2
+my_symbol_3
This obfuscates the FLEXlm symbol names as well as the additional
symbol names specified in mystrings.
3. lib ofile.lib
This re-sorts ofile.lib so that subsequent linking can resolve the newly
obfuscated symbols.
4. You then ship ofile.lib to your customers, knowing that the FLEXlm
symbol names as well as the vendor-specified symbol names are not
detectable in the resulting library file.
LINKING WITH A LIBRARY THAT ALREADY USES FLEXLM
You can protect against symbol name conflict among multiple FLEXlm-
enabled licensing libraries by using lmstrip on each individual licensing
library. This technique obfuscates the FLEXlm symbol names locally to each
library, eliminating FLEXlm symbol name conflict when two or more such
libraries are linked into an application binary.
Heartbeats
The FLEXlm license server uses a TCP/IP port to communicate to the licensed
application; it can detect when a connection to the licensed application is gone
and frees its licenses automatically. However, an application needs to
communicate regularly with the license server to detect that the server is still
running. This communication is effected via heartbeats.
A heartbeat is a message initiated by the application and acknowledged by the
license server; this exchange assures each that the other is still alive and
healthy. By default, heartbeats are sent and acknowledgments are received
automatically by the FLEXlm-licensed application at a pre-determined
interval.
If the license server is shut down and restarted, the heartbeat mechanism in the
application automatically reconnects to the server and checks out the
complement of licenses that is currently being used. If your application does
not send heartbeats to the license server, the application cannot determine that
the license server has been shut down and restarted. If the license server is
restarted without the application’s knowledge, current copies of the application
continue running and a new, full complement of licenses becomes available for
the license server, making license over-usage possible.
Every time the license server receives a heartbeat, it immediately sends an
acknowledgement message back to the application. This message doesn’t get
picked up by the application until it is time for the next heartbeat; this latency
is, by default, 120 seconds. This means the FLEXlm-licensed application does
not detect that the license server is down until the time has passed for two
heartbeats to sent. If the license server is shut down, the next heartbeat
succeeds, because the acknowledgement processed is from the previous
heartbeat. If a heartbeat is not acknowledged by the license server, the
application can decide what action to take: continue, warn or terminate.
Deciding how the heartbeats occur and what action takes place when the
license server is not running is an important part of incorporating FLEXlm in
an application. On both Windows and UNIX, automatic heartbeats are
recommended and are automatically implemented as a separate thread in the
licensed application.
Heartbeats can be automatic or manual. The distinction being how the timing
of heartbeat messages is managed and how reconnection attempts are
recognized and handled. Table 12-1 summarizes these distinctions.
Automatic
Manual Heartbeats
Heartbeats
Control of heartbeat Control of heartbeat timing
timing is transparent via a is regulated by the frequency
Heartbeat
dedicated thread created with which the application
Timing by FLEXlm on behalf of invokes a particular
the application. function.
218 Heartbeats
Automatic Heartbeats
Attribute Description
Thread Management
LM_A_MT_HEARTBEAT Determines whether a dedicated
thread in the application is used
to manage heartbeats. Default is
to use a dedicated thread. UNIX
platforms only.
Exchange Management
Attribute Description
LM_A_CHECK_INTERVAL Used to set the interval at which
heartbeats are exchanged.
Default is 120 seconds.
Reconnection Strategy
LM_A_RETRY_COUNT Used to adjust the number of
reconnect attempts. If -1, the
application retries forever.
Default is 5 attempts.
LM_A_RETRY_INTERVAL Used to adjust the interval
between retry attempts. Default
interval is 60 seconds.
LM_A_USER_RECONNECT Sets a pre-reconnection callback
LM_A_USER_RECONNECT_EX to a vendor-defined routine.
Default is no handler.
LM_A_USER_RECONNECT_DONE Sets a post-reconnection callback
LM_A_USER_RECONNECT_DONE_EX to a vendor-defined routine.
Default is no handler.
Lost Server Recovery
LM_A_USER_EXITCALL Sets a callback to a vendor-
LM_A_USER_EXITCALL_EX defined exit handler. Default is
for FLEXlm to call exit() system
call on behalf of the application.
SEE ALSO
• Section 7.3.5, “LM_A_CHECK_INTERVAL”
• Section 7.3.16, “LM_A_RETRY_COUNT,
LM_A_RETRY_INTERVAL”
• Section 7.3.18, “LM_A_USER_EXITCALL,
LM_A_USER_EXITCALL_EX”
• Section 7.3.19, “LM_A_USER_RECONNECT,
LM_A_USER_RECONNECT_EX”
220 Heartbeats
Manual Heartbeats
The heartbeat routine returns the number of reconnects over a given time
period and the state of the connection to the license server. Monitor these return
values and take appropriate action.
222 Heartbeats
Manual Heartbeats
Attribute Description
Reconnection Strategy
LM_A_RETRY_COUNT Used to adjust the number of
consecutive reconnect attempts
(each call to the heartbeat routine
makes one attempt) to a lost
license server before the
heartbeat routine causes the
application to exit. If -1, exit is
never called. Default is 5
attempts.
LM_A_USER_RECONNECT Sets a pre-reconnection callback
LM_A_USER_RECONNECT_EX to a vendor-defined routine.
Default is no handler.
LM_A_USER_RECONNECT_DONE Sets a post-reconnection callback
LM_A_USER_RECONNECT_DONE_EX to a vendor-defined routine.
Default is no handler.
Lost Server Recovery
LM_A_USER_EXITCALL Sets a callback to a vendor-
LM_A_USER_EXITCALL_EX defined exit handler. Default is
for application exit.
SEE ALSO
• Section 7.3.16, “LM_A_RETRY_COUNT,
LM_A_RETRY_INTERVAL”
• Section 7.3.18, “LM_A_USER_EXITCALL,
LM_A_USER_EXITCALL_EX”
• Section 7.3.19, “LM_A_USER_RECONNECT,
LM_A_USER_RECONNECT_EX”
• Section 7.3.20, “LM_A_USER_RECONNECT_DONE,
LM_A_USER_RECONNECT_DONE_EX”
VENDORCODE code;
LM_HANDLE *lm_job;
void
main(int argc, char * argv[])
{
/* Initialize the job */
if (lc_new_job(0, lc_new_job_arg2, &code, &lm_job))
{
lc_perror(lm_job, "lc_new_job failed");
exit(lc_get_errno(lm_job));
}
224 Heartbeats
License Server-side Considerations
226 Heartbeats
Chapter 13
Vendor Daemon
13.2.1 ls_a_behavior_ver
(char *) ls_a_behavior_ver = 0; /* like LM_A_BEHAVIOR_VER */
If set to 1, and the license that would authorize a checkout is expiring, a check
is made to see if the system date has been set back. If the failure is due to
detection of system date tampering, the checkout error will be
LM_BADSYSDATE.
SEE ALSO
• Section 7.2.3, “LM_CHECK_BADDATE”
• Section 9.1.2, “Limited Functionality Demos”
13.2.3 ls_a_license_case_sensitive
(int) ls_a_license_case_sensitive = 0;
/* like LM_A_LICENSE_CASE_SENSITIVE */
If VENDOR_STRING is used in your license files, then the value of these two
variables may need to be modified. If one is set, set both.
ls_compare_vendor_on_increment gives you control over whether an
INCREMENT line will require the vendor string to match in order to pool its
licenses. If set to a non-zero value, then the string is included in the pooling
decision; if 0, then the string is not involved in pooling.
13.2.7 ls_infilter
extern LM_HANDLE * lm_job;
(int) (*ls_infilter)() = 0;
The lmremove utility could be used to bypass the license count for a feature if
an end user were to run lmremove on each user as soon as he had checked out
a license. ls_min_lmremove makes the lmremove utility ineffective for a
certain period of time after a user connects to the daemon (120 seconds by
default).
13.2.9 ls_minimum_user_timeout
(int) ls_minimum_user_timeout = 900;
/* Minimum user inactivity timeout (seconds)
This is the minimum value (in seconds) that an end user can set the feature’s
TIMEOUT value. An attempt to set a timeout less than
ls_minimum_timeout will result in the minimum value being set. If
ls_minimum_user_timeout is set to 0, then the user TIMEOUT option is
disabled.
13.2.10 ls_outfilter
(int) (*ls_outfilter)() = 0;
where:
RETURN
0 — OK, license checked out
<> 0 — Error
Note: ls_get_attr() can be used to retrieve all the parameters that ls_checkout()
requires.
13.2.11 ls_show_vendor_def
(int) ls_show_vendor_def = 0;
/* If non-zero, the vendor daemon will send...
Your client can send a vendor-defined checkout string to the daemon on each
checkout request. If ls_show_vendor_def is non-zero, this data will appear
in lc_userlist() calls, and hence, in lmstat output. If you use this vendor-
defined checkout data and wish for your users to be able to view it with
lmstat, then set ls_show_vendor_def to 1.
13.2.12 ls_user_init1
(void) (*ls_user_init1)() = 0;
13.2.14 ls_user_init3
(void) (*ls_user_init3)() = 0;
To install an initialization routine that runs after the license file is read and after
each lmreread, initialize ls_user_init3 with a pointer to your routine and
make sure an object file with this function is linked with your vendor daemon.
13.2.15 ls_vendor_msg
(char *) (*ls_vendor_msg)() = 0;
To add support for sending messages from your client code to the daemon
(with lc_vsend()), initialize ls_vendor_msg with a pointer to your routine
which processes the message and create the reply for the client.
ls_vendor_msg is called with a single parameter—the character string sent
by the client. It should create a reply message and return a pointer to it. The
message string will be unused the next time that ls_vendor_msg is called, so
the use of a single static char array in ls_vendor_msg is appropriate. Make
sure an object file with this routine is linked with your vendor daemon.
SEE ALSO
• Section 6.4.23, “lc_vsend()”
Composite Hostids
14.1 Overview
A composite hostid combines FLEXlm hostids together to provide a more
secure hostid. A composite hostid is a hashed 12-character hexidecimal value
formed by combining the values of one or more simple hostids types. It can be
used anywhere a simple hostid is used: on a SERVER line or FEATURE line
of a license file.
Incorporating a composite hostid into your license policy involves the
following actions:
• Decide which hostid types are included in your composite hostid.
• Include code in your FLEXlm-enabled application to initialize the
composite hostid.
• For served licenses, modify your vendor daemon to initialize the
composite hostid.
• Provide a way for your end user to derive the composite hostid from their
machine on which your product is installed.
• Issue licenses that specify the COMPOSITE= hostid type.
The subsequent sections below explain each of these actions in detail.
SEE ALSO
• Section 2.2, “Hostids for FLEXlm-Supported Machines”
• Section 3.2, “SERVER Lines”
• Section 3.5.10, “HOSTID”
void
main()
{
/*...*/
lc_new_job(..., &job);
/* Register the composite hostid */
ret = lc_init_simple_composite(job, hostid_list, num_ids);
if (ret != 0)
{
/* error processing */
}
/* ... */
void init_composite_hostid();
void (*ls_user_init1)() = init_composite_hostid;
3. Save and close machind\lsvendor.c.
4. Open a new file, init_composite.c, in a text editor.
void
init_composite_hostid()
{
/*...*/
/* Register the composite hostid */
ret = lc_init_simple_composite(job, hostid_list, num_ids);
if (ret != 0)
{
/* error processing */
}
/* ... */
/* Now, anytime FLEXlm refers to HOSTID_COMPOSITE,
during this job, it will be calculated based on both
HOSTID_ETHER and HOSTID_USER*/
/*...*/
}
For your convenience, this routine is provided in the SDK distribution as
examples\composite\init_composite.c.
6. Open platform\makefile in a text editor. This example uses a
Windows makefile.
• Add the vendor-defined hostid code to the list of EXECS. For this
example, add init_composite.obj.
After the $(DAEMON) section, add a section to build
init_composite.obj. For example:
init_composite.obj : $(SRCDIR)\init_composite.c
$(CC) $(CFLAGS) -I..\h $(SRCDIR)\init_composite.c
• Add init_composite.obj to the link line for $(DAEMON).
7. Rebuild your vendor daemon and distribute it to your end user.
void
main()
{
/*...*/
lc_new_job(..., &job);
/* Register the composite hostid */
ret = lc_init_simple_composite(job, hostid_list, num_ids);
if (ret != 0)
{
/* error processing */
}
/* ... */
/* Now, call lc_hostid specifying HOSTID_COMPOSITE
as the hostid type */
/*...*/
ret = lc_hostid(job, HOSTID_COMPOSITE, buf);
if (ret == 0)
{
printf(
"The FLEXlm Composite HostID of this machine is %s\n",
buf);
}
else
{
lc_get_errno(job);
}
lc_free_job(job);
exit(0);
}
where composite_hostid is a value your end user provides to you via the
lmcomposite utility described in Section 14.5, “Creating a Composite Hostid
Utility.”
SEE ALSO
• Section 3.2, “SERVER Lines”
• Section 3.5.10, “HOSTID”
15.1 Overview
You can use the FLEXible API to define your own hostid type. If you would
like to discuss whether or not vendor-defined hostids are feasible for your
application, you can contact Technical Support.
The FLEXlm SDK provides a sample C source file,
examples\vendor_hostid\vendor_hostid.c, in which a fixed vendor-
defined hostid is set up. In this section, you can use this file to run through a
procedure for setting up a vendor-defined hostid. In a real situation, you would
not use a fixed vendor-defined hostid, but would define and call a function that
returns the hostid that you want to use.
A vendor-defined hostid can be used on a SERVER or FEATURE line of a
license file.
3. View the file and find the #define statements. See lmclient.h for
HOSTID and LM_VENDOR_HOSTID definitions.
#include "lmclient.h"
#include "lm_attr.h"
#include "string.h"
/*
* x_flexlm_gethostid() - Callback to get vendor-defined hostid.
*(Sorry about all the windows types for this function...)
*/
HOSTID *
#ifdef PC
LM_CALLBACK_TYPE
#endif /* PC */
/*
* IMPORTANT NOTE: This function MUST call l_new_hostid() for
* a hostid struct on each call.
* If more than one hostid of a type is
* found, then call l_new_hostid for each
* and make into a list using the `next' field.
*/
x_flexlm_gethostid(idtype)
short idtype;
{
HOSTID *h = l_new_hostid();
memset(h, 0, sizeof(HOSTID));
if (idtype == VENDEF_ID_TYPE)
{
h->type = VENDEF_ID_TYPE;
void
x_flexlm_newid(id)
{
HOSTID *id;
LM_VENDOR_HOSTID h;
void x_flexlm_newid();
void (*ls_user_init1)() = x_flexlm_newid;
5. Open machind\lmcrypt.c in a text editor. After the call to lc_init(), add
the following line:
x_flexlm_newid();
That section of the code should resemble:
if (lc_init((LM_HANDLE *)0, VENDOR_NAME, &site_code, &lm_job))
{
lc_perror(lm_job, "lc_init failed");
exit(-1);
}
x_flexlm_newid();
x_flexlm_newid();
7. Open your client application source file in a text editor. In this example,
we are using machind\lmflex.c.
• Make the lm_job variable global by moving it before main().
VENDORCODE code;
LM_HANDLE *lm_job;
void
main()
• After the call to lc_new_job(), add the following line:
x_flexlm_newid();
That section should resemble:
if (lc_new_job(0, lc_new_job_arg2, &code, &lm_job))
{
lc_perror(lm_job, "lc_new_job failed");
exit(lc_get_errno(lm_job));
}
x_flexlm_newid();
8. Open platform\makefile in a text editor. This example uses a
Windows makefile.
• Add the vendor-defined hostid code to the list of EXECS. For this
example, add vendor_hostid.obj.
• After the $(DAEMON) section, add a section to build
vendor_hostid.obj. For example:
vendor_hostid.obj : $(SRCDIR)/vendor_hostid.c
$(CC) $(CFLAGS) -I../h $(SRCDIR)\vendor_hostid.c
• Add vendor_hostid.obj to the link line for $(DAEMON), makekey,
lmcrypt, and lmflex. For example, for lmflex.exe:
lmflex.exe: $(SRCDIR)/lmflex.c $(LMNEW_OBJ) \
$(CLIENTLIB) lmstrip.exe
$(CC) $(CFLAGS) $(SRCDIR)/lmflex.c
Debugging Hints
especially I/O or system routines which are not reentrant, but called by
FLEXlm. The only way to be certain to avoid this problem would be to disable
the automatic heartbeat mechanism and call lc_heartbeat() directly.
SEE ALSO
• Section 6.4.12, “lc_heartbeat()”
There are basically two cases involved at an end user site when more than one
software vendor installs products.
CASE 1: ALL PRODUCTS USE THE SAME LICENSE SERVER NODE(S)
In this case, there are three possible solutions:
• The end user can keep both license files separate, running one lmgrd with
a license-file list containing both files.
• The end user can keep the license files separate, running two lmgrds, one
for each license file. There are no drawbacks to this approach, because the
lmgrd processes require few system resources.
When using two separate license files, make sure the port numbers are
different, or leave them blank for FLEXlm to automatically find an open
port.
• You can combine license files by taking the set of SERVER lines from any
one license file, and add all the other lines (VENDOR, FEATURE,
INCREMENT, PACKAGE, and UPGRADE lines) from all the license
files. The combined license file can be located in the default location
(/usr/local/flexlm/licenses/license.dat on UNIX platforms
and C:\flexlm\license.dat on Windows) or in any convenient
location (with the end user using the LM_LICENSE_FILE environment
variable or license finder), or multiple copies can be located at fixed
locations as required by the various software vendors. The user should
leave a symbolic link to the original license file in the locations where each
software package expects to find its license file.
In practice, sites that have experienced system administrators often prefer to
combine license files. However, sites with relatively inexperienced users and
no system administrator usually do better leaving the files separate.
CASE 2: PRODUCTS USE DIFFERENT LICENSE SERVER NODE(S)
In this case, separate license files will be required, one for each distinct set of
license servers. The license files can then be installed in convenient locations,
and the user’s LM_LICENSE_FILE environment variable would be set as
follows.
setenv LM_LICENSE_FILE lic_path1:lic_path2:....:lic_pathn
The latest version of lmgrd will always support any FLEXlm license. The end
user has to find out which lmgrd at their site is the latest version. This can be
done using lmgrd -v to get the version. If an earlier version of lmgrd is used
than the vendor daemon, then various errors may occur, especially “Vendor
daemon can’t talk to lmgrd (invalid returned data from license server).”
17.1 Macintosh OS X
The FLEXlm SDK on Macintosh OS X is accessed from the command line.
17.2 Solaris
The default Solaris TCP port delay of four minutes may cause problems when
restarting a license server, especially a license server that is using a hard-coded
port number (for example, each of the three-server redundant servers) rather
than selecting from a set of default port numbers. If you have a problem
restarting license servers on Solaris, a root user can reset the port delay to 2.4
seconds (2400 milliseconds). As a long-term solution, we recommend that one
of the following lines be put in a boot script because the port delay is reset
every time the machine reboots:
Solaris 2.6-:
/usr/sbin/ndd -set /dev/tcp tcp_close_wait_interval 2400
Solaris 2.7+:
/usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 2400
17.4 IBM
On RS/6000, lmgrd cannot be started in /etc/rc because on that OS the
TCP/IP networking is started after /etc/rc is run. IBM has recommended
that this be performed in the /etc/inittab file. Add a line like the following
to /etc/inittab after the lines which start networking:
rclocal:2:wait:/etc/rc.local > /dev/console 2>&1
IBM changed the system call that returns the node id (uname) several times;
most recently, in AIX 3.1, the low-order decimal digit of the machine serial
number was left off. The AIX 3003 version has a corrected system call which
returns the entire serial number. This means that the hostid of your customer’s
RS/6000 system can change when they upgrade OS revisions. We know of no
workaround other than to re-issue licenses.
We believe that this condition stabilized in AIX v3.1.
On UNIX, automatic heartbeats are performed via multithreading by default on
most UNIX platforms. Applications on platforms that support pthreads must
link in the pthreads library. On AIX, this is done by appending -lpthreads
to the link line.
17.5 Linux
If you are having difficulties building the FLEXlm SDK on your Linux
platform, make sure that you have installed the correct platform-specific
FLEXlm file (we provide three):
Macrovision has seen the following three types of problems with the Linux
platform:
• Incompatible executables
Executables built and linked on Redhat v4 are not fully forward
compatible with Redhat 5 or 6. They may start to run but may later crash
with indecipherable causes.
• Incompatible object files
Object files (*.o) created on Redhat v4 or v5 and moved to a Redhat v6
system will not link correctly on Redhat v6. If all the object files are fully
linked on Redhat v5, the v5 executable will run fine on Redhat v6.
• Unexplained problems
We have customers that have reportedly not been able to build or run the
FLEXlm kit for Redhat v6 despite uname -a indicating that these
customers are using the same Redhat v6 that Macrovision uses to build
FLEXlm. In these rare cases, we have not been able to resolve the situation
and are not aware of what causes the problem.
17.6 SGI
SGI has a variety of CPUs, operating systems, and compiler switches that are
mutually incompatible. To explain, it’s useful to first understand the different
CPUs, operating systems, and switches:
OPERATING SYSTEMS
MIPS CHIPS
17.7 SCO
Part of the install_flexlm.ftp install scripts may fail on SCO systems. It
is not difficult to install without the scripts. Edit the machind/lm_code.h file
to put in the correct VENDOR_KEYs (obtained from Macrovision) and
LM_SEEDs (32-bit numbers you make up that make license files unique) and
VENDOR_NAME. Then, if it’s not an evaluation copy, in the sco_u3 directory,
edit the makefile from DAEMON = demo, replacing demo with your vendor
daemon name. Then type make in the sco_u3 directory.
Windows Platform-Specific
Notes
• Linking statically with a FLEXlm library that uses the C Runtime Library
as a DLL.
Macrovision also provides a library compiled with /MD, multithreaded,
using the C Runtime Library as a DLL, called lmgr_md.lib.
• Linking dynamically with the FLEXlm DLL (less secure)
The DLL version is called lmgr9a.dll with its associated import library
lmgr9a.lib. The lmgr9a.dll library is built using the multithreaded
statically linked C Runtime Library. Use the FLEXible API for enhanced
DLL security.
If it is necessary to use the FLEXlm DLL, please send email to
[email protected], to get suggested enhancements to improve the
security of your application.
If your application is a DLL and the FLEXlm library is linked into this DLL,
then you need to set one special attribute to allow the Windows context to be
properly set. See Section 7.3.24, “LM_A_WINDOWS_MODULE_HANDLE
(Windows only).”
Case 3: If the feature line contains the TS_OK keyword and one or more users
try to run application A from a Terminal Server Client window, the license is
checked out and the application can run. If the feature line contains the TS_OK
keyword, FLEXlm does not provide a way to limit the number of clients that
can use this node-locked license.
Counted licenses behave on a Terminal Server Client as they do on any other
machines on a network.
where:
Industry-Standard Licensing
APIs
FLEXlm offers the most widely used licensing API available—the FLEXlm
API, which is used by over 1500 software vendors worldwide. However, there
has been much effort expended in the search for a “standard” licensing API.
FLEXlm offers the vendor the choice of six standard APIs:
• FLEXlm Trivial API
• FLEXlm Simple API
• FLEXlm FLEXible API
• FLEXlm Java API
• FLEXlm Visual Basic API
• LSAPI (a proposed standard)
FLEXlm is the only licensing system available which supports all six APIs.
A.1 The FLEXlm Trivial and Simple APIs
These APIs are suitable for most applications, and are robust and easy to
implement. See Chapter 4, “Trivial API,” and Chapter 5, “Simple API,” for
complete information on these two APIs.
A.2 The FLEXlm FLEXible API
The FLEXible API has evolved since 1988, with the input of most of the major
software vendors in the UNIX software industry. The goal of the FLEXible
API is to give you your choice of licensing models in an easy to implement,
robust package. The FLEXible API is documented in Chapter 6, “FLEXible
API.”
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.
Note: You cannot mix LSAPI calls with the native FLEXlm API calls.
(LS_STR) (char)
(LS_CHALLENGE) (structure)
(LS_CHALLENGE_FLEXLM) (structure)
LS_CHALLENGE_FLEXLM *Challenge;
LM_CODE(vendor_code, ENCRYPTION_SEED1, ENCRYPTION_SEED2, 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, ...);
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 [email protected], 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.
Limitations such as string lengths are listed here. Items that are unlimited are
also listed for clarification.
B.1 FLEXlm Parameter General Information
B.1.1 Internationalization Support
FLEXlm provides internationalization support for the following parameter
categories:
• Host names
• Display names
• User names
• File names (Windows only)
• Feature and package names
• Contents of NOTICE, ISSUER, VENDOR_STRING, SN, asset_info,
dist_info, user_info, and vendor_info fields
• Comments
These parameters can contain characters in any language and any codepage,
including the UTF-8 encoding of Unicode. The only codepages that cannot be
represented are the UCS-2 encoding of Unicode and EBCDIC.
SEE ALSO
• The chapter entitled “Internationalization Support in FLEXlm” in the
FLEXlm Programmers Guide.
B.1.2 Path Name Formats
FLEXlm recognizes the following path name specifications:
• Universal naming convention (UNC) — \\server\myvendor\bin...
• MS-DOS naming convention — C:\myvendor\bin\...
• UNIX naming convention — /myvendor/bin/...
Path name support for any given FLEXlm component is limited to those
formats supported by the particular operating system on which the FLEXlm
component resides.
B.2 License File Limits
The limits on names for the major parameters employed in the FLEXlm license
file are:
LM_A_DISPLAY_OVERRIDE 32 bytes
LM_A_HOSTNAME_OVERRIDE 64 bytes
LM_A_USERNAME 20 bytes
LM_A_CHECKOUT_DATA 32 bytes
LM_A_CHECK_INTERVAL >20 seconds
The functions, attributes, variables, and features listed in this section are
obsolete but are still provided in the SDK for backward compatibility. Their
functionality has been replaced with more current features; where possible,
that current feature is noted in the tables below.
If you are implementing FLEXlm for the first time into your application, refer
to reference material elsewhere in this manual:
• Chapter 6, “FLEXible API”
• Chapter 7, “Controlling Licensing Behavior”
• Chapter 8, “Advanced FLEXible API Features”
• Chapter 13, “Vendor Daemon”
D.1 Obsolete FLEXible API Functions
The following functions are obsolete, and exist only for compatibility with
earlier FLEXlm versions. They should be used with care, and questions are
welcomed before their use.
Function Description
lc_alarm() Sets a timer.
See:
• Section 6.4.12, “lc_heartbeat()”
• Section 7.3.5, “LM_A_CHECK_INTERVAL”
lc_baddate() Detects if system date has been set back.
See:
• Section 7.3.4, “LM_A_CHECK_BADDATE”
• Section 13.2.2, “ls_a_check_baddate”
Function Description
lc_chk_conf() Validates a config structure.
See:
• Section 6.4.1, “lc_auth_data()”
lc_ck_feats() Checks the FEATURESET line for a given vendor.
FEATURESET is no longer used.
lc_copy_hostid() Returns a copy of the hostid list.
See:
• Section 6.4.13, “lc_hostid()”
lc_crypt() Computes the license key for a FEATURE line.
See:
• Section 6.4.4, “lc_cryptstr()”
lc_disalarm() Turns off a timer set with lc_alarm().
See:
• Section 6.4.12, “lc_heartbeat()”
• Section 7.3.5, “LM_A_CHECK_INTERVAL”
lc_disconn() Drops the connection to the server. This
functionality is no longer provided by FLEXlm; use
functionality provided by the native operating
system.
lc_display() Returns environment information about the current
display. This functionality is no longer provided by
FLEXlm; use functionality provided by the native
operating system.
lc_errtext() Returns the English text string corresponding to the
FLEXlm errno.
See:
• Section 6.4.19, “lc_perror()”
• Section 6.4.5, “lc_err_info()”
lc_feat_set() Computes the FEATURESET code. FEATURESET
is no longer used.
Function Description
lc_get_feats() Gets a license key from the FEATURESET line.
FEATURESET is no longer used.
lc_gethostid() Returns the hostid for the local host.
See:
• Section 6.4.13, “lc_hostid()”
lc_getid_type() Returns the HOSTID of the specified type for the
local host.
See:
• Section 6.4.13, “lc_hostid()”
• Chapter 15, “Vendor-Defined Hostid Types”
lc_hostname() Returns environment information about the current
hostname. This functionality is no longer provided
by FLEXlm; use functionality provided by the native
operating system.
lc_isadmin() Verifies the specified user is a license administrator.
This functionality is no longer provided by FLEXlm;
use functionality provided by the native operating
system.
lc_set_errno() Sets the FLEXlm errno. See:
• Section 4.4.5, “lc_err_info()”
• Section 4.4.19, “lc_perror()”
• Section 6.1.6, “lc_get_errno()”
lc_timer() Exchanges heartbeat messages with the license
server. See:
• Section 6.4.12, “lc_heartbeat()”
lc_username() Returns environment information about the current
username. This functionality is no longer provided
by FLEXlm; use functionality provided by the native
operating system.
Attribute Description
LM_A_CONN_TIMEOUT Sets the timeout for connection to a
vendor daemon.
See:
• Section 7.3.16,
“LM_A_RETRY_COUNT,
LM_A_RETRY_INTERVAL”
LM_A_LKEY_LONG Enables 64-bit license keys. License
keys are obsolete.
See:
• Section 3.5.17, “SIGN”
LM_A_LKEY_START_DATE Enables embedded start dates in
license keys. License keys are
obsolete.
See:
• Section 3.5.19, “START”
LM_A_MAX_TIMEDIFF Tests difference in clock settings
between the client and the server.
Now, automatically performed when
needed.
LM_A_SETITIMER, Controls which function is used in
LM_A_SIGNAL (UNIX Only) place of settimer().
LM_A_USE_START_DATE Enforces start date to be used in check
outs.
See:
• Section 3.5.19, “START”
Variable Description
ls_a_lkey_long Enables 64-bit license keys. License keys
are obsolete.
See:
• Section 3.5.17, “SIGN”
ls_a_lkey_start_date Enables embedded start dates in license
keys. License keys are obsolete.
See:
• Section 3.5.19, “START”
ls_enforce_startdate Enforces start date to be used in check
outs.
See:
• Section 3.5.19, “START”
ls_tell_startdate Compares start date with system date.
See:
• Section 13.2.2, “ls_a_check_baddate”
ls_use_featset Enables requirement of FEATURESET
line. FEATURESET is obsolete.
For example:
FEATURE f2 demo 1.0 permanent uncounted 6E06CC47D2AB HOSTID=1234
^^^^^^^^^^^^
license key
• Make the same changes to the lmcrypt.c and makekey.c sources in the
machind directory of your FLEXlm SDK.
• For the vendor daemon (lsvendor.c in machind directory) set:
ls_a_lkey_long = 1; /* long license keys */
ls_a_lkey_start_date = 1; /* hidden start dates */
After these changes are made, 20-character license keys with embedded dates
are generated and 12-character license keys are not generated. The start date is
determined in one of three ways:
• To use the date the license is digitally signed—use ‘0’ for the license key
field in the license line template.
Example:
FEATURE f2 demo 1.0 permanent uncounted 0 HOSTID=1234
• To specify a start date other than the date the license is signed—use
start:dd-mmm-yyy
for the license key field in the license line template.
Example:
FEATURE f2 demo 1.0 permanent uncounted start:03-jan-2003
HOSTID=1234
• To keep the date the same in an already existing license key—leave the
license key as is.
FEATURE f2 demo 1.0 permanent uncounted 6E06CC47D2AB30542134
HOSTID=1234
COMPATIBILITY ISSUES
• V6 applications (even those accepting 12-character license keys) will
accept licenses with long, 20-character license keys.
• Pre-v6 applications will not accept licenses with 12-character license keys.
• License generators (lmcrypt, makekey) issue long license keys when
verfmt is set to a version less than 6.
• LM_VER_BEHAVIOR, in machind/lm_code2.h, set to
LM_BEHAVIOR_V5_1 (or older) will set license keys to be long and start
dates in the license keys. However, this can be overridden in the code with
lc_set_attr(job, LM_A_LKEY_LONG, (LM_A_VAL_TYPE)0) and
lc_set_attr(job, LM_A_LKEY_START_DATE, (LM_A_VAL_TYPE)0),
which must be set in the application, license generator, and vendor
daemon.
Existing companies can successfully use short license keys (and may very well
want to), but must obey the following rules:
• If a site wants to use older products, then you must use -verfmt ... to
create a license with long keys. Both old and new products will accept
these licenses.
• If a site is completely converting to products using FLEXlm v6+, licenses
with short keys can be shipped.
• New customers can receive licenses with short keys.
D.4.2 FEATURESET Line
The use of FEATURESET is discouraged. The FEATURESET line is required
only if ls_use_featset is set in lsvendor.c.
FEATURESET vendor key
where:
The FEATURESET line allows the vendor to bind together the entire list of
FEATURE lines supported by one vendor daemon. If a FEATURESET line is
used, then all the FEATURE lines must be present in the same order in the
customer’s license file. This is used, for example, to insure that a customer uses
a complete update as supplied, without adding old FEATURE lines from the
vendor.
SEE ALSO
• Chapter 2, “The License File: Overview”
Note: In May 2000, Intel announced their intention to discontinue support for
CPUID.
where the #’s are uppercase hexadecimal characters. According to Intel, all 96-
bits (24 hex characters) are required to achieve a “nearly” unique hostid. It is
likely, however, that using the last 16 or 8 hex characters are very nearly
unique. Therefore, we recommend that unless absolute uniqueness is required,
the 32-bit format should normally be used so that the license file is shorter and
more readable. The 64-bit version is a compromise between the two.
The required length is determined by what’s put in the license file. So if you
want to use 96-bit CPUID, then that’s what should go in the license.
CONVERTING FROM 96-BIT TO 32-BIT
The 32-bit hostid is simply the last 9 characters from the 96-bit version.
Similarly, the 64-bit is the last 19 characters:
Length: Example:
96-bit 1B34-A0E3-8AFA-6199-9C93-2B2C
64-bit 8AFA-6199-9C93-2B2C
32-bit 9C93-2B2C
SECURITY ISSUES
Where available, the CPUID is the preferred hostid, because it is likely to be
the most secure hostid. We have taken extra precautions in the applications and
vendor daemons to make this hostid extra secure.
We do not believe that the CPUID length is important to security. We have
every reason to believe that a duplicate 32-bit or 64-bit hostid will be so rare
as to be insignificant, although only time will tell.
W
WARNING() 71
wide-area network limits 275
Windows platform notes 257
X
X-Display name 183