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

How to use Flexible API to determine if a FEATURE supports BORROW

How to use Flexible API to determine if a FEATURE supports BORROW

Below is a way to check a certificate license file for the "BORROW" keyword on a FEATURE line

 

The variable maxborrowhours in structure * borrow_feat_Info.c  

#define FEATURE "f1"
VENDORCODE code;
LM_HANDLE *lm_job;
static void init(struct flexinit_property_handle **);
static void cleanup(struct flexinit_property_handle *);

void
vendor_daemon_info(LM_HANDLE *job, char *feature)
{
	CONFIG *conf, *c = 0;
	LM_VD_GENERIC_INFO gi;
	LM_VD_FEATURE_INFO fi;
	int first = 1;

	for (conf = lc_next_conf(job, feature, &c); conf;
		conf = lc_next_conf(job, feature, &c))
	{
		fi.feat = conf;
		if (lc_get_attr(job, LM_A_VD_FEATURE_INFO, (short *)&fi))
		{
			lc_perror(job, "LM_A_VD_FEATURE_INFO");
		}
		else
		{
			printf("\nfeature %s\n", conf->feature);
			printf("code %s\n", conf->code);
			printf("rev %d\n", fi.rev);
			printf("borrowmaxhours %d\n", fi.maxborrowhours);
		}
	}
}

 

  • LM_VD_FEATURE_INFO will update the useful information. It updates for how long the feature can be borrowed.
  • The variable only gets populated for borrowed features.
  • Variable maxborrowhours is directly linked to BORROW keyword in the FEATURE line. The variable will only be populated if BORROW keyword has been mentioned in the FEATURE line for that feature. Otherwise, the value will be 0.

  • For exp: -

    • (With BORROW) For INCREMENT line : FEATURE f1 flexera 1.0 permanent 4 BORROW SIGN= the value of maxborrowhours will be 168, for feature f1 .
    • (Without BORROW) For INCREMENT line : FEATURE f1 flexera 1.0 permanent 4 SIGN= the value of maxborrowhours will be 0, for feature f1 .
  • Usage-Your application can show/hide a borrow option based on the license feature can be borrowed or not. If it can be borrowed, then this is where you can let the client set the borrow information. 
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Aug 26, 2021 02:49 AM
Updated by:
Contributors