open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
ua_session.h File Reference
#include <open62541/util.h>
#include "ua_securechannel.h"

Go to the source code of this file.

Data Structures

struct  UA_PublishResponseEntry
 
struct  UA_Session
 

Macros

#define UA_MAXCONTINUATIONPOINTS   5
 
#define UA_LOG_SESSION_INTERNAL(LOGGER, LEVEL, SESSION, MSG, ...)
 
#define UA_LOG_TRACE_SESSION(LOGGER, SESSION, ...)    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, TRACE, SESSION, __VA_ARGS__, ""))
 
#define UA_LOG_DEBUG_SESSION(LOGGER, SESSION, ...)    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, DEBUG, SESSION, __VA_ARGS__, ""))
 
#define UA_LOG_INFO_SESSION(LOGGER, SESSION, ...)    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, INFO, SESSION, __VA_ARGS__, ""))
 
#define UA_LOG_WARNING_SESSION(LOGGER, SESSION, ...)    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, WARNING, SESSION, __VA_ARGS__, ""))
 
#define UA_LOG_ERROR_SESSION(LOGGER, SESSION, ...)    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, ERROR, SESSION, __VA_ARGS__, ""))
 
#define UA_LOG_FATAL_SESSION(LOGGER, SESSION, ...)    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, FATAL, SESSION, __VA_ARGS__, ""))
 

Typedefs

typedef struct ContinuationPoint ContinuationPoint
 
typedef struct UA_Subscription UA_Subscription
 
typedef struct UA_PublishResponseEntry UA_PublishResponseEntry
 

Functions

ContinuationPointContinuationPoint_clear (ContinuationPoint *cp)
 
void UA_Session_init (UA_Session *session)
 
void UA_Session_clear (UA_Session *session, UA_Server *server)
 
void UA_Session_attachToSecureChannel (UA_Session *session, UA_SecureChannel *channel)
 
void UA_Session_detachFromSecureChannel (UA_Session *session)
 
UA_StatusCode UA_Session_generateNonce (UA_Session *session)
 
void UA_Session_updateLifetime (UA_Session *session)
 
void UA_Session_attachSubscription (UA_Session *session, UA_Subscription *sub)
 
void UA_Session_detachSubscription (UA_Server *server, UA_Session *session, UA_Subscription *sub, UA_Boolean releasePublishResponses)
 
UA_SubscriptionUA_Session_getSubscriptionById (UA_Session *session, UA_UInt32 subscriptionId)
 
void UA_Session_queuePublishReq (UA_Session *session, UA_PublishResponseEntry *entry, UA_Boolean head)
 
UA_PublishResponseEntryUA_Session_dequeuePublishReq (UA_Session *session)
 

Macro Definition Documentation

◆ UA_MAXCONTINUATIONPOINTS

#define UA_MAXCONTINUATIONPOINTS   5

This Source Code Form is subject to the terms of the Mozilla Public License, v.

2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer) Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green)

Definition at line 18 of file ua_session.h.

◆ UA_LOG_SESSION_INTERNAL

#define UA_LOG_SESSION_INTERNAL ( LOGGER,
LEVEL,
SESSION,
MSG,
... )
Value:
do { \
int nameLen = (SESSION) ? (int)(SESSION)->sessionName.length : 0; \
const char *nameStr = (SESSION) ? \
(const char*)(SESSION)->sessionName.data : NULL; \
UA_UInt32 chanId = ((SESSION) && (SESSION)->header.channel) ? \
(SESSION)->header.channel->securityToken.channelId : 0; \
UA_LOG_##LEVEL(LOGGER, UA_LOGCATEGORY_SESSION, \
"SecureChannel %" PRIu32 " | Session \"%.*s\" | " MSG "%.0s", \
chanId, nameLen, nameStr, __VA_ARGS__); \
} while(0)
@ UA_LOGCATEGORY_SESSION
Definition log.h:32
uint32_t UA_UInt32
Definition types.h:56

