28#define UA_MACRO_EXPAND(x) x 
   31#define UA_LOG_NODEID_INTERNAL(NODEID, LOG)          \ 
   33    UA_String nodeIdStr = UA_STRING_NULL;            \ 
   34    UA_NodeId_print(NODEID, &nodeIdStr);             \ 
   36    UA_String_clear(&nodeIdStr);                     \ 
 
   40# define UA_LOG_NODEID_TRACE(NODEID, LOG)       \ 
   41    UA_LOG_NODEID_INTERNAL(NODEID, LOG) 
 
   43# define UA_LOG_NODEID_TRACE(NODEID, LOG) 
   47# define UA_LOG_NODEID_DEBUG(NODEID, LOG)       \ 
   48    UA_LOG_NODEID_INTERNAL(NODEID, LOG) 
 
   50# define UA_LOG_NODEID_DEBUG(NODEID, LOG) 
   54# define UA_LOG_NODEID_INFO(NODEID, LOG)       \ 
   55    UA_LOG_NODEID_INTERNAL(NODEID, LOG) 
 
   57# define UA_LOG_NODEID_INFO(NODEID, LOG) 
   61# define UA_LOG_NODEID_WARNING(NODEID, LOG)     \ 
   62    UA_LOG_NODEID_INTERNAL(NODEID, LOG) 
 
   64# define UA_LOG_NODEID_WARNING(NODEID, LOG) 
   68# define UA_LOG_NODEID_ERROR(NODEID, LOG)       \ 
   69    UA_LOG_NODEID_INTERNAL(NODEID, LOG) 
 
   71# define UA_LOG_NODEID_ERROR(NODEID, LOG) 
   75# define UA_LOG_NODEID_FATAL(NODEID, LOG)       \ 
   76    UA_LOG_NODEID_INTERNAL(NODEID, LOG) 
 
   78# define UA_LOG_NODEID_FATAL(NODEID, LOG) 
  101isNonNull(
const void *ptr) {
 
  106isTrue(uint8_t expr) {
 
  110#define UA_CHECK(A, EVAL_ON_ERROR)                                                       \ 
  112        if(UA_UNLIKELY(!isTrue(A))) {                                                    \ 
 
  117#define UA_CHECK_STATUS(STATUSCODE, EVAL_ON_ERROR)                                       \ 
  118    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR) 
 
  120#define UA_CHECK_MEM(STATUSCODE, EVAL_ON_ERROR)                                       \ 
  121    UA_CHECK(isNonNull(STATUSCODE), EVAL_ON_ERROR) 
 
  123#ifdef UA_DEBUG_FILE_LINE_INFO 
  124#define UA_CHECK_LOG_INTERNAL(A, STATUSCODE, EVAL, LOG, LOGGER, CAT, MSG, ...)           \ 
  126        UA_CHECK(A, LOG(LOGGER, CAT, "" MSG "%s (%s:%d: statuscode: %s)", __VA_ARGS__,   \ 
  127                        __FILE__, __LINE__, UA_StatusCode_name(STATUSCODE));             \ 
  130#define UA_CHECK_LOG_INTERNAL(A, STATUSCODE, EVAL, LOG, LOGGER, CAT, MSG, ...)           \ 
  132        UA_CHECK(A, LOG(LOGGER, CAT, "" MSG "%s (statuscode: %s)", __VA_ARGS__,   \ 
  133                        UA_StatusCode_name(STATUSCODE));             \ 
 
  137#define UA_CHECK_LOG(A, EVAL, LEVEL, LOGGER, CAT, ...)                                   \ 
  138    UA_MACRO_EXPAND(UA_CHECK_LOG_INTERNAL(A, UA_STATUSCODE_BAD, EVAL, UA_LOG_##LEVEL,    \ 
  139                                          LOGGER, CAT, __VA_ARGS__, "")) 
 
  141#define UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, LEVEL, LOGGER, CAT, ...)                   \ 
  142    UA_MACRO_EXPAND(UA_CHECK_LOG_INTERNAL(isGood(STATUSCODE), STATUSCODE,  \ 
  143                                          EVAL, UA_LOG_##LEVEL, LOGGER, CAT,             \ 
 
  146#define UA_CHECK_MEM_LOG(PTR, EVAL, LEVEL, LOGGER, CAT, ...)                   \ 
  147    UA_MACRO_EXPAND(UA_CHECK_LOG_INTERNAL(isNonNull(PTR), UA_STATUSCODE_BADOUTOFMEMORY,  \ 
  148                                          EVAL, UA_LOG_##LEVEL, LOGGER, CAT,             \ 
 
  152#define UA_CHECK_FATAL(A, EVAL, LOGGER, CAT, ...)                                        \ 
  153    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__)) 
 
  154#define UA_CHECK_ERROR(A, EVAL, LOGGER, CAT, ...)                                        \ 
  155    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__)) 
 
  156#define UA_CHECK_WARN(A, EVAL, LOGGER, CAT, ...)                                         \ 
  157    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__)) 
 
  158#define UA_CHECK_INFO(A, EVAL, LOGGER, CAT, ...)                                         \ 
  159    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, INFO, LOGGER, CAT, __VA_ARGS__)) 
 
  161#define UA_CHECK_STATUS_FATAL(STATUSCODE, EVAL, LOGGER, CAT, ...)                        \ 
  163        UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__)) 
 
  164#define UA_CHECK_STATUS_ERROR(STATUSCODE, EVAL, LOGGER, CAT, ...)                        \ 
  166        UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__)) 
 
  167#define UA_CHECK_STATUS_WARN(STATUSCODE, EVAL, LOGGER, CAT, ...)                         \ 
  169        UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__)) 
 
  170#define UA_CHECK_STATUS_INFO(STATUSCODE, EVAL, LOGGER, CAT, ...)                         \ 
  172        UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, INFO, LOGGER, CAT, __VA_ARGS__)) 
 
  174#define UA_CHECK_MEM_FATAL(PTR, EVAL, LOGGER, CAT, ...)                        \ 
  176        UA_CHECK_MEM_LOG(PTR, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__)) 
 
  177#define UA_CHECK_MEM_ERROR(PTR, EVAL, LOGGER, CAT, ...)                        \ 
  179        UA_CHECK_MEM_LOG(PTR, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__)) 
 
  180#define UA_CHECK_MEM_WARN(PTR, EVAL, LOGGER, CAT, ...)                         \ 
  182        UA_CHECK_MEM_LOG(PTR, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__)) 
 
  183#define UA_CHECK_MEM_INFO(PTR, EVAL, LOGGER, CAT, ...)                         \ 
  185        UA_CHECK_MEM_LOG(PTR, EVAL, INFO, LOGGER, CAT, __VA_ARGS__)) 
 
  198#ifdef UA_DEBUG_DUMP_PKGS 
  200UA_dump_hex_pkg(
UA_Byte* buffer, 
size_t bufferLen);
 
  208#ifdef UA_ENABLE_DISCOVERY 
  209# ifdef UA_ENABLE_DISCOVERY_MULTICAST 
  210    UA_FindServersOnNetworkRequest findServersOnNetworkRequest;
 
  230#ifdef UA_ENABLE_HISTORIZING 
  234#ifdef UA_ENABLE_METHODCALLS 
  237#ifdef UA_ENABLE_SUBSCRIPTIONS 
 
  255#ifdef UA_ENABLE_DISCOVERY 
  256# ifdef UA_ENABLE_DISCOVERY_MULTICAST 
  257    UA_FindServersOnNetworkResponse findServersOnNetworkResponse;
 
  277#ifdef UA_ENABLE_HISTORIZING 
  281#ifdef UA_ENABLE_METHODCALLS 
  284#ifdef UA_ENABLE_SUBSCRIPTIONS 
 
  307#define UA_ENCODING_HELPERS(TYPE, UPCASE_TYPE)                          \ 
  309    UA_##TYPE##_calcSizeBinary(const UA_##TYPE *src) {                    \ 
  310        return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_##UPCASE_TYPE]); \ 
  312    static UA_StatusCode                                      \ 
  313    UA_##TYPE##_encodeBinary(const UA_##TYPE *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { \ 
  314        return UA_encodeBinaryInternal(src, &UA_TYPES[UA_TYPES_##UPCASE_TYPE], \ 
  315                                       bufPos, &bufEnd, NULL, NULL);    \ 
  317    static UA_StatusCode                                      \ 
  318    UA_##TYPE##_decodeBinary(const UA_ByteString *src, size_t *offset, UA_##TYPE *dst) { \ 
  319    return UA_decodeBinaryInternal(src, offset, dst, \ 
  320                                   &UA_TYPES[UA_TYPES_##UPCASE_TYPE], NULL); \ 
 
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
 
#define UA_STATUSCODE_GOOD
"The operation succeeded."
 
Datatype arrays with custom type definitions can be added in a linked list to the client or server co...
 
_UA_BEGIN_DECLS typedef bool UA_Boolean
This Source Code Form is subject to the terms of the Mozilla Public License, v.
 
#define UA_ENCODING_HELPERS(TYPE, UPCASE_TYPE)
Encoding Helpers.
 
UA_Byte u8
Short names for integer.
 
UA_Boolean UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2)
Do not expose UA_String_equal_ignorecase to public API as it currently only handles ASCII strings,...
 
const UA_DataType * UA_findDataTypeWithCustom(const UA_NodeId *typeId, const UA_DataTypeArray *customTypes)
 
size_t getCountOfOptionalFields(const UA_DataType *type)
Get the number of optional fields contained in an structure type.
 
Dump packet for debugging / fuzzing.
 
UA_DeleteReferencesRequest deleteReferencesRequest
 
UA_AddNodesRequest addNodesRequest
 
UA_DeleteMonitoredItemsRequest deleteMonitoredItemsRequest
 
UA_ActivateSessionRequest activateSessionRequest
 
UA_HistoryReadRequest historyReadRequest
 
UA_ModifySubscriptionRequest modifySubscriptionRequest
 
UA_CloseSessionRequest closeSessionRequest
 
UA_CreateMonitoredItemsRequest createMonitoredItemsRequest
 
UA_AddReferencesRequest addReferencesRequest
 
UA_RegisterNodesRequest registerNodesRequest
 
UA_CreateSessionRequest createSessionRequest
 
UA_DeleteNodesRequest deleteNodesRequest
 
UA_SetPublishingModeRequest setPublishingModeRequest
 
UA_RegisterServerRequest registerServerRequest
 
UA_OpenSecureChannelRequest openSecureChannelRequest
 
UA_HistoryUpdateRequest historyUpdateRequest
 
UA_TranslateBrowsePathsToNodeIdsRequest translateBrowsePathsToNodeIdsRequest
 
UA_UnregisterNodesRequest unregisterNodesRequest
 
UA_CreateSubscriptionRequest createSubscriptionRequest
 
UA_BrowseRequest browseRequest
 
UA_RequestHeader requestHeader
 
UA_CallRequest callRequest
 
UA_FindServersRequest findServersRequest
 
UA_PublishRequest publishRequest
 
UA_SetMonitoringModeRequest setMonitoringModeRequest
 
UA_GetEndpointsRequest getEndpointsRequest
 
UA_ReadRequest readRequest
 
UA_DeleteSubscriptionsRequest deleteSubscriptionsRequest
 
UA_RepublishRequest republishRequest
 
UA_BrowseNextRequest browseNextRequest
 
UA_WriteRequest writeRequest
 
UA_RegisterServer2Request registerServer2Request
 
UA_ModifyMonitoredItemsRequest modifyMonitoredItemsRequest
 
UA_ReadResponse readResponse
 
UA_HistoryUpdateResponse historyUpdateResponse
 
UA_HistoryReadResponse historyReadResponse
 
UA_OpenSecureChannelResponse openSecureChannelResponse
 
UA_ActivateSessionResponse activateSessionResponse
 
UA_CreateSessionResponse createSessionResponse
 
UA_ResponseHeader responseHeader
 
UA_AddNodesResponse addNodesResponse
 
UA_RepublishResponse republishResponse
 
UA_ModifySubscriptionResponse modifySubscriptionResponse
 
UA_GetEndpointsResponse getEndpointsResponse
 
UA_WriteResponse writeResponse
 
UA_CreateMonitoredItemsResponse createMonitoredItemsResponse
 
UA_DeleteSubscriptionsResponse deleteSubscriptionsResponse
 
UA_DeleteMonitoredItemsResponse deleteMonitoredItemsResponse
 
UA_SetPublishingModeResponse setPublishingModeResponse
 
UA_FindServersResponse findServersResponse
 
UA_DeleteReferencesResponse deleteReferencesResponse
 
UA_BrowseResponse browseResponse
 
UA_RegisterServerResponse registerServerResponse
 
UA_BrowseNextResponse browseNextResponse
 
UA_CloseSessionResponse closeSessionResponse
 
UA_RegisterServer2Response registerServer2Response
 
UA_SetMonitoringModeResponse setMonitoringModeResponse
 
UA_UnregisterNodesResponse unregisterNodesResponse
 
UA_CallResponse callResponse
 
UA_AddReferencesResponse addReferencesResponse
 
UA_DeleteNodesResponse deleteNodesResponse
 
UA_CreateSubscriptionResponse createSubscriptionResponse
 
UA_RegisterNodesResponse registerNodesResponse
 
UA_ModifyMonitoredItemsResponse modifyMonitoredItemsResponse
 
UA_PublishResponse publishResponse
 
UA_TranslateBrowsePathsToNodeIdsResponse translateBrowsePathsToNodeIdsResponse