CmAccess2
Description
CmAccess() opens the access to a:
•computer (SubSystem Access)
•CmContainer (Box Access)
•single Firm Item (FC, Firm Item Access) or a
•CmContainer entry (FC:PC, Entry Access) in a given subsystem.
Please note the detailed description of the Access Modes.
|
Please note that CmAccess2() provides enhanced functionality to access a CmContainer. This function is implemented since CodeMeter Version 3.30. |
A SubSystem Access represents a superset of Box Access. A Box Access is a superset of Firm Item Access. A Firm Item Access is a superset of an Entry Access. Anything that can be done with a SubSystem Access can also be done with Box Access, but not vice versa!
|
Please note that on a Box Access the mask m and serial number s may change anytime depending on CodeMeter chip versions. Please consider these possible changes for future CmContainer generations on programming accesses for CmContainer. |
The subsystem is the local computer (CmLocal) or a local or wide area network system (CmLAN, CmWAN). For CmWAN please consult the CodeMeter Developer Guide. This implies that a CodeMeter License Server process must be started with a CmContainer connected on an other system in the network.
The communication between protected applications and CodeMeter License Server bases on the Transmission Control Protocol/Internet Protocol (TCP/IP). This is valid not only for locally existing licenses, but also for licenses which are provided via a network.
By default, CodeMeter uses the port 22350 registered by Wibu-Systems at IANA (Internet Assigned Numbers Authority) and uniquely assigned for the CodeMeter communication. The list of assigned ports can be viewed at www.iana.org/assignments/port-numbers.
In order to make available a client access to a CodeMeter License Server on the network, a communication using the CodeMeter port must be supported. If the server should locate in another network area, eventually the port must be made known and accessible as part of the infrastructure (router, firewall, etc.).
For the direct access to CodeMeter License Server on the network, the communication bases on TCP. For an automatic search of servers on the network, additionally a broadcast via UDP (User Datagram Protocol) is performed.
|
The access using the CodeMeter port is performed only for the access to CodeMeter License Servers and this only within the organization which runs the network server. In particular, using this port no communication into the internet is performed. |
In CodeMeter settings of CodeMeter WebAdmin an option exist to configure the CodeMeter port to a value other than the default of 22350. However, such a change should have plausible reasons, e.g. in the case of parallel test environments on the same network. In addition, such a change requires the same configuration of all affected CodeMeter License Servers.
The desired subsystem and the search order can be set in the special flags.
If a network access to another computer is performed, it will be available until the access is closed with CmRelease(). If more than one connection between two instances should be required, CmAccess() will open only one connection which is the medium for all communication between the two clients.
|
Triple Mode Redundancy-related information (TMR)
|
Note
CmAccess2() provides enhanced functionality to access a CmContainer by using the
CMCREDENTIAL feature.
|
CMCREDENTIAL holds parameters that can be used for a CmAccess2() call to refine the license allocation and the assignment to the CodeMeter License Server, for example, via an arbitrary user name. Syntax
Parameter mulPID contains the process ID that is set by the CodeMeter library (read only). mulSession is always zero on the user site. mulCleanupTime this parameter overwrites the CleanupTime profiling value for license releasing in minutes. mulMaxLifeTime defines the maximum lifetime (in minutes) of the license that is allocated. mulCreationTime holds the creation time of the license that was accessed in seconds since 01.01.2000. mulAccessCtrl holds the type of access (since 4.20): The first group of flags hold information about local or Lan access:
The second group defines the access type:
mulExpirationTime the expiration time of a borrowed entry or the regular expiration time otherwise. mulUserDefinedID contains the user defined ID. mszUserDefinedText contains a user defined text (UTF-8 encoded). mszUsername holds an arbitrary user name (read only).
mulOtherBorrowFirmCode contains the Firm Code of the borrow partner. mulOtherBorrowProductCode contains the Product Code of the borrow partner. mulOtherBorrowFeatureMap contains the Feature Map of the borrow partner. mulOtherBorrowSerial contains the serial number of the borrow partner. musOtherBorrowMask contains the serial mask of the borrow partner. mbLibType contains information on the WibuCm client library type set by the client library itself. The following types exist:
mbCompatibilitySession contains for station share compatibility reasons additionally the transferred value for accesses by CodeMeter versions up to 7.10. mulCurrentCmInstanceUid actual unique ID used to discriminate client computers for station share accesses. mulPreviousCmInstanceUid unique ID used to discriminate the previous access by client computers for station share accesses. mszDomainName contains the domain name (read only). mulLibVersion contains information on the version (Major, Minor, Build) of mbLibType set by the client library itself.
|
It is available since CodeMeter Version 3.30 and offers a user-defined timing to release licenses that were allocated locally or in the network.
This release interval overwrites the default timing value CleanUpTimeOut of the CodeMeter profiling. The benefit is that the user cannot influence this timing anymore.
Additionally, the validity period of the handle returned by CmAccess2() can be determined. This feature can be used to limit the usage period of an application that allocates a license using CmAccess2().
The mapping of the licenses on a CodeMeter server can be simplified by giving an user-defined string or number (session-ID) that is displayed on the server once the license was allocated.
Syntax
HCMSysEntry CMAPIENTRY CmAccess2(CMULONG flCtrl, CMACCESS *pcmAcc)
Parameter
flCtrl specifies one of the following commands to set the desired subsystems. Only one of these constants can be set:
CM_ACCESS_LOCAL only searches in CmLocal for a CmContainer with a matching entry.
CM_ACCESS_LAN only searches in CmLAN for a CmContainer with a matching entry.
CM_ACCESS_LOCAL_LAN searches CmLocal first for a CmContainer with a matching entry and after that in CmLAN, if no CmContainer was found locally.
CM_ACCESS_LAN_LOCAL searches CmLAN first for a CmContainer with a matching entry and after that in CmLocal, if no CmContainer was found in the network.
CM_ACCESS_LANWAN searches in CmLAN and CmWAN for a CmContainer with a matching entry.
CM_ACCESS_LOCAL_LANWAN searches CmLocal first after that in CmLAN and CmWAN for a CmContainer with a matching entry.
CM_ACCESS_LANWAN_LOCAL searches first in CmLAN and CmWAN and after that in CmLocal for a CmContainer with a matching entry.
pcmAcc sets the needed data for the desired access (see structure
CMACCESS2).
|
CMACCESS2 specifies additional data for the Access Modes to a computer (Subsystem Access), to a CmContainer (Box Access), to a single Firm Item (FC, Firm Item Access) or a CmContainer entry (FC:PC, Entry Access) in a given subsystem. Syntax
Parameter mflCtrl specifies the kind of the subsystem access by setting one of the following flags.
These flags can be or'ed with the following flags:
mulFirmCode contains the Firm Code of the access mode. Which Firm Code must be set for the different access modes you can see at the description of the CmAccess2 () function mulProductCode contains the Product Code of the access mode. Which Product Code must be set for the different access modes you can see at the description of the CmAccess2 () function mulFeatureCode contains the Feature Code, which must map a given Feature Map. If the Feature Code is 0, there is no search for a matching Feature Map. mulUsedRuntimeVersion contains the minimum runtime version of CodeMeter. To calculate the version you may want to use the macro (see
mulReserved1 is reserved for future purposes. musProductItemReference Product Item Reference of the Product Item to access. mulReserved2 is reserved for future purposes. mbMinBoxMajorVersion contains the minimum major Firmware version of the CmContainer to access. mbMinBoxMinorVersion contains the minimum minor Firmware version of the CmContainer to access. musBoxMask contains the box mask of the CmContainer to access. mulSerialNumber contains the serial number of the CmContainer to access. mulLicenseQuantity contains the requested number of licenses to be allocated using a single handle.
mulReserved4 is reserved for future purposes. mszServername contains the name or IP-address of the CodeMeter server to access. The type is detected automatically. mcmReleaseDate contains a structure where the Release Date can be set that is checked against the Maintenance Period of the license (see
mabCmActId allows to specify a CmAct-ID using the following ranges: 1**** for CmDongle, 2****for CmActLicense, 3**** for CmCloud.
mabReserved is reserved for future purposes. mcmBorrowData contains a
mcmCredential contains a
|
Return
The handle to the desired CmContainer entry or CmContainer in the desired subsystem is returned. If no matching CmContainer entry or CmContainer is found, NULL is returned.
Notes
Access to Firm Item 0 can only be performed locally. If tried using CmLAN, CmAccess2 will trigger Error 200 (Entry not found).
CmAccess2() is supported since CodeMeter Version 3.30.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 5.0:
•CM_ACCESS_LANWAN
•CM_ACCESS_LOCAL_LANWAN
•CM_ACCESS_LANWAN_LOCAL
Note
CmAccess2() provides enhanced functionality to access a CmContainer by using the
CmCredential feature.
|
It is available since CodeMeter Version 3.30 and offers a user-defined timing to release licenses that were allocated locally or in the network.
This release interval overwrites the default timing value CleanUpTimeOut of the CodeMeter profiling. The benefit is that the user cannot influence this timing anymore.
Additionally, the validity period of the handle returned by CmAccess2() can be determined. This feature can be used to limit the usage period of an application that allocates a license using CmAccess2().
The mapping of the licenses on a CodeMeter server can be simplified by giving an user-defined string or number (session-ID) that is displayed on the server once the license was allocated.
Syntax
public HCMSysEntry CmAccess2(CmAccessOption Ctrl, CmAccess Acc)
Parameter
CmAccessOption Ctrl specifies one of the following commands to set the desired subsystems. Only one of these constants can be set.
Local only searches in CmLocal for a CmContainer with a matching entry.
Lan only searches in CmLAN for a CmContainer with a matching entry.
LocalLan searches CmLocal first for a CmContainer with a matching entry and after that in CmLAN, if no CmContainer was found locally.
LanLocal searches CmLAN first for a CmContainer with a matching entry and after that in CmLocal, if no CmContainer was found in the network.
LanWan searches in CmLAN and CmWAN for a CmContainer with a matching entry.
LocalLanWan searches CmLocal first after that in CmLAN and CmWAN for a CmContainer with a matching entry.
LanWanLocal searches first in CmLAN and CmWAN and after that in CmLocal for a CmContainer with a matching entry.
Acc sets the needed data for the desired access (see the public class
CmAccess2).
|
The class CmAccess2 specifies additional data for the Access Modes to a computer (Subsystem Access), to a CmContainer (Box Access), to a single Firm Item (FC, Firm Item Access) or a CmContainer entry (FC:PC, Entry Access) in a given subsystem. Syntax
Parameter CmAccess.Option specifies the kind of the subsystem access by setting one of the following flags).
These flags can be or'ed with the following flags:
FirmCode contains the Firm Code of the access mode. Which Firm Code must be set for the different access modes you can see at the description of the CmAccess2 () function ProductCode contains the Product Code of the access mode. Which Product Code must be set for the different access modes you can see at the description of the CmAccess2 () function FeatureCode contains the Feature Code, which must map a given Feature Map. If the Feature Code is 0, there is no search for a matching Feature Map. UsedRuntimeVersion contains the minimum runtime version of CodeMeter. ProductItemReference Product Item Reference of the Product Item to access. MinBoxMajorVersion contains the minimum major Firmware version of the CmContainer to access. MinBoxMinorVersion contains the minimum minor Firmware version of the CmContainer to access. BoxMask contains the box mask of the CmContainer to access. SerialNumber contains the serial number of the CmContainer to access. LicenseQuantity contains the requested number of licenses to be allocated using a single handle.
Servername contains the name or IP-address of the CodeMeter server to access. The type is detected automatically. May contain up to 128 characters. ReleaseDate contains a structure where the Release Date can be set that is checked against the Maintenance Period of the license (see class
Borrow refers to public class For easy access to borrowing functionality please refer to CmBorrow().
Credential contains a
|
Return
The handle to the desire CmContainer entry or CmContainer in the desired subsystem is returned. If no matching CmContainer entry or CmContainer is found, NULL is returned.
Notes
Access to Firm Item 0 can only be performed locally.
CmAccess2() is supported since CodeMeter Version 3.30.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 5.0:
•LanWan
•LocalLanWan
•LanWanLocal
Starting with CodeMeter Version 5.0 the subsystem wide area network (CmWAN) is supported. To connect to a CmWAN server the https-address of the CmWAN server together with user name and password must be either defined in the server search list or directly in Servername of the CmAccess2 class. The desired subsystem and the search order can be set in CmAccessOption flag.
Note
CmAccess2() provides enhanced functionality to access a CmContainer by using the
cmapi.CMCREDENTIAL feature.
|
cmapi.CMCREDENTIAL holds parameters that can be used for a CmAccess2() call to refine the license allocation and the assignment to the CodeMeter License Server, for example, via an arbitrary user name. Syntax
Parameter mulPID contains the process ID that is set by the CodeMeter library (read only). mulSession is always zero on the user site. mulCleanupTime this parameter overwrites the CleanupTime profiling value for license releasing in minutes. mulMaxLifeTime defines the maximum lifetime (in minutes) of the license that is allocated. mulCreationTime holds the creation time of the license that was accessed in seconds since 01.01.2000. mulAccessCtrl holds the type of access (since 4.20): The first group of flags hold information about local or Lan access:
The second group defines the access type:
mulExpirationTime the expiration time of a borrowed entry or the regular expiration time otherwise. mulUserDefinedID contains the user defined ID. mszUserDefinedText contains a user defined text (UTF-8 encoded). To assign this field a valid value, DO NOT set it directly, call instead the set_mszUserDefinedText() with the desired string as parameter. To retrieve the content of this field, DO NOT use it directly, call instead the get_mszUserDefinedText(). mszUsername holds an arbitrary user name (read only). To retrieve the content of this field, DO NOT use it directly, call instead the get_mszUsername().
mulOtherBorrowFirmCode contains the Firm Code of the borrow partner. mulOtherBorrowProductCode contains the Product Code of the borrow partner. mulOtherBorrowFeatureMap contains the Feature Map of the borrow partner. mulOtherBorrowSerial contains the serial number of the borrow partner. musOtherBorrowMask contains the serial mask of the borrow partner. mbLibType contains information on the WibuCm client library type set by the client library itself. The following types exist:
mbCompatibilitySession contains for station share compatibility reasons additionally the transferred value for accesses by CodeMeter versions up to 7.10. mulCurrentCmInstanceUid actual unique ID used to discriminate client computers for station share accesses. mulPreviousCmInstanceUid unique ID used to discriminate the previous access by client computers for station share accesses. mszDomainName contains the domain name (read only). To retrieve the content of this field, DO NOT use it directly, call instead the get_mszDomainName(). mulLibVersion contains information on the version (Major, Minor, Build) of mbLibType set by the client library itself.
|
It is available since CodeMeter Version 3.30 and offers a user-defined timing to release licenses that were allocated locally or in the network.
This release interval overwrites the default timing value CleanUpTimeOut of the CodeMeter profiling. The benefit is that the user cannot influence this timing anymore.
Additionally, the validity period of the handle returned by CmAccess2() can be determined. This feature can be used to limit the usage period of an application that allocates a license using CmAccess2().
The mapping of the licenses on a CodeMeter server can be simplified by giving an user-defined string or number (session-ID) that is displayed on the server once the license was allocated.
Syntax
import cmapi
cmapi.CodeMeter().CmAccess2(flCtrl: int, pcmAcc: CMACCESS2) -> ApiHandle
throws HandleAccessFailedException()
Parameter
flCtrl specifies one of the following commands to set the desired subsystems. Only one of these constants can be set:
cmapi.CM_ACCESS_LOCAL only searches in CmLocal for a CmContainer with a matching entry.
cmapi.CM_ACCESS_LAN only searches in CmLAN for a CmContainer with a matching entry.
cmapi.CM_ACCESS_LOCAL_LAN searches CmLocal first for a CmContainer with a matching entry and after that in CmLAN, if no CmContainer was found locally.
cmapi.CM_ACCESS_LAN_LOCAL searches CmLAN first for a CmContainer with a matching entry and after that in CmLocal, if no CmContainer was found in the network.
cmapi.CM_ACCESS_LANWAN searches in CmLAN and CmWAN for a CmContainer with a matching entry.
cmapi.CM_ACCESS_LOCAL_LANWAN searches CmLocal first after that in CmLAN and CmWAN for a CmContainer with a matching entry.
vCM_ACCESS_LANWAN_LOCAL searches first in CmLAN and CmWAN and after that in CmLocal for a CmContainer with a matching entry.
pcmAcc sets the needed data for the desired access (see class
cmapi.CMACCESS2).
|
CMACCESS2 specifies additional data for the Access Modes to a computer (Subsystem Access), to a CmContainer (Box Access), to a single Firm Item (FC, Firm Item Access) or a CmContainer entry (FC:PC, Entry Access) in a given subsystem. Syntax
Parameter mflCtrl:specifies the kind of the subsystem access by setting one of the following flags.
These flags can be or'ed with the following flags:
mulFirmCode contains the Firm Code of the access mode. Which Firm Code must be set for the different access modes you can see at the description of the CmAccess2 () function mulProductCode contains the Product Code of the access mode. Which Product Code must be set for the different access modes you can see at the description of the CmAccess2 () function mulFeatureCode contains the Feature Code, which must map a given Feature Map. If the Feature Code is 0, there is no search for a matching Feature Map. mulUsedRuntimeVersion contains the minimum runtime version of CodeMeter. mulReserved1 is reserved for future purposes. musProductItemReference Product Item Reference of the Product Item to access. mulReserved2 is reserved for future purposes. mbMinBoxMajorVersion contains the minimum major Firmware version of the CmContainer to access. mbMinBoxMinorVersion contains the minimum minor Firmware version of the CmContainer to access. musBoxMask contains the box mask of the CmContainer to access. mulSerialNumber contains the serial number of the CmContainer to access. mulLicenseQuantity contains the requested number of licenses to be allocated using a single handle.
mulReserved4 is reserved for future purposes. mszServername contains the name or IP-address of the CodeMeter server to access. The type is detected automatically. To assign this field a valid value, DO NOT set it directly, call instead the set_mszServername() with the desired string as parameter. To retrieve the content of this field, DO NOT use it directly, call instead the get_mszServerName(). mcmReleaseDate contains a structure where the Release Date can be set that is checked against the Maintenance Period of the license (see
mabCmActId allows to specify a CmAct-ID using the following ranges: 1**** for CmDongle, 2****for CmActLicense, 3**** for CmCloud.
mabReserved is reserved for future purposes. mcmBorrowData contains a
mcmCredential contains a
|
Return
The handle to the desired CmContainer entry or CmContainer in the desired subsystem is returned. If no matching CmContainer entry or CmContainer is found, an exception is thrown.
Notes
Access to Firm Item 0 can only be performed locally. If tried using CmLAN, CmAccess2 will trigger Error 200 (Entry not found).
CmAccess2() is supported since CodeMeter Version 3.30.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 5.0:
•cmapi.CM_ACCESS_LANWAN
•cmapi.CM_ACCESS_LOCAL_LANWAN
•cmapi.CM_ACCESS_LANWAN_LOCAL
CmAccessSubSystem is is a fast track to obtain a subsystem type handle.
Syntax
import cmapi
cmapi.CodeMeterLite().CmAccessSubSystem() -> ApiHandle
throws CodeMeterApiFailedException()
Parameter
No parameters needed.
Return
An handle valid for all operations to which a subsystem handle is sufficient. If an error occurs, a CodeMeterApiFailedException is thrown.
CmEntryAccess is a fast track to obtain an entry type handle.
Syntax
import cmapi
cmapi.CodeMeterLite().CmEntryAccess(FirmCode: int, ProductCode: int) -> ApiHandle
throws CodeMeterApiFailedException()
Parameter
FirmCode contains the Firm Code of the access mode. Which Firm Code must be set for the differ-ent access modes you can see at the description of the CmAccess2 () function.
ProductCode contains the Product Code of the access mode. Which Product Code must be set for the different access modes you can see at the description of the CmAccess2 () function.
Return
An handle valid for all operations to which an entryhandle is sufficient. If an error occurs, a CodeMeterApiFailedException is thrown.