Definition at line 123 of file ua_session.h.

◆ UA_LOG_TRACE_SESSION

#define UA_LOG_TRACE_SESSION ( LOGGER,
SESSION,
... )    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, TRACE, SESSION, __VA_ARGS__, ""))

Definition at line 136 of file ua_session.h.

◆ UA_LOG_DEBUG_SESSION

#define UA_LOG_DEBUG_SESSION ( LOGGER,
SESSION,
... )    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, DEBUG, SESSION, __VA_ARGS__, ""))

Definition at line 143 of file ua_session.h.

◆ UA_LOG_INFO_SESSION

#define UA_LOG_INFO_SESSION ( LOGGER,
SESSION,
... )    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, INFO, SESSION, __VA_ARGS__, ""))

Definition at line 150 of file ua_session.h.

◆ UA_LOG_WARNING_SESSION

#define UA_LOG_WARNING_SESSION ( LOGGER,
SESSION,
... )    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, WARNING, SESSION, __VA_ARGS__, ""))

Definition at line 157 of file ua_session.h.

◆ UA_LOG_ERROR_SESSION

#define UA_LOG_ERROR_SESSION ( LOGGER,
SESSION,
... )    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, ERROR, SESSION, __VA_ARGS__, ""))

Definition at line 164 of file ua_session.h.

◆ UA_LOG_FATAL_SESSION

#define UA_LOG_FATAL_SESSION ( LOGGER,
SESSION,
... )    UA_MACRO_EXPAND(UA_LOG_SESSION_INTERNAL(LOGGER, FATAL, SESSION, __VA_ARGS__, ""))

Definition at line 171 of file ua_session.h.

Typedef Documentation

◆ ContinuationPoint

Definition at line 21 of file ua_session.h.

◆ UA_Subscription

typedef struct UA_Subscription UA_Subscription

Definition at line 28 of file ua_session.h.

◆ UA_PublishResponseEntry

typedef struct UA_PublishResponseEntry UA_PublishResponseEntry

Function Documentation

◆ ContinuationPoint_clear()

ContinuationPoint * ContinuationPoint_clear ( ContinuationPoint * cp)

Returns the next entry in the linked list.

◆ UA_Session_init()

void UA_Session_init ( UA_Session * session)

◆ UA_Session_clear()

void UA_Session_clear ( UA_Session * session,
UA_Server * server )

◆ UA_Session_attachToSecureChannel()

void UA_Session_attachToSecureChannel ( UA_Session * session,
UA_SecureChannel * channel )

◆ UA_Session_detachFromSecureChannel()

void UA_Session_detachFromSecureChannel ( UA_Session * session)

◆ UA_Session_generateNonce()

UA_StatusCode UA_Session_generateNonce ( UA_Session * session)

◆ UA_Session_updateLifetime()

void UA_Session_updateLifetime ( UA_Session * session)

If any activity on a session happens, the timeout is extended.

◆ UA_Session_attachSubscription()

void UA_Session_attachSubscription ( UA_Session * session,
UA_Subscription * sub )

◆ UA_Session_detachSubscription()

void UA_Session_detachSubscription ( UA_Server * server,
UA_Session * session,
UA_Subscription * sub,
UA_Boolean releasePublishResponses )

If releasePublishResponses is true and the last subscription is removed, all outstanding PublishResponse are sent with a StatusCode.

But we don't do that if a Subscription is only detached for modification.

◆ UA_Session_getSubscriptionById()

UA_Subscription * UA_Session_getSubscriptionById ( UA_Session * session,
UA_UInt32 subscriptionId )

◆ UA_Session_queuePublishReq()

void UA_Session_queuePublishReq ( UA_Session * session,
UA_PublishResponseEntry * entry,
UA_Boolean head )

◆ UA_Session_dequeuePublishReq()

UA_PublishResponseEntry * UA_Session_dequeuePublishReq ( UA_Session * session)