cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sample Code/API To Get Content Of License File Which The License Server (lmgrd/ansyslmd) Is Using

Sample Code/API To Get Content Of License File Which The License Server (lmgrd/ansyslmd) Is Using

Below is the sample code(lmflex.c) which gives the details of the license file being used by the license server

 

/******************************************************************************

Copyright (c) 1988-2008 Acresso Software Inc. All Rights Reserved
This software has been provided pursuant to a License Agreement
containing restrictions on its use. This software contains
valuable trade secrets and proprietary information of
Acresso Software Inc. and is protected by law. It may
not be copied or distributed in any form or medium, disclosed
to third parties, reverse engineered or used in any manner not
provided for in said License Agreement except with the prior
written authorization from Acresso Software Inc.

*****************************************************************************/
/*
*
* Description: This is a sample application program, to illustrate
* the use of the Flexible License Manager.
*
*/


#include <stdio.h>
#include "lmclient.h"
#include "lm_attr.h"

int
main(int argc, char * argv[])
{
VENDORCODE code;
LM_HANDLE *lm_job;
char **feats;
int i=0, ret=0;
CONFIG *pos = 0, *conf;

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));
}

lc_set_attr(lm_job, LM_A_PORT_HOST_PLUS, (LM_A_VAL_TYPE)0);
(void) lc_set_attr(lm_job, LM_A_LICENSE_DEFAULT, (LM_A_VAL_TYPE)"27000@localhost");


for (feats = lc_feat_list(lm_job, LM_FILTERLIST_ALL_FILES, NULL); feats && *feats; feats++)
{

pos = 0;
conf = 0;
while (conf = lc_next_conf(lm_job, *feats, &pos))
{
printf("\n\n Got some config information:\n");
printf("Feature: %s\n", conf->feature);
printf("\n\t\t Exp date is %s", conf->date);
printf("\n\t\t Version is %s", conf->version);
printf("\n\t\t code is %s", conf->code);
}
}

lc_free_job(lm_job);
return 0;
}

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 03, 2020 03:56 AM
Updated by:
Contributors