Using the additional API for clients (subscr.h)
The API allows clients to receive notifications about the publishing and unpublishing of endpoint groups. From the client perspective, a group of endpoints is a set of endpoints on one server for which clients can use a single DCM handle to receive notifications about the publishing and unpublishing of those endpoints. However, there is a restriction that prevents a server from providing multiple endpoints with one interface. Multiple servers may provide identical groups of endpoints required by a client. A server may provide multiple groups of endpoints required by a client. A set of endpoints from different groups required by a client may overlap.
Information about API functions is provided in the table below.
To create a DCM handle that enables receipt of notifications about the publishing and unpublishing of endpoints with specific interfaces, call the DcmSetGroupSubscription()
function. Use the endpointTypes
parameter to define the names of interfaces of grouped endpoints. In the endpointsCount
parameter, specify a number of grouped endpoints equal to the number of interfaces defined via the endpointTypes
parameter. (Notifications will contain a number of endpoints equal to the number of interfaces because of the restriction dictating that one separate endpoint corresponds to each interface.)
To extract a notification about the publishing or unpublishing of an endpoint group from the notification queue, call the DcmReadGroupPubQueue()
function. In the subscrHandle
parameter of the DcmReadGroupPubQueue()
function, specify the DCM handle that was obtained by calling the DcmSetGroupSubscription()
function. In the maxCount
parameter of the DcmReadGroupPubQueue()
function, specify the number of elements in the array defined via the outEndpoints
parameter. The value of this parameter must be greater than or equal to the number of endpoints in the group. The value obtained via the outPubStatus
parameter of the DcmReadGroupPubQueue()
function indicates that the group of endpoints was published or unpublished. A notification about the publishing of an endpoint group appears in the queue only if the server publishes all endpoints in the group together or one by one. If the server publishes only a portion of the endpoints required by the client, a notification about the publishing of an endpoint group does not appear. If the server terminates or unpublishes at least one endpoint in a published group of endpoints, the client receives a notification about the unpublishing of this endpoint group.
If you no longer need to receive notifications about the publishing and unpublishing of an endpoint group with specific interfaces, the DCM handle that was created by calling the DcmSetGroupSubscription()
function must be closed by calling the DcmCloseGroupSubscrHandle()
function.
To interrupt a blocking call of the DcmReadGroupPubQueue()
function from another thread, call the DcmInterruptGroupSubscrBlockingCall()
function.
You can use the DcmSubscribeToGroupSubscrEvent()
and DcmUnsubscribeFromGroupSubscrEvent()
functions together with the functions from the notice_api.h API to receive notifications about the occurrence of the following events: the server published or depublished an endpoint in DCM
(the DCM_PUBLICATION_CHANGED
flag), or a blocking call of the DcmReadGroupPubQueue()
function was interrupted (the DCM_BLOCKING_CALL_INTERRUPTED
flag). (Flags of the event mask and the "resource–event mask" entry ID DCM_EVENT_ID
are defined in the header file sysroot-*-kos/include/dcm/dcm_api.h
from the KasperskyOS SDK.) The DcmSubscribeToGroupSubscrEvent()
and DcmUnsubscribeFromGroupSubscrEvent()
functions let you configure the notification receiver by adding or deleting, respectively, tracked objects identified by DCM handles.
subscr.h functions
Function |
Information about the function |
---|---|
|
Purpose Creates a DCM handle that enables receipt of notifications about the publishing and unpublishing of endpoint groups with specific interfaces. Parameters
Returned values If successful, the function returns |
|
Purpose Extracts a notification about the publishing or unpublishing of an endpoint group from the notification queue. Parameters
Returned values If successful, the function returns If a blocking call was interrupted by calling the Additional information Non-blocking call if the |
|
Purpose Interrupts a blocking call of the Parameters
Returned values If successful, the function returns |
|
Purpose Closes the DCM handle that was obtained by calling the Parameters
Returned values If successful, the function returns |
|
Purpose Configures the notification receiver to receive notifications about events related to the object identified by the defined DCM handle. Parameters
Returned values If successful, the function returns |
|
Purpose Configures the notification receiver to not receive notifications about events related to the object identified by the defined DCM handle. Parameters
Returned values If successful, the function returns |