open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
ua_server_internal.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright 2019 (c) Fraunhofer IOSB (Author: Klaus Schick)
6 * Copyright 2014-2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
7 * Copyright 2014, 2017 (c) Florian Palm
8 * Copyright 2015-2016 (c) Sten GrĂ¼ner
9 * Copyright 2015 (c) Chris Iatrou
10 * Copyright 2015-2016 (c) Oleksiy Vasylyev
11 * Copyright 2016-2017 (c) Stefan Profanter, fortiss GmbH
12 * Copyright 2017 (c) Julian Grothoff
13 * Copyright 2019 (c) Kalycito Infotech Private Limited
14 * Copyright 2019 (c) HMS Industrial Networks AB (Author: Jonas Green)
15 */
16
17#ifndef UA_SERVER_INTERNAL_H_
18#define UA_SERVER_INTERNAL_H_
19
20#include <open62541/server.h>
22
24#include "ua_session.h"
25#include "ua_server_async.h"
26#include "ua_timer.h"
27#include "ua_util_internal.h"
28#include "ziptree.h"
29
31
32#if UA_MULTITHREADING >= 100
33#undef UA_THREADSAFE
34#define UA_THREADSAFE UA_DEPRECATED
35#endif
36
37#ifdef UA_ENABLE_PUBSUB
38#include "ua_pubsub_manager.h"
39#endif
40
41#ifdef UA_ENABLE_DISCOVERY
43#endif
44
45#ifdef UA_ENABLE_SUBSCRIPTIONS
46#include "ua_subscription.h"
47
48typedef struct {
50 void *context;
51 union {
53 /* UA_Server_EventNotificationCallback eventCallback; */
54 } callback;
56
57#endif
58
67
73
79
84
85struct UA_Server {
86 /* Config */
89 UA_DateTime endTime; /* Zeroed out. If a time is set, then the server shuts
90 * down once the time has been reached */
91
93
94 /* SecureChannels */
98
99#if UA_MULTITHREADING >= 100
100 UA_AsyncManager asyncManager;
101#endif
102
103 /* Session Management */
104 LIST_HEAD(session_list, session_list_entry) sessions;
107 UA_Session adminSession; /* Local access to the services (for startup and
108 * maintenance) uses this Session with all possible
109 * access rights (Session Id: 1) */
110
111 /* Namespaces */
114
115 /* Callbacks with a repetition interval */
117
118 /* For bootstrapping, omit some consistency checks, creating a reference to
119 * the parent and member instantiation */
121
122 /* Discovery */
123#ifdef UA_ENABLE_DISCOVERY
125#endif
126
127 /* Subscriptions */
128#ifdef UA_ENABLE_SUBSCRIPTIONS
129 size_t subscriptionsSize; /* Number of active subscriptions */
130 size_t monitoredItemsSize; /* Number of active monitored items */
131 LIST_HEAD(, UA_Subscription) subscriptions; /* All subscriptions in the
132 * server. They may be detached
133 * from a session. */
134 UA_UInt32 lastSubscriptionId; /* To generate unique SubscriptionIds */
135
136 /* To be cast to UA_LocalMonitoredItem to get the callback and context */
137 LIST_HEAD(, UA_MonitoredItem) localMonitoredItems;
139
140# ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS
141 LIST_HEAD(, UA_ConditionSource) conditionSources;
142# endif
143
144#endif
145
146 /* Publish/Subscribe */
147#ifdef UA_ENABLE_PUBSUB
149#endif
150
151#if UA_MULTITHREADING >= 100
152 UA_Lock networkMutex;
153 UA_Lock serviceMutex;
154#endif
155
156 /* Statistics */
160};
161
162
163/** References Handling */
164
165
166extern const struct aa_head refNameTree;
167
168const UA_ReferenceTarget *
170 const UA_ExpandedNodeId *targetId);
171
172
173/** SecureChannel Handling */
174
175
176/** Remove all securechannels */
177void
179
180/** Remove timed out securechannels with a delayed callback. So all currently
181 * scheduled jobs with a pointer to a securechannel can finish first. */
182void
184
187
190 const UA_AsymmetricAlgorithmSecurityHeader *asymHeader);
191
194 UA_UInt32 requestHandle, UA_StatusCode statusCode);
195
196void
198 UA_DiagnosticEvent event);
199
200/** Gets the a pointer to the context of a security policy supported by the
201 * server matched by the security policy uri. */
204 const UA_ByteString *securityPolicyUri);
205
206
207
208/** Session Handling */
209
210
212getNamespaceByName(UA_Server *server, const UA_String namespaceUri,
213 size_t *foundIndex);
214
216getNamespaceByIndex(UA_Server *server, const size_t namespaceIndex,
217 UA_String *foundUri);
218
221 const UA_NodeId *token, UA_Session **session);
222
225 const UA_CreateSessionRequest *request, UA_Session **session);
226
227void
229 UA_DiagnosticEvent event);
230
233 UA_DiagnosticEvent event);
234
235void
237
239getSessionByToken(UA_Server *server, const UA_NodeId *token);
240
243
244
245/** Node Handling */
246
247
248/** Calls the callback with the node retrieved from the nodestore on top of the
249 * stack. Either a copy or the original node for in-situ editing. Depends on
250 * multithreading and the nodestore.*/
252 UA_Node *node, void*);
254 const UA_NodeId *nodeId,
255 UA_EditNodeCallback callback,
256 void *data);
257
258
259/** Utility Functions */
260
261
262void setupNs1Uri(UA_Server *server);
264
267
268/** Recursively searches "upwards" in the tree following specific reference types */
270isNodeInTree(UA_Server *server, const UA_NodeId *leafNode,
271 const UA_NodeId *nodeToFind, const UA_ReferenceTypeSet *relevantRefs);
272
273/** Convenience function with just a single ReferenceTypeIndex */
276 const UA_NodeId *nodeToFind, const UA_Byte relevantRefTypeIndex);
277
278/** Returns an array with the hierarchy of nodes. The start nodes can be returned
279 * as well. The returned array starts at the leaf and continues "upwards" or
280 * "downwards". Duplicate entries are removed. */
282browseRecursive(UA_Server *server, size_t startNodesSize, const UA_NodeId *startNodes,
283 UA_BrowseDirection browseDirection, const UA_ReferenceTypeSet *refTypes,
284 UA_UInt32 nodeClassMask, UA_Boolean includeStartNodes,
285 size_t *resultsSize, UA_ExpandedNodeId **results);
286
287/** Get the bitfield indices of a ReferenceType and possibly its subtypes.
288 * refType must point to a ReferenceTypeNode. */
291 UA_ReferenceTypeSet *indices, UA_Boolean includeSubtypes);
292
293/** Returns the recursive type and interface hierarchy of the node */
296 UA_NodeId **typeHierarchy, size_t *typeHierarchySize);
297
298/** Returns the recursive interface hierarchy of the node */
300getAllInterfaceChildNodeIds(UA_Server *server, const UA_NodeId *objectNode, const UA_NodeId *objectTypeNode,
301 UA_NodeId **interfaceChildNodes, size_t *interfaceChildNodesSize);
302
303#ifdef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS
304
306UA_getConditionId(UA_Server *server, const UA_NodeId *conditionNodeId,
307 UA_NodeId *outConditionId);
308
309void
310UA_ConditionList_delete(UA_Server *server);
311
313isConditionOrBranch(UA_Server *server,
314 const UA_NodeId *condition,
315 const UA_NodeId *conditionSource,
316 UA_Boolean *isCallerAC);
317
318#endif /* UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS */
319
320/** Returns the type node from the node on the stack top. The type node is pushed
321 * on the stack and returned. */
322const UA_Node *
323getNodeType(UA_Server *server, const UA_NodeHead *nodeHead);
324
327 UA_UInt32 requestId, UA_Response *response, const UA_DataType *responseType);
328
329/** Many services come as an array of operations. This function generalizes the
330 * processing of the operations. */
331typedef void (*UA_ServiceOperation)(UA_Server *server, UA_Session *session,
332 const void *context,
333 const void *requestOperation,
334 void *responseOperation);
335
338 UA_ServiceOperation operationCallback,
339 const void *context,
340 const size_t *requestOperations,
341 const UA_DataType *requestOperationsType,
342 size_t *responseOperations,
343 const UA_DataType *responseOperationsType)
344 ;
345
346
347/** Internal function calls, without locks */
348
350deleteNode(UA_Server *server, const UA_NodeId nodeId,
351 UA_Boolean deleteReferences);
352
354addNode(UA_Server *server, const UA_NodeClass nodeClass, const UA_NodeId *requestedNewNodeId,
355 const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId,
356 const UA_QualifiedName browseName, const UA_NodeId *typeDefinition,
357 const UA_NodeAttributes *attr, const UA_DataType *attributeType,
358 void *nodeContext, UA_NodeId *outNewNodeId);
359
361addRef(UA_Server *server, UA_Session *session, const UA_NodeId *sourceId,
362 const UA_NodeId *referenceTypeId, const UA_NodeId *targetId,
363 UA_Boolean forward);
364
367 const UA_DataSource dataSource);
368
371 const UA_NodeId *nodeId, const UA_AttributeId attributeId,
372 const void *attr, const UA_DataType *attr_type);
373
374static UA_StatusCode
375writeValueAttribute(UA_Server *server, UA_Session *session,
376 const UA_NodeId *nodeId, const UA_Variant *value) {
377 return writeAttribute(server, session, nodeId, UA_ATTRIBUTEID_VALUE,
378 value, &UA_TYPES[UA_TYPES_VARIANT]);
379}
380
383 UA_TimestampsToReturn timestamps);
384
386readWithReadValue(UA_Server *server, const UA_NodeId *nodeId,
387 const UA_AttributeId attributeId, void *v);
388
390readObjectProperty(UA_Server *server, const UA_NodeId objectId,
391 const UA_QualifiedName propertyName,
392 UA_Variant *value);
393
396
397#ifdef UA_ENABLE_SUBSCRIPTIONS
398
400
403
404#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS
406triggerEvent(UA_Server *server, const UA_NodeId eventNodeId,
407 const UA_NodeId origin, UA_ByteString *outEventId,
408 const UA_Boolean deleteEventNode);
409
410/** Filters the given event with the given filter and writes the results into a
411 * notification */
414 const UA_NodeId *eventNode, UA_EventFilter *filter,
416
417#endif /* UA_ENABLE_SUBSCRIPTIONS_EVENTS */
418#endif /* UA_ENABLE_SUBSCRIPTIONS */
419
422 size_t browsePathSize, const UA_QualifiedName *browsePath);
423
426 const UA_QualifiedName propertyName, const UA_Variant value);
427
429getNodeContext(UA_Server *server, UA_NodeId nodeId, void **nodeContext);
430
432setNodeContext(UA_Server *server, UA_NodeId nodeId, void *nodeContext);
433
434void
435removeCallback(UA_Server *server, UA_UInt64 callbackId);
436
439
442 void *data, UA_Double interval_ms, UA_UInt64 *callbackId);
443
444#ifdef UA_ENABLE_DISCOVERY
447 void *client,
448 const UA_Boolean isUnregister,
449 const char* semaphoreFilePath);
450#endif
451
452
453/** RefTree */
454
455
456/** A RefTree is a sorted set of NodeIds that ensures we consider each node just
457 * once. It holds a single array for both the ExpandedNodeIds and the entries of
458 * a tree-structure for fast lookup. A single realloc operation (with some
459 * pointer repairing) can be used to increase the capacity of the RefTree.
460 *
461 * When the RefTree is complete, the tree-part at the end of the targets array
462 * can be ignored / cut away to use it as a simple ExpandedNodeId array.
463 *
464 * The layout of the targets array is as follows:
465 *
466 * | Targets [ExpandedNodeId, n times] | Tree [RefEntry, n times] | */
467
468#define UA_REFTREE_INITIAL_SIZE 16
469
470typedef struct RefEntry {
471 ZIP_ENTRY(RefEntry) zipfields;
473 UA_UInt32 targetHash; /* Hash of the target nodeid */
475
477typedef struct RefHead RefHead;
478
479typedef struct {
482 size_t capacity; /* available space */
483 size_t size; /* used space */
484} RefTree;
485
488
490
492RefTree_addNodeId(RefTree *rt, const UA_NodeId *target, UA_Boolean *duplicate);
493
496
499
500
501/** Check Information Model Consistency */
502
503
504/** Read a node attribute in the context of a "checked-out" node. So the
505 * attribute will not be copied when possible. The variant then points into the
506 * node and has UA_VARIANT_DATA_NODELETE set. */
507void
508ReadWithNode(const UA_Node *node, UA_Server *server, UA_Session *session,
509 UA_TimestampsToReturn timestampsToReturn,
510 const UA_ReadValueId *id, UA_DataValue *v);
511
514 const UA_VariableNode *vn, UA_DataValue *v);
515
516/** Test whether the value matches a variable definition given by
517 * - datatype
518 * - valueranke
519 * - array dimensions.
520 * Sometimes it can be necessary to transform the content of the value, e.g.
521 * byte array to bytestring or uint32 to some enum. If editableValue is non-NULL,
522 * we try to create a matching variant that points to the original data.
523 *
524 * The reason is set whenever the return value is false */
526compatibleValue(UA_Server *server, UA_Session *session, const UA_NodeId *targetDataTypeId,
527 UA_Int32 targetValueRank, size_t targetArrayDimensionsSize,
528 const UA_UInt32 *targetArrayDimensions, const UA_Variant *value,
529 const UA_NumericRange *range, const char **reason);
530
531/** Is the DataType compatible */
533compatibleDataTypes(UA_Server *server, const UA_NodeId *dataType,
534 const UA_NodeId *constraintDataType);
535
536/** Set to the target type if compatible */
537void
539 const UA_NodeId *targetDataTypeId);
540
541/** Is the Value compatible with the DataType? Can perform additional checks
542 * compared to compatibleDataTypes. */
545 const UA_NodeId *constraintDataType);
546
547
549compatibleArrayDimensions(size_t constraintArrayDimensionsSize,
550 const UA_UInt32 *constraintArrayDimensions,
551 size_t testArrayDimensionsSize,
552 const UA_UInt32 *testArrayDimensions);
553
555compatibleValueArrayDimensions(const UA_Variant *value, size_t targetArrayDimensionsSize,
556 const UA_UInt32 *targetArrayDimensions);
557
560 UA_Int32 valueRank, size_t arrayDimensionsSize);
561
563compatibleValueRanks(UA_Int32 valueRank, UA_Int32 constraintValueRank);
564
569
570void
571Operation_Browse(UA_Server *server, UA_Session *session, const UA_UInt32 *maxrefs,
572 const UA_BrowseDescription *descr, UA_BrowseResult *result);
573
576 const UA_ReadValueId *item,
577 UA_TimestampsToReturn timestampsToReturn);
578
579
580/** AddNodes Begin and Finish */
581
582
583/** Creates a new node in the nodestore. */
585AddNode_raw(UA_Server *server, UA_Session *session, void *nodeContext,
586 const UA_AddNodesItem *item, UA_NodeId *outNewNodeId);
587
588/** Check the reference to the parent node; Add references. */
590AddNode_addRefs(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId,
591 const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId,
592 const UA_NodeId *typeDefinitionId);
593
594/** Type-check type-definition; Run the constructors */
596AddNode_finish(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId);
597
598
599/** Create Namespace 0 */
600
601
603
605 size_t length, const UA_DataType *type);
606
607#ifdef UA_ENABLE_DIAGNOSTICS
608void createSessionObject(UA_Server *server, UA_Session *session);
609
610void createSubscriptionObject(UA_Server *server, UA_Session *session,
611 UA_Subscription *sub);
612
614readDiagnostics(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext,
615 const UA_NodeId *nodeId, void *nodeContext, UA_Boolean sourceTimestamp,
616 const UA_NumericRange *range, UA_DataValue *value);
617
619readSubscriptionDiagnosticsArray(UA_Server *server,
620 const UA_NodeId *sessionId, void *sessionContext,
621 const UA_NodeId *nodeId, void *nodeContext,
622 UA_Boolean sourceTimestamp,
623 const UA_NumericRange *range, UA_DataValue *value);
624
626readSessionDiagnosticsArray(UA_Server *server,
627 const UA_NodeId *sessionId, void *sessionContext,
628 const UA_NodeId *nodeId, void *nodeContext,
629 UA_Boolean sourceTimestamp,
630 const UA_NumericRange *range, UA_DataValue *value);
631
633readSessionSecurityDiagnostics(UA_Server *server,
634 const UA_NodeId *sessionId, void *sessionContext,
635 const UA_NodeId *nodeId, void *nodeContext,
636 UA_Boolean sourceTimestamp,
637 const UA_NumericRange *range, UA_DataValue *value);
638#endif
639
640
641/** Nodestore Access Macros */
642
643
644#define UA_NODESTORE_NEW(server, nodeClass) \
645 server->config.nodestore.newNode(server->config.nodestore.context, nodeClass)
646
647#define UA_NODESTORE_DELETE(server, node) \
648 server->config.nodestore.deleteNode(server->config.nodestore.context, node)
649
650#define UA_NODESTORE_GET(server, nodeid) \
651 server->config.nodestore.getNode(server->config.nodestore.context, nodeid)
652
653/** Returns NULL if the target is an external Reference (per the ExpandedNodeId) */
654const UA_Node *
656
657#define UA_NODESTORE_RELEASE(server, node) \
658 server->config.nodestore.releaseNode(server->config.nodestore.context, node)
659
660#define UA_NODESTORE_GETCOPY(server, nodeid, outnode) \
661 server->config.nodestore.getNodeCopy(server->config.nodestore.context, \
662 nodeid, outnode)
663
664#define UA_NODESTORE_INSERT(server, node, addedNodeId) \
665 server->config.nodestore.insertNode(server->config.nodestore.context, \
666 node, addedNodeId)
667
668#define UA_NODESTORE_REPLACE(server, node) \
669 server->config.nodestore.replaceNode(server->config.nodestore.context, node)
670
671#define UA_NODESTORE_REMOVE(server, nodeId) \
672 server->config.nodestore.removeNode(server->config.nodestore.context, nodeId)
673
674#define UA_NODESTORE_GETREFERENCETYPEID(server, index) \
675 server->config.nodestore.getReferenceTypeId(server->config.nodestore.context, \
676 index)
677
679
680#endif /* UA_SERVER_INTERNAL_H_ */
UA_AttributeId
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition common.h:21
@ UA_ATTRIBUTEID_VALUE
Definition common.h:34
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
#define LIST_HEAD(name, type)
void(* UA_Server_DataChangeNotificationCallback)(UA_Server *server, UA_UInt32 monitoredItemId, void *monitoredItemContext, const UA_NodeId *nodeId, void *nodeContext, UA_UInt32 attributeId, const UA_DataValue *value)
Definition server.h:897
UA_Boolean recursive
UA_UInt32 maxReferences
const UA_ExpandedNodeId * target
UA_UInt32 targetHash
ZIP_ENTRY(RefEntry) zipfields
UA_ExpandedNodeId * targets
This Source Code Form is subject to the terms of the Mozilla Public License, v.
UA_Server_DataChangeNotificationCallback dataChangeCallback
UA_MonitoredItem monitoredItem
Every Node starts with these attributes.
Definition nodestore.h:277
List of reference targets with the same reference type and direction.
Definition nodestore.h:243
This Source Code Form is subject to the terms of the Mozilla Public License, v.
UA_DateTime startTime
UA_UInt32 activeSessionCount
UA_String * namespaces
UA_ServerConfig config
UA_Session adminSession
UA_UInt32 lastChannelId
TAILQ_HEAD(, channel_entry) channels
UA_UInt32 lastSubscriptionId
UA_DiscoveryManager discoveryManager
UA_SecureChannelStatistics secureChannelStatistics
UA_UInt32 lastTokenId
UA_DateTime endTime
UA_PubSubManager pubSubManager
LIST_HEAD(, UA_MonitoredItem) localMonitoredItems
UA_UInt32 sessionCount
UA_UInt32 lastLocalMonitoredItemId
size_t subscriptionsSize
UA_ServerDiagnosticsSummaryDataType serverDiagnosticsSummary
size_t monitoredItemsSize
LIST_HEAD(session_list, session_list_entry) sessions
UA_ServerLifecycle state
UA_NetworkStatistics networkStatistics
UA_Boolean bootstrapNS0
LIST_HEAD(, UA_Subscription) subscriptions
Subscriptions are managed in a server-wide linked list.
UA_SecureChannel channel
UA_TimerEntry cleanupCallback
TAILQ_ENTRY(channel_entry) pointers
LIST_ENTRY(session_list_entry) pointers
UA_TimerEntry cleanupCallback
UA_Session session
int32_t UA_Int32
Definition types.h:51
_UA_BEGIN_DECLS typedef bool UA_Boolean
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition types.h:26
uint16_t UA_UInt16
Definition types.h:46
uint32_t UA_UInt32
Definition types.h:56
int64_t UA_DateTime
Definition types.h:144
uint32_t UA_StatusCode
Definition types.h:77
double UA_Double
Definition types.h:74
uint8_t UA_Byte
Definition types.h:36
uint64_t UA_UInt64
Definition types.h:66
#define UA_TYPES_VARIANT
UA_BrowseDirection
UA_TimestampsToReturn
const UA_DataType UA_TYPES[191]
UA_NodeClass
UA_StatusCode RefTree_init(RefTree *rt)
UA_StatusCode filterEvent(UA_Server *server, UA_Session *session, const UA_NodeId *eventNode, UA_EventFilter *filter, UA_EventFieldList *efl, UA_EventFilterResult *result)
Filters the given event with the given filter and writes the results into a notification.
UA_Session * getSessionByToken(UA_Server *server, const UA_NodeId *token)
UA_StatusCode readObjectProperty(UA_Server *server, const UA_NodeId objectId, const UA_QualifiedName propertyName, UA_Variant *value)
UA_Boolean compatibleValue(UA_Server *server, UA_Session *session, const UA_NodeId *targetDataTypeId, UA_Int32 targetValueRank, size_t targetArrayDimensionsSize, const UA_UInt32 *targetArrayDimensions, const UA_Variant *value, const UA_NumericRange *range, const char **reason)
Test whether the value matches a variable definition given by.
UA_StatusCode addNode(UA_Server *server, const UA_NodeClass nodeClass, const UA_NodeId *requestedNewNodeId, const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId, const UA_QualifiedName browseName, const UA_NodeId *typeDefinition, const UA_NodeAttributes *attr, const UA_DataType *attributeType, void *nodeContext, UA_NodeId *outNewNodeId)
void UA_Server_deleteSecureChannels(UA_Server *server)
SecureChannel Handling.
UA_Boolean isNodeInTree(UA_Server *server, const UA_NodeId *leafNode, const UA_NodeId *nodeToFind, const UA_ReferenceTypeSet *relevantRefs)
Recursively searches "upwards" in the tree following specific reference types.
UA_Boolean compatibleValueArrayDimensions(const UA_Variant *value, size_t targetArrayDimensionsSize, const UA_UInt32 *targetArrayDimensions)
void UA_Server_cleanupTimedOutSecureChannels(UA_Server *server, UA_DateTime nowMonotonic)
Remove timed out securechannels with a delayed callback.
UA_StatusCode addRepeatedCallback(UA_Server *server, UA_ServerCallback callback, void *data, UA_Double interval_ms, UA_UInt64 *callbackId)
void Operation_Browse(UA_Server *server, UA_Session *session, const UA_UInt32 *maxrefs, const UA_BrowseDescription *descr, UA_BrowseResult *result)
UA_UInt16 addNamespace(UA_Server *server, const UA_String name)
UA_StatusCode referenceTypeIndices(UA_Server *server, const UA_NodeId *refType, UA_ReferenceTypeSet *indices, UA_Boolean includeSubtypes)
Get the bitfield indices of a ReferenceType and possibly its subtypes.
UA_StatusCode sendResponse(UA_Server *server, UA_Session *session, UA_SecureChannel *channel, UA_UInt32 requestId, UA_Response *response, const UA_DataType *responseType)
UA_StatusCode UA_Server_configSecureChannel(void *application, UA_SecureChannel *channel, const UA_AsymmetricAlgorithmSecurityHeader *asymHeader)
UA_Boolean RefTree_contains(RefTree *rt, const UA_ExpandedNodeId *target)
UA_StatusCode deleteNode(UA_Server *server, const UA_NodeId nodeId, UA_Boolean deleteReferences)
Internal function calls, without locks.
UA_StatusCode UA_Server_createSession(UA_Server *server, UA_SecureChannel *channel, const UA_CreateSessionRequest *request, UA_Session **session)
struct channel_entry channel_entry
UA_StatusCode readValueAttribute(UA_Server *server, UA_Session *session, const UA_VariableNode *vn, UA_DataValue *v)
UA_StatusCode changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId, UA_Double interval_ms)
void UA_Server_closeSecureChannel(UA_Server *server, UA_SecureChannel *channel, UA_DiagnosticEvent event)
UA_StatusCode UA_Server_initNS0(UA_Server *server)
Create Namespace 0.
UA_StatusCode addRef(UA_Server *server, UA_Session *session, const UA_NodeId *sourceId, const UA_NodeId *referenceTypeId, const UA_NodeId *targetId, UA_Boolean forward)
UA_StatusCode triggerEvent(UA_Server *server, const UA_NodeId eventNodeId, const UA_NodeId origin, UA_ByteString *outEventId, const UA_Boolean deleteEventNode)
UA_BrowsePathResult browseSimplifiedBrowsePath(UA_Server *server, const UA_NodeId origin, size_t browsePathSize, const UA_QualifiedName *browsePath)
UA_StatusCode RefTree_addNodeId(RefTree *rt, const UA_NodeId *target, UA_Boolean *duplicate)
UA_Boolean UA_Node_hasSubTypeOrInstances(const UA_NodeHead *head)
UA_SecurityPolicy * getSecurityPolicyByUri(const UA_Server *server, const UA_ByteString *securityPolicyUri)
Gets the a pointer to the context of a security policy supported by the server matched by the securit...
UA_Boolean compatibleArrayDimensions(size_t constraintArrayDimensionsSize, const UA_UInt32 *constraintArrayDimensions, size_t testArrayDimensionsSize, const UA_UInt32 *testArrayDimensions)
UA_BrowsePathResult translateBrowsePathToNodeIds(UA_Server *server, const UA_BrowsePath *browsePath)
UA_StatusCode writeNs0VariableArray(UA_Server *server, UA_UInt32 id, void *v, size_t length, const UA_DataType *type)
UA_StatusCode getNamespaceByIndex(UA_Server *server, const size_t namespaceIndex, UA_String *foundUri)
UA_StatusCode setVariableNode_dataSource(UA_Server *server, const UA_NodeId nodeId, const UA_DataSource dataSource)
void ReadWithNode(const UA_Node *node, UA_Server *server, UA_Session *session, UA_TimestampsToReturn timestampsToReturn, const UA_ReadValueId *id, UA_DataValue *v)
Check Information Model Consistency.
void monitoredItem_sampleCallback(UA_Server *server, UA_MonitoredItem *monitoredItem)
UA_Subscription * UA_Server_getSubscriptionById(UA_Server *server, UA_UInt32 subscriptionId)
UA_StatusCode UA_Server_editNode(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId, UA_EditNodeCallback callback, void *data)
const UA_Node * getNodeType(UA_Server *server, const UA_NodeHead *nodeHead)
Returns the type node from the node on the stack top.
UA_ServerLifecycle
@ UA_SERVERLIFECYCLE_FRESH
@ UA_SERVERLIFECYLE_RUNNING
UA_StatusCode browseRecursive(UA_Server *server, size_t startNodesSize, const UA_NodeId *startNodes, UA_BrowseDirection browseDirection, const UA_ReferenceTypeSet *refTypes, UA_UInt32 nodeClassMask, UA_Boolean includeStartNodes, size_t *resultsSize, UA_ExpandedNodeId **results)
Returns an array with the hierarchy of nodes.
void UA_Server_removeSession(UA_Server *server, session_list_entry *sentry, UA_DiagnosticEvent event)
UA_DiagnosticEvent
@ UA_DIAGNOSTICEVENT_REJECT
@ UA_DIAGNOSTICEVENT_ABORT
@ UA_DIAGNOSTICEVENT_CLOSE
@ UA_DIAGNOSTICEVENT_PURGE
@ UA_DIAGNOSTICEVENT_SECURITYREJECT
@ UA_DIAGNOSTICEVENT_TIMEOUT
const UA_Node * UA_NODESTORE_GETFROMREF(UA_Server *server, UA_NodePointer target)
Returns NULL if the target is an external Reference (per the ExpandedNodeId)
UA_StatusCode(* UA_EditNodeCallback)(UA_Server *, UA_Session *, UA_Node *node, void *)
Node Handling.
UA_Boolean compatibleValueRankArrayDimensions(UA_Server *server, UA_Session *session, UA_Int32 valueRank, size_t arrayDimensionsSize)
UA_Boolean compatibleDataTypes(UA_Server *server, const UA_NodeId *dataType, const UA_NodeId *constraintDataType)
Is the DataType compatible.
UA_Session * UA_Server_getSessionById(UA_Server *server, const UA_NodeId *sessionId)
UA_StatusCode writeObjectProperty(UA_Server *server, const UA_NodeId objectId, const UA_QualifiedName propertyName, const UA_Variant value)
UA_StatusCode AddNode_finish(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId)
Type-check type-definition; Run the constructors.
UA_StatusCode UA_Server_createSecureChannel(UA_Server *server, UA_Connection *connection)
void setupNs1Uri(UA_Server *server)
Utility Functions.
void UA_Server_cleanupSessions(UA_Server *server, UA_DateTime nowMonotonic)
UA_Boolean isNodeInTree_singleRef(UA_Server *server, const UA_NodeId *leafNode, const UA_NodeId *nodeToFind, const UA_Byte relevantRefTypeIndex)
Convenience function with just a single ReferenceTypeIndex.
UA_StatusCode register_server_with_discovery_server(UA_Server *server, void *client, const UA_Boolean isUnregister, const char *semaphoreFilePath)
UA_StatusCode readWithReadValue(UA_Server *server, const UA_NodeId *nodeId, const UA_AttributeId attributeId, void *v)
struct RefEntry RefEntry
UA_StatusCode sendServiceFault(UA_SecureChannel *channel, UA_UInt32 requestId, UA_UInt32 requestHandle, UA_StatusCode statusCode)
const struct aa_head refNameTree
References Handling.
const UA_ReferenceTarget * UA_NodeReferenceKind_findTarget(const UA_NodeReferenceKind *rk, const UA_ExpandedNodeId *targetId)
UA_StatusCode AddNode_raw(UA_Server *server, UA_Session *session, void *nodeContext, const UA_AddNodesItem *item, UA_NodeId *outNewNodeId)
AddNodes Begin and Finish.
struct RefHead RefHead
UA_StatusCode UA_Server_removeSessionByToken(UA_Server *server, const UA_NodeId *token, UA_DiagnosticEvent event)
UA_StatusCode writeAttribute(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId, const UA_AttributeId attributeId, const void *attr, const UA_DataType *attr_type)
UA_Boolean RefTree_containsNodeId(RefTree *rt, const UA_NodeId *target)
UA_StatusCode getNamespaceByName(UA_Server *server, const UA_String namespaceUri, size_t *foundIndex)
Session Handling.
UA_StatusCode getAllInterfaceChildNodeIds(UA_Server *server, const UA_NodeId *objectNode, const UA_NodeId *objectTypeNode, UA_NodeId **interfaceChildNodes, size_t *interfaceChildNodesSize)
Returns the recursive interface hierarchy of the node.
void adjustValueType(UA_Server *server, UA_Variant *value, const UA_NodeId *targetDataTypeId)
Set to the target type if compatible.
UA_StatusCode getParentTypeAndInterfaceHierarchy(UA_Server *server, const UA_NodeId *typeNode, UA_NodeId **typeHierarchy, size_t *typeHierarchySize)
Returns the recursive type and interface hierarchy of the node.
UA_StatusCode AddNode_addRefs(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId, const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId, const UA_NodeId *typeDefinitionId)
Check the reference to the parent node; Add references.
void removeCallback(UA_Server *server, UA_UInt64 callbackId)
UA_StatusCode getBoundSession(UA_Server *server, const UA_SecureChannel *channel, const UA_NodeId *token, UA_Session **session)
struct session_list_entry session_list_entry
void(* UA_ServiceOperation)(UA_Server *server, UA_Session *session, const void *context, const void *requestOperation, void *responseOperation)
Many services come as an array of operations.
void RefTree_clear(RefTree *rt)
UA_Boolean compatibleValueRanks(UA_Int32 valueRank, UA_Int32 constraintValueRank)
UA_StatusCode setNodeContext(UA_Server *server, UA_NodeId nodeId, void *nodeContext)
UA_DataValue readAttribute(UA_Server *server, const UA_ReadValueId *item, UA_TimestampsToReturn timestamps)
UA_StatusCode UA_Server_processServiceOperations(UA_Server *server, UA_Session *session, UA_ServiceOperation operationCallback, const void *context, const size_t *requestOperations, const UA_DataType *requestOperationsType, size_t *responseOperations, const UA_DataType *responseOperationsType)
UA_StatusCode getNodeContext(UA_Server *server, UA_NodeId nodeId, void **nodeContext)
UA_Boolean compatibleValueDataType(UA_Server *server, const UA_DataType *dataType, const UA_NodeId *constraintDataType)
Is the Value compatible with the DataType? Can perform additional checks compared to compatibleDataTy...
UA_DataValue UA_Server_readWithSession(UA_Server *server, UA_Session *session, const UA_ReadValueId *item, UA_TimestampsToReturn timestampsToReturn)
struct UA_ConditionSource UA_ConditionSource
Tagged Pointer structure.
Definition nodestore.h:170
void(* UA_ServerCallback)(UA_Server *server, void *data)
Definition util.h:25
#define ZIP_HEAD(name, type)
Reusable zip tree implementation.
Definition ziptree.h:41