S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_secure_channels_internal_ctx.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "sopc_builtintypes.h"
#include "sopc_crypto_decl.h"
#include "sopc_event_handler.h"
#include "sopc_key_sets.h"
#include "sopc_secret_buffer.h"
#include "sopc_singly_linked_list.h"
#include "sopc_time_reference.h"
#include "sopc_toolkit_config_constants.h"
#include "sopc_types.h"

Go to the source code of this file.

Data Structures

struct  SOPC_SentRequestMsg_Context
 Structure containing the context of a sent request message at SC layer level. More...
 
struct  SOPC_SecureConnection_ChunkMgrCtx
 
struct  SOPC_SecureConnection_TcpProperties
 
struct  SOPC_SecureConnection_TcpOpnReqAsymmSecu
 
struct  SOPC_SecureConnection_TcpSequenceProperties
 
struct  SOPC_SecureConnection_SecurityToken
 
struct  SOPC_SecureConnection
 
struct  SOPC_SecureListener
 

Typedefs

typedef struct SOPC_SecureConnection_ChunkMgrCtx SOPC_SecureConnection_ChunkMgrCtx
 
typedef struct SOPC_SecureConnection_TcpProperties SOPC_SecureConnection_TcpProperties
 
typedef struct SOPC_SecureConnection_TcpOpnReqAsymmSecu SOPC_SecureConnection_TcpAsymmSecu
 
typedef struct SOPC_SecureConnection_TcpSequenceProperties SOPC_SecureConnection_TcpSequenceProperties
 
typedef struct SOPC_SecureConnection_SecurityToken SOPC_SecureConnection_SecurityToken
 
typedef struct SOPC_SecureConnection SOPC_SecureConnection
 
typedef struct SOPC_SecureListener SOPC_SecureListener
 
typedef void SC_ApplyToConnection(SOPC_SecureConnection *conn, uint32_t connIdx, uintptr_t param, uintptr_t auxParam)
 

Enumerations

enum  SOPC_SecureListener_State { SECURE_LISTENER_STATE_CLOSED = 0 , SECURE_LISTENER_STATE_OPENING , SECURE_LISTENER_STATE_OPENED , SECURE_LISTENER_STATE_INACTIVE }
 
enum  SOPC_SecureConnection_State {
  SECURE_CONNECTION_STATE_SC_CLOSED = 0 , SECURE_CONNECTION_STATE_SC_CLOSING , SECURE_CONNECTION_STATE_TCP_REVERSE_TOKEN , SECURE_CONNECTION_STATE_TCP_REVERSE_INIT ,
  SECURE_CONNECTION_STATE_TCP_INIT , SECURE_CONNECTION_STATE_TCP_NEGOTIATE , SECURE_CONNECTION_STATE_SC_INIT , SECURE_CONNECTION_STATE_SC_CONNECTING ,
  SECURE_CONNECTION_STATE_SC_CONNECTED , SECURE_CONNECTION_STATE_SC_CONNECTED_RENEW
}
 
enum  SOPC_Msg_Type {
  SOPC_MSG_TYPE_INVALID = 0 , SOPC_MSG_TYPE_HEL , SOPC_MSG_TYPE_ACK , SOPC_MSG_TYPE_ERR ,
  SOPC_MSG_TYPE_RHE , SOPC_MSG_TYPE_SC_OPN , SOPC_MSG_TYPE_SC_CLO , SOPC_MSG_TYPE_SC_MSG
}
 TCP UA Message types. More...
 
enum  SOPC_Msg_IsFinal { SOPC_MSG_ISFINAL_INVALID = 0 , SOPC_MSG_ISFINAL_INTERMEDIATE , SOPC_MSG_ISFINAL_FINAL , SOPC_MSG_ISFINAL_ABORT }
 UA Message Chunk IsFinal type. More...
 

Functions

void SOPC_SecureChannelsInternalContext_Initialize (SOPC_SetListenerFunc *setSocketsListener)
 Initialize the array of secure listeners/connections.
 
void SOPC_SecureChannelsInternalContext_Clear (void)
 Clear the array of secure listeners/connections.
 
SOPC_SecureConnectionSC_GetConnection (uint32_t connectionIdx)
 
const SOPC_CertificateListSC_OwnCertificate (SOPC_SecureConnection *conn)
 
const SOPC_CertificateListSC_PeerCertificate (SOPC_SecureConnection *conn)
 
void SC_ApplyToAllSCs (SC_ApplyToConnection *applyToConnection, uintptr_t param, uintptr_t auxParam)
 
