cancel
Showing results for 
Search instead for 
Did you mean: 

Steps to configure a combined Vendor Defined HostID and Composite HostID on Windows

Steps to configure a combined Vendor Defined HostID and Composite HostID on Windows

Building a Vendor Defined HostID:

1. Copy the file examples/vendor_hostid/vendor_hostid.c to your machind directory.

2. In machind directory, update lsvendor.c as follows:

2.1. After the comment /* Vendor initialization routines */ Add the following line:

void x_flexlm_newid();

2.2. update the line void (*ls_user_init1)() = 0 to void (*ls_user_init1)() = x_flexlm_newid;

3. In machind directory, update lmcrypt.c as follows:

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

4. In machind directory, update lmflex.c as follows:

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

5. In the platform directory, update makefile as follows:

5.1. In EXECS list add vendor_hostid.obj i.e. the list should look like

EXECS = vendor_hostid.obj lmflex.exe lmcrypt.exe lmsign.lib installs.exe

5.2. Add vendor_hostid.obj to the following sections as shown below:

$(DAEMON): $(XTRAOBJS) $(DAEMONLIBS) lsvendor.obj $(SRCDIR)\lsserver.h $(LMNEW_OBJ)
$(RC) -r -fo $(VENDORNAME).res $(VENDORNAME).rc
$(LD) /subsystem:console /out:$(DAEMON) lsvendor.obj $(LMNEW_OBJ) vendor_hostid.obj \
$(XTRAOBJS) $(DAEMONLIBS) $(CRT_LIB) $(XTRALIB1) $(VENDORNAME).res
$(PREPTOOL) -v $(APREPXMLDIR)\vendor_daemon.xml

lmcrypt.exe: $(SRCDIR)\lmcrypt.c \
$(SRCDIR)\lmclient.h $(SRCDIR)\lm_code.h $(STATIC_CLIENTLIB)
$(CC) $(CFLAGS) $(SRCDIR)\lmcrypt.c
$(LD) /out:lmcrypt.exe lmcrypt.obj vendor_hostid.obj $(STATIC_CLIENTLIB) $(XTRALIB) $(ACTSTUB)
$(EMBED_MANIFEST)

lmflex.exe: $(SRCDIR)\lmflex.c $(LMNEW_OBJ_CLIENT) \
$(CLIENTLIB)
$(CC) $(CFLAGS) $(SRCDIR)\lmflex.c
$(LD) /out:lmflex.exe lmflex.obj vendor_hostid.obj $(LMNEW_OBJ_CLIENT) $(CLIENTLIB) $(XTRALIB) $(ACTSTUB)
$(EMBED_MANIFEST)
if exist lmflex.obj del lmflex.obj

5.3. Add the following after '$(DAEMON); section:

vendor_hostid.obj: $(SRCDIR)/vendor_hostid.c
$(CC) $(CFLAGS) -I../h $(SRCDIR)\vendor_hostid.c

6. Build the toolkit: nmake -f makefile

Adding a Composite HostID to the build:

1. Copy the files lmcomposite.c and init_composite.c from examples\composite directory to your machind directory.

2. In machind directory, update lsvendor.c as follows:

2.1. After the comment /* Vendor initialization routines */ Add the following line: void init_composite_hostid();

2.2. Update the line void (*ls_user_init1)() = 0 to void (*ls_user_init2)() = init_composite_hostid;

3. In machind directory, update lmflex.c as follows:

3.1. In main function after the declaration int nlic=1; add the following declarartions:

int ret;
int hostid_list[] = {HOSTID_ETHER, HOSTID_DISK_SERIAL_NUM};
int hostid_list_count = 2;
int errno;

3.2. In main function, after the following piece of code

if (lc_new_job(0, lc_new_job_arg2, &code, &lm_job))
{
lc_perror(lm_job, "lc_new_job failed");
cleanup(initHandle);
exit(lc_get_errno(lm_job));
}

Add the following code:

ret = lc_init_simple_composite(lm_job, hostid_list, hostid_list_count);
if (ret != 0)
{
printf("Failed to init composite hostid. Errno: %d\n", errno);
lc_free_job(lm_job);
exit(0);
}

4. In the platform directory, update makefile as follows:

4.1. In EXECS list add lmcomposite.exe init_composite.obj i.e. the list should look like:

EXECS = vendor_hostid.obj lmcomposite.exe init_composite.obj lmflex.exe lmcrypt.exe lmsign.lib installs.exe

4.2. Add init_composite.obj to the following sections as shown below:

$(DAEMON): $(XTRAOBJS) $(DAEMONLIBS) lsvendor.obj $(SRCDIR)\lsserver.h $(LMNEW_OBJ)
$(RC) -r -fo $(VENDORNAME).res $(VENDORNAME).rc
$(LD) /subsystem:console /out:$(DAEMON) lsvendor.obj $(LMNEW_OBJ) vendor_hostid.obj init_composite.obj \
$(XTRAOBJS) $(DAEMONLIBS) $(CRT_LIB) $(XTRALIB1) $(VENDORNAME).res
$(PREPTOOL) -v $(APREPXMLDIR)\vendor_daemon.xml

5. Add the following after '$(DAEMON); section:

init_composite.obj : $(SRCDIR)\init_composite.c
$(CC) $(CFLAGS) -I..\h $(SRCDIR)\init_composite.c

6. Before the definition of lmflex, add the following lines of code:

lmcomposite.exe: $(SRCDIR)\lmcomposite.c $(LMNEW_OBJ) \
$(CLIENTLIB)
$(CC) $(CFLAGS) $(SRCDIR)\lmcomposite.c
$(LD) /out:lmcomposite.exe lmcomposite.obj $(LMNEW_OBJ_CLIENT) $(CLIENTLIB) $(ACTSTUB) $(XTRALIB)
$(EMBED_MANIFEST)
if exist lmcomposite.obj del lmcomposite.obj

7. Build the toolkit: nmake -f makefile

 

Was this article helpful? Yes No
No ratings