VLSdiscover

Syntax

LS_STATUS_CODE VLSdiscover (	 	 
unsigned char	*feature_name,
unsigned char	*version,
unsigned char	*reserved1,
int	 	server_list_len,
char	 	*server_list,
int	 	optionFlag,
char	 	*vendor_list ); 	 
Argument Description

feature_name

Name of the feature.

version

Version of the feature.

reserved1

Use any value.

server_list_len

Specifies the size of server_list.

server_list (OUT)

Space separated list of License Manager names.

optionFlag

A three bit flag which guides the behavior of VLSdiscover in finding the License Managers. See the Description below for details about the possible values.

vendor_list

A tilde (~) separated list of hostNames to be queried during the search for License Managers.

Description

Retrieves the names of the computers on the local subnet (or beyond) running the Sentinel RMS License Manager which are authorized to service requests from an application.

feature_name, must be licensed by the same vendor as the library issuing the VLSdiscover call. If version is NULL, it is treated as a wildcard and all License Managers that are authorized to service requests for feature_name will respond regardless of version. If feature_name is NULL, version will be ignored and all Sentinel RMS License Managers on the local subnet will respond. The space-separated name list of the responding Sentinel RMS License Managers are returned in server_list. The buffer must be allocated prior to the call and its size provided using server_list_len.

vendor_list is a colon-separated list of host names and/or IP-addresses which are queried during the search for License Managers.

optionFlag is a three-bit flag which can have any of the following values or a combination of them:

>VLS_DISC_NO_USERLIST - By default, it first checks the LSFORCEHOST environment variable. If LSFORCEHOST doesn’t exist, it reads the list specified by the user in the vendor_list. If this option is used, the LSHOST environment variable is ignored.

>VLS_DISC_RET_ON_FIRST - If the combined query list is NULL, this function returns as soon as it contacts a License Manager and returns the name of this License Manager in server_list. Otherwise, it returns when it hears from a License Manager whose name is listed in the combined query list. In this case, it returns, in server_list, that particular License Manager name along with all other License Managers which are not on the list, but responded by that time. If this option is not specified, this function, VLSdiscover, obtains all the names of all the License Managers which responded.

>VLS_DISC_PRIORITIZED_LIST - Treats the combined query list as a prioritized one, the left-most being the highest priority host. After execution, server_list contains License Managers sorted by this priority. If this option is not specified, the combined query list is treated as a random one.

>VLS_DISC_DEFAULT_OPTIONS/VLS_DISC_NO_OPTIONS - Use these if you do not want to specify any flags. If this option is used, this function performs a broadcast to find the License Manager.

>VLS_DISC_REDUNDANT_ONLY - Expecting reply only from redundant License Managers. All non-redundant License Managers will ignore the message.

Returns

The status code LS_SUCCESS is returned if standalone library is used. Otherwise, it will return the following error codes:

Error Code

Description

VLS_NO_RESPONSE_ TO_BROADCAST

No License Managers have responded.

LS_NO_SUCCESS

Failed to retrieve computer names on local subnet.

LS_NORESOURCES

An error occurred in attempting to allocate memory needed by this function.

Examples

To get a list of all the Sentinel RMS License Managers running on the subnet, the call can be made as:

char server_list[MAX_BUF]; 

VLSdiscover(NULL, NULL, NULL, MAX_BUF, server_list,

VLS_DISC_NO_OPTIONS, NULL);

To get one License Manager having feature for all versions of application, dots:

char server_list[MAX_BUF];

VLSdiscover("DOTS", NULL, NULL, MAX_BUF, server_list,

VLS_DISC_RET_ON_FIRST,NULL);

where “DOTS” is the feature name for the application, dots.

To find out License Managers for dots version 1.0 running on the local subnet as well as on computers 'troilus.soft.net' and '123.23.234.1', and get the results in prioritized order:

char vendor_list[100];

char server_list[MAX_BUF];

strcpy(vendor_list, "troilus.soft.net:123.23.234.1");

VLSdiscover("DOTS", "1.0", NULL, MAX_BUF, server_list,

VLS_DISC_PRIORITIZED_LIST, vendor_list);