S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_services_api.h File Reference
#include <stdint.h>
#include "sopc_event_handler.h"

Go to the source code of this file.

Typedefs

typedef enum SOPC_Services_Event SOPC_Services_Event
 

Enumerations

enum  SOPC_Services_Event {
  SE_TO_SE_SC_ALL_DISCONNECTED , SE_TO_SE_ACTIVATE_ORPHANED_SESSION , SE_TO_SE_CREATE_SESSION , SE_TO_SE_ACTIVATE_SESSION ,
  SE_TO_SE_SERVER_DATA_CHANGED , SE_TO_SE_SERVER_NODE_CHANGED , SE_TO_SE_SERVER_INACTIVATED_SESSION_PRIO , SE_TO_SE_SERVER_SEND_ASYNC_PUB_RESP_PRIO ,
  TIMER_SE_EVAL_SESSION_TIMEOUT , TIMER_SE_PUBLISH_CYCLE_TIMEOUT , APP_TO_SE_OPEN_ENDPOINT , APP_TO_SE_CLOSE_ENDPOINT ,
  APP_TO_SE_LOCAL_SERVICE_REQUEST , APP_TO_SE_TRIGGER_EVENT , APP_TO_SE_OPEN_REVERSE_ENDPOINT , APP_TO_SE_CLOSE_REVERSE_ENDPOINT ,
  APP_TO_SE_ACTIVATE_SESSION , APP_TO_SE_SEND_SESSION_REQUEST , APP_TO_SE_SEND_DISCOVERY_REQUEST , APP_TO_SE_CLOSE_SESSION ,
  APP_TO_SE_CLOSE_ALL_CONNECTIONS , APP_TO_SE_REEVALUATE_SCS , APP_TO_SE_EVAL_USR_CRT_SESSIONS
}
 

Functions

void SOPC_Services_EnqueueEvent (SOPC_Services_Event seEvent, uint32_t id, uintptr_t params, uintptr_t auxParam)
 
void SOPC_Services_Initialize (SOPC_SetListenerFunc *setSecureChannelsListener)
 Initializes the services and application event dispatcher threads.
 
void SOPC_Services_CloseAllSCs (bool clientOnly)
 Close all SecureChannels (established as client or both) in a synchronous way.
 
void SOPC_Services_Clear (void)
 Stop and clear the services and application event dispatcher threads.
 
SOPC_EventHandlerSOPC_Services_GetEventHandler (void)
 

Typedef Documentation

◆ SOPC_Services_Event

Services events input events from application, services layer it-self or timer manager

Enumeration Type Documentation

◆ SOPC_Services_Event

Services events input events from application, services layer it-self or timer manager

Enumerator
SE_TO_SE_SC_ALL_DISCONNECTED 

Special event sent by B code to indicate all SC are closed. used to stop waiting synchronously disconnection of all secure channels before during toolkit clearing phase.
It might concern only SC established as client or both client/server.
params = true if for SCs as client only, false if both client and server SCs.

SE_TO_SE_ACTIVATE_ORPHANED_SESSION 

Client side only:
Re-activate an orphaned session on a new secure channel connection.
id = session id
auxParam = (uint32_t) secure channel config index

SE_TO_SE_CREATE_SESSION 

Client side only:
Create a session on a new secure channel connection.
id = session id
auxParam = (uint32_t) secure channel config index

SE_TO_SE_ACTIVATE_SESSION 

Client side only:
Activate the session for which creation has succeeded.
id = session id
params = (user token structure)

SE_TO_SE_SERVER_DATA_CHANGED 

Server side only:
Notifies that address space data has changed, used to generate notification in subscription mechanism.
params = (OpcUa_WriteValue*) old data value
auxParam = (OpcUa_WriteValue*) new data value

SE_TO_SE_SERVER_NODE_CHANGED 

Server side only:
params = (bool) true if node added, false if node deleted
auxParam = (SOPC_NodeId*) NodeId of the node added/deleted

SE_TO_SE_SERVER_INACTIVATED_SESSION_PRIO 

Server side only:
Notifies that an activated session is not active anymore (closed or orphaned), used to update subscription state.
id = session id
auxParam = (int32_t) session state

SE_TO_SE_SERVER_SEND_ASYNC_PUB_RESP_PRIO 

Server side only:
Provides an asynchronous publish response to be sent.
id = session id
params = (SOPC_Internal_AsyncSendMsgData*)
auxParams = (constants_statuscodes_bs__t_StatusCode_i) service result code

