Chapter 9. Software Vendor Utility Programs

The create_license Utility

The FLEXlm distribution kit includes the create_license utility program used for the creation of license files.

create_license is a stand-alone license file generator. create_license can be used “as-is” to generate license files for your customers, or it can be used as an example for you to create your own customized license file generation program. If customizing, note that the essential function call is lc_crypt(), which returns the 20-character license key for each FEATURE line.

create_license asks a number of questions, then generates the license file for the specific end-user.

create_license allows you to enter all the data for a customer's license file from scratch, or use an existing customer license file to update the feature lines.

The license file is left in the current directory with the name license.dat.

Prior to FLEXlm v2.3, create_license generated all license files with TCP/IP port numbers of 1700. After FLEXlm v2.3, create_license generates a default TCP/IP port number based on the first two characters of the vendor daemon name. This was done to avoid all license files having 1700 as the port number at end-user sites. If you use the new default, the chances of colliding with another FLEXlm vendor's port number will be minimal.

For Windows and Windows NT systems, the file name of the create_license utility is actually CREATE_L.EXE in the utils directory.

The following are examples of license creation sessions.

Example

The creation of a customer license file from scratch:

speedy $ create_license

create_license - 
COPYRIGHT (c) 1988, 1994 Globetrotter Software Inc.

Do you want to use an existing file for SERVER and DAEMON lines [y/n] ? n

Please enter the name of the server node where you
would like to run the FLEXlm daemons.

NOTE: The server node name(s) and TCP/IP port nubmers
      can be changed by the end-user of your product.

Enter hostname: speedy
Enter the hostid: 08002b32b161
Enter the TCP/IP port number [7182]: <CR>

Enter DAEMON "demo" path: /etc/demo

You will be prompted for feature names.
 When the list is complete, just type <CR> to the Feature name prompt.
 To get the default answer to any question, type a <CR>.
To re-start specifying the feature, just type "-" to any of the prompts.

Feature name: f1
FEATURE/INCREMENT/UPGRADE line? [f/i/u, default: f]: <CR>
Version of f1 [default 1.0]: 2.0
Number of licenses [default: 4]: 7
Number of OVERDRAFT licenses [default: 0]: 
Duplicate grouping parameter [NONE, SITE, [UHDV], default: not specified]: <CR>
Intellectual Property Notice [default: ""]: <CR>
Expiration date [dd-mmm-yyyy, default: 1-jan-95]: 1-jan-0
Start date [dd-mmm-yyyy, default: 1-jan-94]: <CR>
Your vendor-defined string: my data goes here
Host id (if locking to a single host): <CR>


Feature name: 
speedy $ cat license.dat
SERVER speedy 08002b32b161 7182
DAEMON demo /etc/demo 
FEATURE f1 demo 2.000 1-jan-0 7 0BEC00313F2D7686F580 \
         VENDOR_STRING="my data goes here" ck=230

#NOTE: You can edit the hostname on the server line (1st arg),
#      the port address on the server line (3rd arg), the path
#      to the daemon on the daemon line (2nd arg), or any
#      right-half of a string (b) of the form a=b where (a) is all
#      lowercase. (For example, xxx in  vendor_info="xxx" can be
#      changed).  Any other changes will invalidate this license.

isvaliddate

Usage:

isvaliddate date

The isvaliddate program will check the date which is provided on the command line. isvaliddate will parse the date and return an exit status as follows:

no date  

-1

invalid day  

LM_BADDATE (-11)

invalid month  

LM_BADDATE (-11)

invalid year  

LM_BADDATE (-11)

expired date  

LM_LONGGONE (-10)

binary date invalid  


LM_DATE_TOOBIG (-49)

See also

lmcrypter

lmcrypter is a new way to generate license files that has a number of advantages over create_license. lmcrypter takes an existing license file where the 20-character codes have been replaced with a single `0' (zero) character, and then replaces the `0' with the correct code, which is then shippable to a customer. If -f arg is used, then all license keys will be recomputed, including lines with license keys already set.

Usage:

lmcrypter [ files ][-i infile] [-o outfile] [-r] -f
-r  Print copyright notice.

If no input file, or if specified as - or stdin, stdin is used. If no output file, or if specified as - or stdout, stdout is used. files are read and written back in place. If no arguments, lmcrypter reads stdin and writes stdout. -f forces recomputing ALL license keys. Start dates are unchanged.

The simplest way to use lmcrypter is:

  • copy an existing good file to a another name, say temp.

  • edit temp, and make any desired changes, such as changing the feature name, or number of uses, or adding new features, etc.

  • change each 20-character code to a single `0' (zero), and save the file.

  • type

    % lmcrypter < temp > newlicense
    

    newlicense is then filled with correct 20-character codes and is usable by a customer.

lmcrypter understands all FLEXlm license syntax. Comments are passed through unaltered.

If you want to specify a start-date, then, in place of a `0' in the 20-character code, use the following syntax:

start:dd-mmm-yyy

Example:

start:1-jan-95

See lmcrypter.c in the /lmgr/machind directory.

Error Returns

Errors are printed to stderr. Most errors will prevent generation of license keys, and the text will be output unchanged from the input. An example of error reporting

Input:

FEATURE f1 demo 1.a50 01-jan-99 0 0 HOSTID=08002b32b161

Error reported:

stdin:line 1:Bad version number - must be floating point number, with no letters

create_pkg

The create_pkg utility is similar to create_license, and is used to make PACKAGE lines for license files. The reason this utility is separate from create_license is that vendors will often want to ship PACKAGE lines with their product, and issue enabling FEATURE or INCREMENT lines later when the product is sold to individual customers.

The source for create_pkg, create_pkg.c, is in the machind directory, and vendors are encouraged to modify this source as needed.


Note: PACKAGE lines can also be created with the new lmcrypter utility, but not with create_license.


lmfeatset

The lmfeatset program is used by vendors that wish to support the FEATURESET capability in their vendor daemon. lmfeatset prints the FEATURESET line to be used in a license file. Usage is:

lmfeatset [-c license_file] vendor

The lmfeatset program uses the default license file to calculate the FEATURESET line if no “-c” option is present.