CmEmbedded_4c_transp 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.

information_weiss_klein26

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!

information_weiss_klein26

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.

information_weiss_klein26

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.

  • C, C++

Note

CmAccess2() provides enhanced functionality to access a CmContainer by using the hmtoggle_plus1 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

HCMSysEntry CMAPIENTRY CmAccess2(CMULONG flCtrl, CMACCESS *pcmAcc)

Parameter

 

information_weiss_klein26

Please note, that if your module configuration includes Module Runtime Bridge but without Module LAN, then the flag CM_ACCESS_LAN cannot be used and the error code CM_ERROR_FUNCTION_NOT_SUPPORTED is set.

The flag CM_ACCESS_LOCAL_LAN tries to access first the local subsystem and subsequently cannot find the LAN subsystem. Here the error code CM_ERROR_FUNCTION_NOT_SUPPORTED is set.

 

flCtrl specifies one of the following commands to set the desired subsystems. Only one of these constants can be set:

nav_open CM_ACCESS_LOCAL only searches in CmLocal for a CmContainer with a matching entry.

nav_open CM_ACCESS_LAN only searches in CmLAN for a CmContainer with a matching entry.

nav_open 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.

nav_open 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.

nav_open CM_ACCESS_LANWAN searches in CmLAN and CmWAN for a CmContainer with a matching entry.

nav_open CM_ACCESS_LOCAL_LANWAN searches CmLocal first after that in CmLAN and CmWAN for a CmContainer with a matching entry.

nav_open 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 hmtoggle_plus1 CMACCESS2).

 

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