TIMER_SE_EVAL_SESSION_TIMEOUT 

Server side only:
Evaluates if the session has been used during session timeout duration, otherwise close the session.
id = session id

TIMER_SE_PUBLISH_CYCLE_TIMEOUT 

Server side only: evaluates the publish cycle timeout expiration for the subscription.
id = subscription id

APP_TO_SE_OPEN_ENDPOINT 

Server side only:
Requests to open a new endpoint listening for secure channel connections.
id = endpoint description config index

APP_TO_SE_CLOSE_ENDPOINT 

Server side only:
Requests to close an opened endpoint listening for connections.
id = endpoint description config index

APP_TO_SE_LOCAL_SERVICE_REQUEST 

Server side only:
Requests to run the provided service request locally on the server (no session and user considered)
id = endpoint description config index
params = (OpcUa_<MessageStruct>*) OPC UA message payload structure (header ignored)
auxParam = user application session context

APP_TO_SE_TRIGGER_EVENT 

Server side only:
Trigger the provided event from the given node notifier with possibly subscription filtering. params = (SOPC_Internal_EventContext*) triggered event context

APP_TO_SE_OPEN_REVERSE_ENDPOINT 

Server side only:
Requests to open a new reverse endpoint listening for secure channel connections.
id = reverse endpoint description config index

APP_TO_SE_CLOSE_REVERSE_ENDPOINT 

Server side only:
Requests to close an opened endpoint listening for reverse connections.
id = reverse endpoint description config index

APP_TO_SE_ACTIVATE_SESSION 

Client side only:
Requests to Connect SC, Create and Activate session a session using a given connection configuration
id = secure channel config index
params = reverse endpoint connection index or 0 if not a reverse connection
auxParam = (SOPC_Internal_SessionAppContext*)

APP_TO_SE_SEND_SESSION_REQUEST 

Client side only:
Requests to send a service request on a activated session.
id = session id
params = (OpcUa_<MessageStruct>*) OPC UA message payload structure (header ignored)
auxParam = user application request context

APP_TO_SE_SEND_DISCOVERY_REQUEST 

Client side only:
Requests to send a discovery service request (for which no session is necessary)
id = secure channel config index
params = reverse endpoint connection index or 0 if not a reverse connection
auxParam = (SOPC_Internal_DiscoveryContext*)

APP_TO_SE_CLOSE_SESSION 

Client side only:
requests to close an activated session.
id = session id

APP_TO_SE_CLOSE_ALL_CONNECTIONS 

(internal use only). Request to close all established SC connections
It might be used to close only SC established as client or both client/server. Automatically called by SOPC_Toolkit_Clear for both client and server.
params = true if for SCs as client only, false if both client and server SCs.

APP_TO_SE_REEVALUATE_SCS 

Re-evaluate the secure channels due to application certificate/key update (force SC re-establishment) or PKI application trust list update (peer certificate re-validation necessary).

params = (bool) flag indicating if it concerns server (true) or client (false) application secure channels.
auxParam = (bool) flag indicating if it concerns application certificate/key update (true), otherwise the PKI trust list update (false).

APP_TO_SE_EVAL_USR_CRT_SESSIONS 

Server side only:
Re-evaluates X509IdentityToken certificates for all active sessions. If an user certificate is not valid or trusted anymore, the associated session is closed.

Function Documentation

◆ SOPC_Services_EnqueueEvent()

void SOPC_Services_EnqueueEvent ( SOPC_Services_Event seEvent,
uint32_t id,
uintptr_t params,
uintptr_t auxParam )

◆ SOPC_Services_Initialize()

void SOPC_Services_Initialize ( SOPC_SetListenerFunc * setSecureChannelsListener)

Initializes the services and application event dispatcher threads.

◆ SOPC_Services_CloseAllSCs()

void SOPC_Services_CloseAllSCs ( bool clientOnly)

Close all SecureChannels (established as client or both) in a synchronous way.

Parameters
clientOnlyIf flag is set, only the Secure Channels established as a client are closed. Otherwise both Secure Channels established as a server and as client are closed.
Warning
It is a pre-requisite to call SOPC_Services_CloseAllSCs(false) prior to SOPC_Services_Clear

◆ SOPC_Services_Clear()

void SOPC_Services_Clear ( void )

Stop and clear the services and application event dispatcher threads.

◆ SOPC_Services_GetEventHandler()

SOPC_EventHandler * SOPC_Services_GetEventHandler ( void )