uint32_t SOPC_ScInternalContext_GetNbIntermediateInputChunks (SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
 Retrieve the number of intermediate chunks already received.
 
bool SOPC_ScInternalContext_AddIntermediateInputChunk (SOPC_SecureConnection_TcpProperties *tcpProperties, SOPC_SecureConnection_ChunkMgrCtx *chunkCtx, SOPC_Buffer *intermediateChunk)
 Add an intermediate chunk received into message chunks.
 
void SOPC_ScInternalContext_ClearIntermediateInputChunks (SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
 Clear the list of intermediate chunks received (should be called directly only in case of abort chunk received)
 
void SOPC_ScInternalContext_ClearCurrentInputChunkContext (SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
 Clear the current chunk context but not the intermediate chunks context.
 
void SOPC_ScInternalContext_ClearInputChunksContext (SOPC_SecureConnection_ChunkMgrCtx *chunkCtx)
 Clear the current chunk and intermediate chunks context.
 
void SOPC_SecureChannels_OnInternalEvent (SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
 
void SOPC_SecureChannels_OnSocketsEvent (SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
 
void SOPC_SecureChannels_OnTimerEvent (SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
 
void SOPC_SecureChannels_OnInputEvent (SOPC_EventHandler *handler, int32_t event, uint32_t id, uintptr_t params, uintptr_t auxParam)
 

Variables

SOPC_SecureListener secureListenersArray [SOPC_MAX_ENDPOINT_DESCRIPTION_CONFIGURATIONS *2+1]
 Array containing all listeners that can be used for server endpoints and client reverse endpoints.
 
SOPC_SecureConnection secureConnectionsArray [SOPC_MAX_SECURE_CONNECTIONS_PLUS_BUFFERED+1]
 Array containing all connections that can be used.
 
uint32_t lastSecureConnectionArrayIdx
 
SOPC_LoopersecureChannelsLooper
 
SOPC_EventHandlersecureChannelsInputEventHandler
 
SOPC_EventHandlersecureChannelsInternalEventHandler
 
SOPC_EventHandlersecureChannelsTimerEventHandler
 
SOPC_EventHandlersecureChannelsEventHandler
 

Typedef Documentation

◆ SOPC_SecureConnection_ChunkMgrCtx

typedef struct SOPC_SecureConnection_ChunkMgrCtx SOPC_SecureConnection_ChunkMgrCtx

◆ SOPC_SecureConnection_TcpProperties

typedef struct SOPC_SecureConnection_TcpProperties SOPC_SecureConnection_TcpProperties

◆ SOPC_SecureConnection_TcpAsymmSecu

◆ SOPC_SecureConnection_TcpSequenceProperties

typedef struct SOPC_SecureConnection_TcpSequenceProperties SOPC_SecureConnection_TcpSequenceProperties

◆ SOPC_SecureConnection_SecurityToken

typedef struct SOPC_SecureConnection_SecurityToken SOPC_SecureConnection_SecurityToken

◆ SOPC_SecureConnection

typedef struct SOPC_SecureConnection SOPC_SecureConnection

◆ SOPC_SecureListener

typedef struct SOPC_SecureListener SOPC_SecureListener

◆ SC_ApplyToConnection

typedef void SC_ApplyToConnection(SOPC_SecureConnection *conn, uint32_t connIdx, uintptr_t param, uintptr_t auxParam)

Enumeration Type Documentation

◆ SOPC_SecureListener_State

Enumerator
SECURE_LISTENER_STATE_CLOSED 
SECURE_LISTENER_STATE_OPENING 
SECURE_LISTENER_STATE_OPENED 
SECURE_LISTENER_STATE_INACTIVE 

◆ SOPC_SecureConnection_State

Enumerator
SECURE_CONNECTION_STATE_SC_CLOSED 
SECURE_CONNECTION_STATE_SC_CLOSING 
SECURE_CONNECTION_STATE_TCP_REVERSE_TOKEN 
SECURE_CONNECTION_STATE_TCP_REVERSE_INIT 
SECURE_CONNECTION_STATE_TCP_INIT 
SECURE_CONNECTION_STATE_TCP_NEGOTIATE 
SECURE_CONNECTION_STATE_SC_INIT 
SECURE_CONNECTION_STATE_SC_CONNECTING 
SECURE_CONNECTION_STATE_SC_CONNECTED 
SECURE_CONNECTION_STATE_SC_CONNECTED_RENEW 

◆ SOPC_Msg_Type

TCP UA Message types.

Enumerator
SOPC_MSG_TYPE_INVALID 
SOPC_MSG_TYPE_HEL 
SOPC_MSG_TYPE_ACK 
SOPC_MSG_TYPE_ERR 
SOPC_MSG_TYPE_RHE 
SOPC_MSG_TYPE_SC_OPN 
SOPC_MSG_TYPE_SC_CLO 
SOPC_MSG_TYPE_SC_MSG 

◆ SOPC_Msg_IsFinal

UA Message Chunk IsFinal type.

Enumerator
SOPC_MSG_ISFINAL_INVALID 
SOPC_MSG_ISFINAL_INTERMEDIATE 

C type

SOPC_MSG_ISFINAL_FINAL 

F type

SOPC_MSG_ISFINAL_ABORT 

A type

Function Documentation

◆ SOPC_SecureChannelsInternalContext_Initialize()

void SOPC_SecureChannelsInternalContext_Initialize ( SOPC_SetListenerFunc * setSocketsListener)

Initialize the array of secure listeners/connections.

◆ SOPC_SecureChannelsInternalContext_Clear()

void SOPC_SecureChannelsInternalContext_Clear ( void )

Clear the array of secure listeners/connections.

◆ SC_GetConnection()

SOPC_SecureConnection * SC_GetConnection ( uint32_t connectionIdx)

◆ SC_OwnCertificate()

const SOPC_CertificateList * SC_OwnCertificate ( SOPC_SecureConnection * conn)

◆ SC_PeerCertificate()

const SOPC_CertificateList * SC_PeerCertificate ( SOPC_SecureConnection * conn)

◆ SC_ApplyToAllSCs()

void SC_ApplyToAllSCs ( SC_ApplyToConnection * applyToConnection,
uintptr_t param,
uintptr_t auxParam )

◆ SOPC_ScInternalContext_GetNbIntermediateInputChunks()

uint32_t SOPC_ScInternalContext_GetNbIntermediateInputChunks ( SOPC_SecureConnection_ChunkMgrCtx * chunkCtx)

Retrieve the number of intermediate chunks already received.

◆ SOPC_ScInternalContext_AddIntermediateInputChunk()

bool SOPC_ScInternalContext_AddIntermediateInputChunk ( SOPC_SecureConnection_TcpProperties * tcpProperties,
SOPC_SecureConnection_ChunkMgrCtx * chunkCtx,
SOPC_Buffer * intermediateChunk )

Add an intermediate chunk received into message chunks.

◆ SOPC_ScInternalContext_ClearIntermediateInputChunks()

void SOPC_ScInternalContext_ClearIntermediateInputChunks ( SOPC_SecureConnection_ChunkMgrCtx * chunkCtx)

Clear the list of intermediate chunks received (should be called directly only in case of abort chunk received)

◆ SOPC_ScInternalContext_ClearCurrentInputChunkContext()

void SOPC_ScInternalContext_ClearCurrentInputChunkContext ( SOPC_SecureConnection_ChunkMgrCtx * chunkCtx)

Clear the current chunk context but not the intermediate chunks context.

◆ SOPC_ScInternalContext_ClearInputChunksContext()

void SOPC_ScInternalContext_ClearInputChunksContext ( SOPC_SecureConnection_ChunkMgrCtx * chunkCtx)

Clear the current chunk and intermediate chunks context.

◆ SOPC_SecureChannels_OnInternalEvent()

void SOPC_SecureChannels_OnInternalEvent ( SOPC_EventHandler * handler,
int32_t event,
uint32_t id,
uintptr_t params,
uintptr_t auxParam )

◆ SOPC_SecureChannels_OnSocketsEvent()

void SOPC_SecureChannels_OnSocketsEvent ( SOPC_EventHandler * handler,
int32_t event,
uint32_t id,
uintptr_t params,
uintptr_t auxParam )

◆ SOPC_SecureChannels_OnTimerEvent()

void SOPC_SecureChannels_OnTimerEvent ( SOPC_EventHandler * handler,
int32_t event,
uint32_t id,
uintptr_t params,
uintptr_t auxParam )

◆ SOPC_SecureChannels_OnInputEvent()

void SOPC_SecureChannels_OnInputEvent ( SOPC_EventHandler * handler,
int32_t event,
uint32_t id,
uintptr_t params,
uintptr_t auxParam )

Variable Documentation

◆ secureListenersArray

Array containing all listeners that can be used for server endpoints and client reverse endpoints.

◆ secureConnectionsArray

Array containing all connections that can be used.

◆ lastSecureConnectionArrayIdx

uint32_t lastSecureConnectionArrayIdx
extern

◆ secureChannelsLooper

SOPC_Looper* secureChannelsLooper
extern

◆ secureChannelsInputEventHandler

SOPC_EventHandler* secureChannelsInputEventHandler
extern

◆ secureChannelsInternalEventHandler

SOPC_EventHandler* secureChannelsInternalEventHandler
extern

◆ secureChannelsTimerEventHandler

SOPC_EventHandler* secureChannelsTimerEventHandler
extern

◆ secureChannelsEventHandler

SOPC_EventHandler* secureChannelsEventHandler
extern