ua_server.h 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  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. #ifndef UA_SERVER_H_
  5. #define UA_SERVER_H_
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #include "ua_types.h"
  10. #include "ua_types_generated.h"
  11. #include "ua_types_generated_handling.h"
  12. #include "ua_plugin_log.h"
  13. #include "ua_plugin_network.h"
  14. #include "ua_plugin_access_control.h"
  15. #include "ua_plugin_securitypolicy.h"
  16. /**
  17. * .. _server:
  18. *
  19. * Server
  20. * ======
  21. *
  22. * Server Configuration
  23. * --------------------
  24. * The configuration structure is passed to the server during initialization. */
  25. typedef struct {
  26. UA_UInt32 min;
  27. UA_UInt32 max;
  28. } UA_UInt32Range;
  29. typedef struct {
  30. UA_Double min;
  31. UA_Double max;
  32. } UA_DoubleRange;
  33. typedef struct {
  34. UA_UInt16 nThreads; /* only if multithreading is enabled */
  35. UA_Logger logger;
  36. /* Server Description */
  37. UA_BuildInfo buildInfo;
  38. UA_ApplicationDescription applicationDescription;
  39. #ifdef UA_ENABLE_DISCOVERY
  40. UA_String mdnsServerName;
  41. size_t serverCapabilitiesSize;
  42. UA_String *serverCapabilities;
  43. #endif
  44. /* Custom DataTypes */
  45. size_t customDataTypesSize;
  46. UA_DataType *customDataTypes;
  47. /* Networking */
  48. size_t networkLayersSize;
  49. UA_ServerNetworkLayer *networkLayers;
  50. /* Available endpoints */
  51. UA_Endpoints endpoints;
  52. /* Access Control */
  53. UA_AccessControl accessControl;
  54. /* Limits for SecureChannels */
  55. UA_UInt16 maxSecureChannels;
  56. UA_UInt32 maxSecurityTokenLifetime; /* in ms */
  57. /* Limits for Sessions */
  58. UA_UInt16 maxSessions;
  59. UA_Double maxSessionTimeout; /* in ms */
  60. /* Limits for Subscriptions */
  61. UA_DoubleRange publishingIntervalLimits;
  62. UA_UInt32Range lifeTimeCountLimits;
  63. UA_UInt32Range keepAliveCountLimits;
  64. UA_UInt32 maxNotificationsPerPublish;
  65. UA_UInt32 maxRetransmissionQueueSize; /* 0 -> unlimited size */
  66. /* Limits for MonitoredItems */
  67. UA_DoubleRange samplingIntervalLimits;
  68. UA_UInt32Range queueSizeLimits; /* Negotiated with the client */
  69. /* Discovery */
  70. #ifdef UA_ENABLE_DISCOVERY
  71. /* Timeout in seconds when to automatically remove a registered server from
  72. * the list, if it doesn't re-register within the given time frame. A value
  73. * of 0 disables automatic removal. Default is 60 Minutes (60*60). Must be
  74. * bigger than 10 seconds, because cleanup is only triggered approximately
  75. * ervery 10 seconds. The server will still be removed depending on the
  76. * state of the semaphore file. */
  77. UA_UInt32 discoveryCleanupTimeout;
  78. #endif
  79. } UA_ServerConfig;
  80. /**
  81. * .. _server-lifecycle:
  82. *
  83. * Server Lifecycle
  84. * ---------------- */
  85. UA_Server UA_EXPORT * UA_Server_new(const UA_ServerConfig *config);
  86. void UA_EXPORT UA_Server_delete(UA_Server *server);
  87. /* Runs the main loop of the server. In each iteration, this calls into the
  88. * networklayers to see if messages have arrived.
  89. *
  90. * @param server The server object.
  91. * @param running The loop is run as long as *running is true.
  92. * Otherwise, the server shuts down.
  93. * @return Returns the statuscode of the UA_Server_run_shutdown method */
  94. UA_StatusCode UA_EXPORT
  95. UA_Server_run(UA_Server *server, volatile UA_Boolean *running);
  96. /* The prologue part of UA_Server_run (no need to use if you call
  97. * UA_Server_run) */
  98. UA_StatusCode UA_EXPORT UA_Server_run_startup(UA_Server *server);
  99. /* Executes a single iteration of the server's main loop.
  100. *
  101. * @param server The server object.
  102. * @param waitInternal Should we wait for messages in the networklayer?
  103. * Otherwise, the timouts for the networklayers are set to zero.
  104. * The default max wait time is 50millisec.
  105. * @return Returns how long we can wait until the next scheduled
  106. * callback (in ms) */
  107. UA_UInt16 UA_EXPORT
  108. UA_Server_run_iterate(UA_Server *server, UA_Boolean waitInternal);
  109. /* The epilogue part of UA_Server_run (no need to use if you call
  110. * UA_Server_run) */
  111. UA_StatusCode UA_EXPORT UA_Server_run_shutdown(UA_Server *server);
  112. /**
  113. * Repeated Callbacks
  114. * ------------------ */
  115. typedef void (*UA_ServerCallback)(UA_Server *server, void *data);
  116. /* Add a callback for cyclic repetition to the server.
  117. *
  118. * @param server The server object.
  119. * @param callback The callback that shall be added.
  120. * @param interval The callback shall be repeatedly executed with the given interval
  121. * (in ms). The interval must be larger than 5ms. The first execution
  122. * occurs at now() + interval at the latest.
  123. * @param callbackId Set to the identifier of the repeated callback . This can be used to cancel
  124. * the callback later on. If the pointer is null, the identifier is not set.
  125. * @return Upon success, UA_STATUSCODE_GOOD is returned.
  126. * An error code otherwise. */
  127. UA_StatusCode UA_EXPORT
  128. UA_Server_addRepeatedCallback(UA_Server *server, UA_ServerCallback callback,
  129. void *data, UA_UInt32 interval, UA_UInt64 *callbackId);
  130. UA_StatusCode UA_EXPORT
  131. UA_Server_changeRepeatedCallbackInterval(UA_Server *server, UA_UInt64 callbackId,
  132. UA_UInt32 interval);
  133. /* Remove a repeated callback.
  134. *
  135. * @param server The server object.
  136. * @param callbackId The id of the callback that shall be removed.
  137. * @return Upon sucess, UA_STATUSCODE_GOOD is returned.
  138. * An error code otherwise. */
  139. UA_StatusCode UA_EXPORT
  140. UA_Server_removeRepeatedCallback(UA_Server *server, UA_UInt64 callbackId);
  141. /**
  142. * Reading and Writing Node Attributes
  143. * -----------------------------------
  144. * The functions for reading and writing node attributes call the regular read
  145. * and write service in the background that are also used over the network.
  146. *
  147. * The following attributes cannot be read, since the local "admin" user always
  148. * has full rights.
  149. *
  150. * - UserWriteMask
  151. * - UserAccessLevel
  152. * - UserExecutable */
  153. /* Read an attribute of a node. The specialized functions below provide a more
  154. * concise syntax.
  155. *
  156. * @param server The server object.
  157. * @param item ReadValueIds contain the NodeId of the target node, the id of the
  158. * attribute to read and (optionally) an index range to read parts
  159. * of an array only. See the section on NumericRange for the format
  160. * used for array ranges.
  161. * @param timestamps Which timestamps to return for the attribute.
  162. * @return Returns a DataValue that contains either an error code, or a variant
  163. * with the attribute value and the timestamps. */
  164. UA_DataValue UA_EXPORT
  165. UA_Server_read(UA_Server *server, const UA_ReadValueId *item,
  166. UA_TimestampsToReturn timestamps);
  167. /* Don't use this function. There are typed versions for every supported
  168. * attribute. */
  169. UA_StatusCode UA_EXPORT
  170. __UA_Server_read(UA_Server *server, const UA_NodeId *nodeId,
  171. UA_AttributeId attributeId, void *v);
  172. static UA_INLINE UA_StatusCode
  173. UA_Server_readNodeId(UA_Server *server, const UA_NodeId nodeId,
  174. UA_NodeId *outNodeId) {
  175. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_NODEID, outNodeId);
  176. }
  177. static UA_INLINE UA_StatusCode
  178. UA_Server_readNodeClass(UA_Server *server, const UA_NodeId nodeId,
  179. UA_NodeClass *outNodeClass) {
  180. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_NODECLASS,
  181. outNodeClass);
  182. }
  183. static UA_INLINE UA_StatusCode
  184. UA_Server_readBrowseName(UA_Server *server, const UA_NodeId nodeId,
  185. UA_QualifiedName *outBrowseName) {
  186. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_BROWSENAME,
  187. outBrowseName);
  188. }
  189. static UA_INLINE UA_StatusCode
  190. UA_Server_readDisplayName(UA_Server *server, const UA_NodeId nodeId,
  191. UA_LocalizedText *outDisplayName) {
  192. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME,
  193. outDisplayName);
  194. }
  195. static UA_INLINE UA_StatusCode
  196. UA_Server_readDescription(UA_Server *server, const UA_NodeId nodeId,
  197. UA_LocalizedText *outDescription) {
  198. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_DESCRIPTION,
  199. outDescription);
  200. }
  201. static UA_INLINE UA_StatusCode
  202. UA_Server_readWriteMask(UA_Server *server, const UA_NodeId nodeId,
  203. UA_UInt32 *outWriteMask) {
  204. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_WRITEMASK,
  205. outWriteMask);
  206. }
  207. static UA_INLINE UA_StatusCode
  208. UA_Server_readIsAbstract(UA_Server *server, const UA_NodeId nodeId,
  209. UA_Boolean *outIsAbstract) {
  210. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_ISABSTRACT,
  211. outIsAbstract);
  212. }
  213. static UA_INLINE UA_StatusCode
  214. UA_Server_readSymmetric(UA_Server *server, const UA_NodeId nodeId,
  215. UA_Boolean *outSymmetric) {
  216. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_SYMMETRIC,
  217. outSymmetric);
  218. }
  219. static UA_INLINE UA_StatusCode
  220. UA_Server_readInverseName(UA_Server *server, const UA_NodeId nodeId,
  221. UA_LocalizedText *outInverseName) {
  222. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_INVERSENAME,
  223. outInverseName);
  224. }
  225. static UA_INLINE UA_StatusCode
  226. UA_Server_readContainsNoLoop(UA_Server *server, const UA_NodeId nodeId,
  227. UA_Boolean *outContainsNoLoops) {
  228. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_CONTAINSNOLOOPS,
  229. outContainsNoLoops);
  230. }
  231. static UA_INLINE UA_StatusCode
  232. UA_Server_readEventNotifier(UA_Server *server, const UA_NodeId nodeId,
  233. UA_Byte *outEventNotifier) {
  234. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER,
  235. outEventNotifier);
  236. }
  237. static UA_INLINE UA_StatusCode
  238. UA_Server_readValue(UA_Server *server, const UA_NodeId nodeId,
  239. UA_Variant *outValue) {
  240. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_VALUE, outValue);
  241. }
  242. static UA_INLINE UA_StatusCode
  243. UA_Server_readDataType(UA_Server *server, const UA_NodeId nodeId,
  244. UA_NodeId *outDataType) {
  245. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_DATATYPE,
  246. outDataType);
  247. }
  248. static UA_INLINE UA_StatusCode
  249. UA_Server_readValueRank(UA_Server *server, const UA_NodeId nodeId,
  250. UA_Int32 *outValueRank) {
  251. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_VALUERANK,
  252. outValueRank);
  253. }
  254. /* Returns a variant with an int32 array */
  255. static UA_INLINE UA_StatusCode
  256. UA_Server_readArrayDimensions(UA_Server *server, const UA_NodeId nodeId,
  257. UA_Variant *outArrayDimensions) {
  258. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_ARRAYDIMENSIONS,
  259. outArrayDimensions);
  260. }
  261. static UA_INLINE UA_StatusCode
  262. UA_Server_readAccessLevel(UA_Server *server, const UA_NodeId nodeId,
  263. UA_Byte *outAccessLevel) {
  264. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL,
  265. outAccessLevel);
  266. }
  267. static UA_INLINE UA_StatusCode
  268. UA_Server_readMinimumSamplingInterval(UA_Server *server, const UA_NodeId nodeId,
  269. UA_Double *outMinimumSamplingInterval) {
  270. return __UA_Server_read(server, &nodeId,
  271. UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL,
  272. outMinimumSamplingInterval);
  273. }
  274. static UA_INLINE UA_StatusCode
  275. UA_Server_readHistorizing(UA_Server *server, const UA_NodeId nodeId,
  276. UA_Boolean *outHistorizing) {
  277. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_HISTORIZING,
  278. outHistorizing);
  279. }
  280. static UA_INLINE UA_StatusCode
  281. UA_Server_readExecutable(UA_Server *server, const UA_NodeId nodeId,
  282. UA_Boolean *outExecutable) {
  283. return __UA_Server_read(server, &nodeId, UA_ATTRIBUTEID_EXECUTABLE,
  284. outExecutable);
  285. }
  286. /**
  287. * The following node attributes cannot be changed once a node has been created:
  288. *
  289. * - NodeClass
  290. * - NodeId
  291. * - Symmetric
  292. * - ContainsNoLoop
  293. *
  294. * The following attributes cannot be written from the server, as they are
  295. * specific to the different users and set by the access control callback:
  296. *
  297. * - UserWriteMask
  298. * - UserAccessLevel
  299. * - UserExecutable
  300. *
  301. * Historizing is currently unsupported */
  302. /* Overwrite an attribute of a node. The specialized functions below provide a
  303. * more concise syntax.
  304. *
  305. * @param server The server object.
  306. * @param value WriteValues contain the NodeId of the target node, the id of the
  307. * attribute to overwritten, the actual value and (optionally) an
  308. * index range to replace parts of an array only. of an array only.
  309. * See the section on NumericRange for the format used for array
  310. * ranges.
  311. * @return Returns a status code. */
  312. UA_StatusCode UA_EXPORT
  313. UA_Server_write(UA_Server *server, const UA_WriteValue *value);
  314. /* Don't use this function. There are typed versions with no additional
  315. * overhead. */
  316. UA_StatusCode UA_EXPORT
  317. __UA_Server_write(UA_Server *server, const UA_NodeId *nodeId,
  318. const UA_AttributeId attributeId,
  319. const UA_DataType *attr_type, const void *attr);
  320. static UA_INLINE UA_StatusCode
  321. UA_Server_writeBrowseName(UA_Server *server, const UA_NodeId nodeId,
  322. const UA_QualifiedName browseName) {
  323. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_BROWSENAME,
  324. &UA_TYPES[UA_TYPES_QUALIFIEDNAME], &browseName);
  325. }
  326. static UA_INLINE UA_StatusCode
  327. UA_Server_writeDisplayName(UA_Server *server, const UA_NodeId nodeId,
  328. const UA_LocalizedText displayName) {
  329. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME,
  330. &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], &displayName);
  331. }
  332. static UA_INLINE UA_StatusCode
  333. UA_Server_writeDescription(UA_Server *server, const UA_NodeId nodeId,
  334. const UA_LocalizedText description) {
  335. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_DESCRIPTION,
  336. &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], &description);
  337. }
  338. static UA_INLINE UA_StatusCode
  339. UA_Server_writeWriteMask(UA_Server *server, const UA_NodeId nodeId,
  340. const UA_UInt32 writeMask) {
  341. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_WRITEMASK,
  342. &UA_TYPES[UA_TYPES_UINT32], &writeMask);
  343. }
  344. static UA_INLINE UA_StatusCode
  345. UA_Server_writeIsAbstract(UA_Server *server, const UA_NodeId nodeId,
  346. const UA_Boolean isAbstract) {
  347. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_ISABSTRACT,
  348. &UA_TYPES[UA_TYPES_BOOLEAN], &isAbstract);
  349. }
  350. static UA_INLINE UA_StatusCode
  351. UA_Server_writeInverseName(UA_Server *server, const UA_NodeId nodeId,
  352. const UA_LocalizedText inverseName) {
  353. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_INVERSENAME,
  354. &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], &inverseName);
  355. }
  356. static UA_INLINE UA_StatusCode
  357. UA_Server_writeEventNotifier(UA_Server *server, const UA_NodeId nodeId,
  358. const UA_Byte eventNotifier) {
  359. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER,
  360. &UA_TYPES[UA_TYPES_BYTE], &eventNotifier);
  361. }
  362. static UA_INLINE UA_StatusCode
  363. UA_Server_writeValue(UA_Server *server, const UA_NodeId nodeId,
  364. const UA_Variant value) {
  365. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_VALUE,
  366. &UA_TYPES[UA_TYPES_VARIANT], &value);
  367. }
  368. static UA_INLINE UA_StatusCode
  369. UA_Server_writeDataType(UA_Server *server, const UA_NodeId nodeId,
  370. const UA_NodeId dataType) {
  371. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_DATATYPE,
  372. &UA_TYPES[UA_TYPES_NODEID], &dataType);
  373. }
  374. static UA_INLINE UA_StatusCode
  375. UA_Server_writeValueRank(UA_Server *server, const UA_NodeId nodeId,
  376. const UA_Int32 valueRank) {
  377. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_VALUERANK,
  378. &UA_TYPES[UA_TYPES_INT32], &valueRank);
  379. }
  380. static UA_INLINE UA_StatusCode
  381. UA_Server_writeArrayDimensions(UA_Server *server, const UA_NodeId nodeId,
  382. const UA_Variant arrayDimensions) {
  383. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_VALUE,
  384. &UA_TYPES[UA_TYPES_VARIANT], &arrayDimensions);
  385. }
  386. static UA_INLINE UA_StatusCode
  387. UA_Server_writeAccessLevel(UA_Server *server, const UA_NodeId nodeId,
  388. const UA_Byte accessLevel) {
  389. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL,
  390. &UA_TYPES[UA_TYPES_BYTE], &accessLevel);
  391. }
  392. static UA_INLINE UA_StatusCode
  393. UA_Server_writeMinimumSamplingInterval(UA_Server *server, const UA_NodeId nodeId,
  394. const UA_Double miniumSamplingInterval) {
  395. return __UA_Server_write(server, &nodeId,
  396. UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL,
  397. &UA_TYPES[UA_TYPES_DOUBLE],
  398. &miniumSamplingInterval);
  399. }
  400. static UA_INLINE UA_StatusCode
  401. UA_Server_writeExecutable(UA_Server *server, const UA_NodeId nodeId,
  402. const UA_Boolean executable) {
  403. return __UA_Server_write(server, &nodeId, UA_ATTRIBUTEID_EXECUTABLE,
  404. &UA_TYPES[UA_TYPES_BOOLEAN], &executable); }
  405. /**
  406. * Browsing
  407. * -------- */
  408. UA_BrowseResult UA_EXPORT
  409. UA_Server_browse(UA_Server *server, UA_UInt32 maxrefs,
  410. const UA_BrowseDescription *descr);
  411. UA_BrowseResult UA_EXPORT
  412. UA_Server_browseNext(UA_Server *server, UA_Boolean releaseContinuationPoint,
  413. const UA_ByteString *continuationPoint);
  414. UA_BrowsePathResult UA_EXPORT
  415. UA_Server_translateBrowsePathToNodeIds(UA_Server *server,
  416. const UA_BrowsePath *browsePath);
  417. #ifndef HAVE_NODEITER_CALLBACK
  418. #define HAVE_NODEITER_CALLBACK
  419. /* Iterate over all nodes referenced by parentNodeId by calling the callback
  420. * function for each child node (in ifdef because GCC/CLANG handle include order
  421. * differently) */
  422. typedef UA_StatusCode
  423. (*UA_NodeIteratorCallback)(UA_NodeId childId, UA_Boolean isInverse,
  424. UA_NodeId referenceTypeId, void *handle);
  425. #endif
  426. UA_StatusCode UA_EXPORT
  427. UA_Server_forEachChildNodeCall(UA_Server *server, UA_NodeId parentNodeId,
  428. UA_NodeIteratorCallback callback, void *handle);
  429. #ifdef UA_ENABLE_DISCOVERY
  430. /**
  431. * Discovery
  432. * --------- */
  433. /* Register the given server instance at the discovery server.
  434. * This should be called periodically.
  435. * The semaphoreFilePath is optional. If the given file is deleted,
  436. * the server will automatically be unregistered. This could be
  437. * for example a pid file which is deleted if the server crashes.
  438. *
  439. * When the server shuts down you need to call unregister.
  440. *
  441. * @param server
  442. * @param discoveryServerUrl if set to NULL, the default value
  443. * 'opc.tcp://localhost:4840' will be used
  444. * @param semaphoreFilePath optional parameter pointing to semaphore file. */
  445. UA_StatusCode UA_EXPORT
  446. UA_Server_register_discovery(UA_Server *server, const char* discoveryServerUrl,
  447. const char* semaphoreFilePath);
  448. /* Unregister the given server instance from the discovery server.
  449. * This should only be called when the server is shutting down.
  450. * @param server
  451. * @param discoveryServerUrl if set to NULL, the default value
  452. * 'opc.tcp://localhost:4840' will be used */
  453. UA_StatusCode UA_EXPORT
  454. UA_Server_unregister_discovery(UA_Server *server, const char* discoveryServerUrl);
  455. /* Adds a periodic callback to register the server with the LDS (local discovery server)
  456. * periodically. The interval between each register call is given as second parameter.
  457. * It should be 10 minutes by default (= 10*60*1000).
  458. *
  459. * The delayFirstRegisterMs parameter indicates the delay for the first register call.
  460. * If it is 0, the first register call will be after intervalMs milliseconds,
  461. * otherwise the server's first register will be after delayFirstRegisterMs.
  462. *
  463. * When you manually unregister the server, you also need to cancel the
  464. * periodic callback, otherwise it will be automatically be registered again.
  465. *
  466. * @param server
  467. * @param discoveryServerUrl if set to NULL, the default value
  468. * 'opc.tcp://localhost:4840' will be used
  469. * @param intervalMs
  470. * @param delayFirstRegisterMs
  471. * @param periodicCallbackId */
  472. UA_StatusCode UA_EXPORT
  473. UA_Server_addPeriodicServerRegisterCallback(UA_Server *server, const char* discoveryServerUrl,
  474. UA_UInt32 intervalMs,
  475. UA_UInt32 delayFirstRegisterMs,
  476. UA_UInt64 *periodicCallbackId);
  477. /* Callback for RegisterServer. Data is passed from the register call */
  478. typedef void (*UA_Server_registerServerCallback)(const UA_RegisteredServer *registeredServer,
  479. void* data);
  480. /* Set the callback which is called if another server registeres or unregisters
  481. * with this instance. If called multiple times, previous data will be
  482. * overwritten.
  483. *
  484. * @param server
  485. * @param cb the callback
  486. * @param data data passed to the callback
  487. * @return UA_STATUSCODE_SUCCESS on success */
  488. void UA_EXPORT
  489. UA_Server_setRegisterServerCallback(UA_Server *server, UA_Server_registerServerCallback cb,
  490. void* data);
  491. #ifdef UA_ENABLE_DISCOVERY_MULTICAST
  492. /* Callback for server detected through mDNS. Data is passed from the register
  493. * call
  494. *
  495. * @param isServerAnnounce indicates if the server has just been detected. If
  496. * set to false, this means the server is shutting down.
  497. * @param isTxtReceived indicates if we already received the corresponding TXT
  498. * record with the path and caps data */
  499. typedef void (*UA_Server_serverOnNetworkCallback)(const UA_ServerOnNetwork *serverOnNetwork,
  500. UA_Boolean isServerAnnounce,
  501. UA_Boolean isTxtReceived, void* data);
  502. /* Set the callback which is called if another server is found through mDNS or
  503. * deleted. It will be called for any mDNS message from the remote server, thus
  504. * it may be called multiple times for the same instance. Also the SRV and TXT
  505. * records may arrive later, therefore for the first call the server
  506. * capabilities may not be set yet. If called multiple times, previous data will
  507. * be overwritten.
  508. *
  509. * @param server
  510. * @param cb the callback
  511. * @param data data passed to the callback
  512. * @return UA_STATUSCODE_SUCCESS on success */
  513. void UA_EXPORT
  514. UA_Server_setServerOnNetworkCallback(UA_Server *server,
  515. UA_Server_serverOnNetworkCallback cb,
  516. void* data);
  517. #endif /* UA_ENABLE_DISCOVERY_MULTICAST */
  518. #endif /* UA_ENABLE_DISCOVERY */
  519. /**
  520. * Method Call
  521. * ----------- */
  522. #ifdef UA_ENABLE_METHODCALLS
  523. UA_CallMethodResult UA_EXPORT
  524. UA_Server_call(UA_Server *server, const UA_CallMethodRequest *request);
  525. #endif
  526. /**
  527. * Node Management
  528. * ---------------
  529. *
  530. * Callback Mechanisms
  531. * ^^^^^^^^^^^^^^^^^^^
  532. * There are four mechanisms for callbacks from the node-based information model
  533. * into userspace:
  534. *
  535. * - Datasources for variable nodes, where the variable content is managed
  536. * externally
  537. * - Value-callbacks for variable nodes, where userspace is notified when a
  538. * read/write occurs
  539. * - Object lifecycle management, where a user-defined constructor and
  540. * destructor is added to an object type
  541. * - Method callbacks, where a user-defined method is exposed in the information
  542. * model
  543. *
  544. * .. _datasource:
  545. *
  546. * Data Source Callback
  547. * ~~~~~~~~~~~~~~~~~~~~
  548. *
  549. * The server has a unique way of dealing with the content of variables. Instead
  550. * of storing a variant attached to the variable node, the node can point to a
  551. * function with a local data provider. Whenever the value attribute is read,
  552. * the function will be called and asked to provide a UA_DataValue return value
  553. * that contains the value content and additional timestamps.
  554. *
  555. * It is expected that the read callback is implemented. The write callback can
  556. * be set to a null-pointer. */
  557. typedef struct {
  558. void *handle; /* A custom pointer to reuse the same datasource functions for
  559. multiple sources */
  560. /* Copies the data from the source into the provided value.
  561. *
  562. * @param handle An optional pointer to user-defined data for the
  563. * specific data source
  564. * @param nodeid Id of the read node
  565. * @param includeSourceTimeStamp If true, then the datasource is expected to
  566. * set the source timestamp in the returned value
  567. * @param range If not null, then the datasource shall return only a
  568. * selection of the (nonscalar) data. Set
  569. * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not
  570. * apply.
  571. * @param value The (non-null) DataValue that is returned to the client. The
  572. * data source sets the read data, the result status and optionally a
  573. * sourcetimestamp.
  574. * @return Returns a status code for logging. Error codes intended for the
  575. * original caller are set in the value. If an error is returned,
  576. * then no releasing of the value is done. */
  577. UA_StatusCode (*read)(void *handle, const UA_NodeId nodeid,
  578. UA_Boolean includeSourceTimeStamp,
  579. const UA_NumericRange *range, UA_DataValue *value);
  580. /* Write into a data source. The write member of UA_DataSource can be empty
  581. * if the operation is unsupported.
  582. *
  583. * @param handle An optional pointer to user-defined data for the
  584. * specific data source
  585. * @param nodeid Id of the node being written to
  586. * @param data The data to be written into the data source
  587. * @param range An optional data range. If the data source is scalar or does
  588. * not support writing of ranges, then an error code is returned.
  589. * @return Returns a status code that is returned to the user
  590. */
  591. UA_StatusCode (*write)(void *handle, const UA_NodeId nodeid,
  592. const UA_Variant *data, const UA_NumericRange *range);
  593. } UA_DataSource;
  594. UA_StatusCode UA_EXPORT
  595. UA_Server_setVariableNode_dataSource(UA_Server *server, const UA_NodeId nodeId,
  596. const UA_DataSource dataSource);
  597. /**
  598. * .. _value-callback:
  599. *
  600. * Value Callback
  601. * ~~~~~~~~~~~~~~
  602. * Value Callbacks can be attached to variable and variable type nodes. If
  603. * not-null, they are called before reading and after writing respectively. */
  604. typedef struct {
  605. /* Pointer to user-provided data for the callback */
  606. void *handle;
  607. /* Called before the value attribute is read. It is possible to write into the
  608. * value attribute during onRead (using the write service). The node is
  609. * re-opened afterwards so that changes are considered in the following read
  610. * operation.
  611. *
  612. * @param handle Points to user-provided data for the callback.
  613. * @param nodeid The identifier of the node.
  614. * @param data Points to the current node value.
  615. * @param range Points to the numeric range the client wants to read from
  616. * (or NULL). */
  617. void (*onRead)(void *handle, const UA_NodeId nodeid,
  618. const UA_Variant *data, const UA_NumericRange *range);
  619. /* Called after writing the value attribute. The node is re-opened after
  620. * writing so that the new value is visible in the callback.
  621. *
  622. * @param handle Points to user-provided data for the callback.
  623. * @param nodeid The identifier of the node.
  624. * @param data Points to the current node value (after writing).
  625. * @param range Points to the numeric range the client wants to write to (or
  626. * NULL). */
  627. void (*onWrite)(void *handle, const UA_NodeId nodeid,
  628. const UA_Variant *data, const UA_NumericRange *range);
  629. } UA_ValueCallback;
  630. UA_StatusCode UA_EXPORT
  631. UA_Server_setVariableNode_valueCallback(UA_Server *server, const UA_NodeId nodeId,
  632. const UA_ValueCallback callback);
  633. /**
  634. * .. _object-lifecycle:
  635. *
  636. * Object Lifecycle Management Callbacks
  637. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  638. * Lifecycle management adds constructor and destructor callbacks to
  639. * object types. */
  640. typedef struct {
  641. /* Returns the instance handle that is then attached to the node */
  642. void * (*constructor)(const UA_NodeId instance);
  643. void (*destructor)(const UA_NodeId instance, void *instanceHandle);
  644. } UA_ObjectLifecycleManagement;
  645. UA_StatusCode UA_EXPORT
  646. UA_Server_setObjectTypeNode_lifecycleManagement(UA_Server *server,
  647. UA_NodeId nodeId,
  648. UA_ObjectLifecycleManagement olm);
  649. /**
  650. * Method Callbacks
  651. * ~~~~~~~~~~~~~~~~ */
  652. typedef UA_StatusCode
  653. (*UA_MethodCallback)(void *methodHandle, const UA_NodeId *objectId,
  654. const UA_NodeId *sessionId, void *sessionHandle,
  655. size_t inputSize, const UA_Variant *input,
  656. size_t outputSize, UA_Variant *output);
  657. #ifdef UA_ENABLE_METHODCALLS
  658. UA_StatusCode UA_EXPORT
  659. UA_Server_setMethodNode_callback(UA_Server *server, const UA_NodeId methodNodeId,
  660. UA_MethodCallback method, void *handle);
  661. #endif
  662. /**
  663. * .. _addnodes:
  664. *
  665. * Node Addition and Deletion
  666. * ^^^^^^^^^^^^^^^^^^^^^^^^^^
  667. *
  668. * When creating dynamic node instances at runtime, chances are that you will
  669. * not care about the specific NodeId of the new node, as long as you can
  670. * reference it later. When passing numeric NodeIds with a numeric identifier 0,
  671. * the stack evaluates this as "select a random unassigned numeric NodeId in
  672. * that namespace". To find out which NodeId was actually assigned to the new
  673. * node, you may pass a pointer `outNewNodeId`, which will (after a successfull
  674. * node insertion) contain the nodeId of the new node. You may also pass NULL
  675. * pointer if this result is not relevant. The namespace index for nodes you
  676. * create should never be 0, as that index is reserved for OPC UA's
  677. * self-description (namespace * 0).
  678. *
  679. * The methods for node addition and deletion take mostly const arguments that
  680. * are not modified. When creating a node, a deep copy of the node identifier,
  681. * node attributes, etc. is created. Therefore, it is possible to call for
  682. * example `UA_Server_addVariablenode` with a value attribute (a :ref:`variant`)
  683. * pointing to a memory location on the stack. If you need changes to a variable
  684. * value to manifest at a specific memory location, please use a
  685. * :ref:`datasource` or a :ref:`value-callback`. */
  686. /* Protect against redundant definitions for server/client */
  687. #ifndef UA_DEFAULT_ATTRIBUTES_DEFINED
  688. #define UA_DEFAULT_ATTRIBUTES_DEFINED
  689. /* The default for variables is "BaseDataType" for the datatype, -2 for the
  690. * valuerank and a read-accesslevel. */
  691. UA_EXPORT extern const UA_VariableAttributes UA_VariableAttributes_default;
  692. UA_EXPORT extern const UA_VariableTypeAttributes UA_VariableTypeAttributes_default;
  693. /* Methods are executable by default */
  694. UA_EXPORT extern const UA_MethodAttributes UA_MethodAttributes_default;
  695. /* The remaining attribute definitions are currently all zeroed out */
  696. UA_EXPORT extern const UA_ObjectAttributes UA_ObjectAttributes_default;
  697. UA_EXPORT extern const UA_ObjectTypeAttributes UA_ObjectTypeAttributes_default;
  698. UA_EXPORT extern const UA_ReferenceTypeAttributes UA_ReferenceTypeAttributes_default;
  699. UA_EXPORT extern const UA_DataTypeAttributes UA_DataTypeAttributes_default;
  700. UA_EXPORT extern const UA_ViewAttributes UA_ViewAttributes_default;
  701. #endif
  702. /* The instantiation callback is used to track the addition of new nodes. It is
  703. * also called for all sub-nodes contained in an object or variable type node
  704. * that is instantiated. */
  705. typedef struct {
  706. UA_StatusCode (*method)(const UA_NodeId objectId,
  707. const UA_NodeId typeDefinitionId, void *handle);
  708. void *handle;
  709. } UA_InstantiationCallback;
  710. /* Don't use this function. There are typed versions as inline functions. */
  711. UA_StatusCode UA_EXPORT
  712. __UA_Server_addNode(UA_Server *server, const UA_NodeClass nodeClass,
  713. const UA_NodeId *requestedNewNodeId,
  714. const UA_NodeId *parentNodeId,
  715. const UA_NodeId *referenceTypeId,
  716. const UA_QualifiedName browseName,
  717. const UA_NodeId *typeDefinition,
  718. const UA_NodeAttributes *attr,
  719. const UA_DataType *attributeType,
  720. UA_InstantiationCallback *instantiationCallback,
  721. UA_NodeId *outNewNodeId);
  722. static UA_INLINE UA_StatusCode
  723. UA_Server_addVariableNode(UA_Server *server, const UA_NodeId requestedNewNodeId,
  724. const UA_NodeId parentNodeId,
  725. const UA_NodeId referenceTypeId,
  726. const UA_QualifiedName browseName,
  727. const UA_NodeId typeDefinition,
  728. const UA_VariableAttributes attr,
  729. UA_InstantiationCallback *instantiationCallback,
  730. UA_NodeId *outNewNodeId) {
  731. return __UA_Server_addNode(server, UA_NODECLASS_VARIABLE, &requestedNewNodeId,
  732. &parentNodeId, &referenceTypeId, browseName,
  733. &typeDefinition, (const UA_NodeAttributes*)&attr,
  734. &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],
  735. instantiationCallback, outNewNodeId);
  736. }
  737. static UA_INLINE UA_StatusCode
  738. UA_Server_addVariableTypeNode(UA_Server *server,
  739. const UA_NodeId requestedNewNodeId,
  740. const UA_NodeId parentNodeId,
  741. const UA_NodeId referenceTypeId,
  742. const UA_QualifiedName browseName,
  743. const UA_NodeId typeDefinition,
  744. const UA_VariableTypeAttributes attr,
  745. UA_InstantiationCallback *instantiationCallback,
  746. UA_NodeId *outNewNodeId) {
  747. return __UA_Server_addNode(server, UA_NODECLASS_VARIABLETYPE,
  748. &requestedNewNodeId, &parentNodeId, &referenceTypeId,
  749. browseName, &typeDefinition,
  750. (const UA_NodeAttributes*)&attr,
  751. &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],
  752. instantiationCallback, outNewNodeId);
  753. }
  754. static UA_INLINE UA_StatusCode
  755. UA_Server_addObjectNode(UA_Server *server, const UA_NodeId requestedNewNodeId,
  756. const UA_NodeId parentNodeId,
  757. const UA_NodeId referenceTypeId,
  758. const UA_QualifiedName browseName,
  759. const UA_NodeId typeDefinition,
  760. const UA_ObjectAttributes attr,
  761. UA_InstantiationCallback *instantiationCallback,
  762. UA_NodeId *outNewNodeId) {
  763. return __UA_Server_addNode(server, UA_NODECLASS_OBJECT, &requestedNewNodeId,
  764. &parentNodeId, &referenceTypeId, browseName,
  765. &typeDefinition, (const UA_NodeAttributes*)&attr,
  766. &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],
  767. instantiationCallback, outNewNodeId);
  768. }
  769. static UA_INLINE UA_StatusCode
  770. UA_Server_addObjectTypeNode(UA_Server *server, const UA_NodeId requestedNewNodeId,
  771. const UA_NodeId parentNodeId,
  772. const UA_NodeId referenceTypeId,
  773. const UA_QualifiedName browseName,
  774. const UA_ObjectTypeAttributes attr,
  775. UA_InstantiationCallback *instantiationCallback,
  776. UA_NodeId *outNewNodeId) {
  777. return __UA_Server_addNode(server, UA_NODECLASS_OBJECTTYPE, &requestedNewNodeId,
  778. &parentNodeId, &referenceTypeId, browseName,
  779. &UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
  780. &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],
  781. instantiationCallback, outNewNodeId);
  782. }
  783. static UA_INLINE UA_StatusCode
  784. UA_Server_addViewNode(UA_Server *server, const UA_NodeId requestedNewNodeId,
  785. const UA_NodeId parentNodeId,
  786. const UA_NodeId referenceTypeId,
  787. const UA_QualifiedName browseName,
  788. const UA_ViewAttributes attr,
  789. UA_InstantiationCallback *instantiationCallback,
  790. UA_NodeId *outNewNodeId) {
  791. return __UA_Server_addNode(server, UA_NODECLASS_VIEW, &requestedNewNodeId,
  792. &parentNodeId, &referenceTypeId, browseName,
  793. &UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
  794. &UA_TYPES[UA_TYPES_VIEWATTRIBUTES],
  795. instantiationCallback, outNewNodeId);
  796. }
  797. static UA_INLINE UA_StatusCode
  798. UA_Server_addReferenceTypeNode(UA_Server *server,
  799. const UA_NodeId requestedNewNodeId,
  800. const UA_NodeId parentNodeId,
  801. const UA_NodeId referenceTypeId,
  802. const UA_QualifiedName browseName,
  803. const UA_ReferenceTypeAttributes attr,
  804. UA_InstantiationCallback *instantiationCallback,
  805. UA_NodeId *outNewNodeId) {
  806. return __UA_Server_addNode(server, UA_NODECLASS_REFERENCETYPE,
  807. &requestedNewNodeId, &parentNodeId, &referenceTypeId,
  808. browseName, &UA_NODEID_NULL,
  809. (const UA_NodeAttributes*)&attr,
  810. &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],
  811. instantiationCallback, outNewNodeId);
  812. }
  813. static UA_INLINE UA_StatusCode
  814. UA_Server_addDataTypeNode(UA_Server *server,
  815. const UA_NodeId requestedNewNodeId,
  816. const UA_NodeId parentNodeId,
  817. const UA_NodeId referenceTypeId,
  818. const UA_QualifiedName browseName,
  819. const UA_DataTypeAttributes attr,
  820. UA_InstantiationCallback *instantiationCallback,
  821. UA_NodeId *outNewNodeId) {
  822. return __UA_Server_addNode(server, UA_NODECLASS_DATATYPE, &requestedNewNodeId,
  823. &parentNodeId, &referenceTypeId, browseName,
  824. &UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
  825. &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],
  826. instantiationCallback, outNewNodeId);
  827. }
  828. UA_StatusCode UA_EXPORT
  829. UA_Server_addDataSourceVariableNode(UA_Server *server,
  830. const UA_NodeId requestedNewNodeId,
  831. const UA_NodeId parentNodeId,
  832. const UA_NodeId referenceTypeId,
  833. const UA_QualifiedName browseName,
  834. const UA_NodeId typeDefinition,
  835. const UA_VariableAttributes attr,
  836. const UA_DataSource dataSource,
  837. UA_NodeId *outNewNodeId);
  838. #ifdef UA_ENABLE_METHODCALLS
  839. UA_StatusCode UA_EXPORT
  840. UA_Server_addMethodNode(UA_Server *server, const UA_NodeId requestedNewNodeId,
  841. const UA_NodeId parentNodeId,
  842. const UA_NodeId referenceTypeId,
  843. const UA_QualifiedName browseName,
  844. const UA_MethodAttributes attr,
  845. UA_MethodCallback method, void *handle,
  846. size_t inputArgumentsSize,
  847. const UA_Argument* inputArguments,
  848. size_t outputArgumentsSize,
  849. const UA_Argument* outputArguments,
  850. UA_NodeId *outNewNodeId);
  851. #endif
  852. UA_StatusCode UA_EXPORT
  853. UA_Server_deleteNode(UA_Server *server, const UA_NodeId nodeId,
  854. UA_Boolean deleteReferences);
  855. /**
  856. * Reference Management
  857. * -------------------- */
  858. UA_StatusCode UA_EXPORT
  859. UA_Server_addReference(UA_Server *server, const UA_NodeId sourceId,
  860. const UA_NodeId refTypeId,
  861. const UA_ExpandedNodeId targetId, UA_Boolean isForward);
  862. UA_StatusCode UA_EXPORT
  863. UA_Server_deleteReference(UA_Server *server, const UA_NodeId sourceNodeId,
  864. const UA_NodeId referenceTypeId, UA_Boolean isForward,
  865. const UA_ExpandedNodeId targetNodeId,
  866. UA_Boolean deleteBidirectional);
  867. /**
  868. * Utility Functions
  869. * ----------------- */
  870. /* Add a new namespace to the server. Returns the index of the new namespace */
  871. UA_UInt16 UA_EXPORT UA_Server_addNamespace(UA_Server *server, const char* name);
  872. /**
  873. * Deprecated Server API
  874. * ---------------------
  875. * This file contains outdated API definitions that are kept for backwards
  876. * compatibility. Please switch to the new API, as the following definitions
  877. * will be removed eventually.
  878. *
  879. * UA_Job API
  880. * ^^^^^^^^^^
  881. * UA_Job was replaced since it unneccessarily exposed server internals to the
  882. * end-user. Please use plain UA_ServerCallbacks instead. The following UA_Job
  883. * definition contains just the fraction of the original struct that was useful
  884. * to end-users. */
  885. typedef enum {
  886. UA_JOBTYPE_METHODCALL
  887. } UA_JobType;
  888. typedef struct {
  889. UA_JobType type;
  890. union {
  891. struct {
  892. void *data;
  893. UA_ServerCallback method;
  894. } methodCall;
  895. } job;
  896. } UA_Job;
  897. UA_DEPRECATED static UA_INLINE UA_StatusCode
  898. UA_Server_addRepeatedJob(UA_Server *server, UA_Job job,
  899. UA_UInt32 interval, UA_Guid *jobId) {
  900. return UA_Server_addRepeatedCallback(server, job.job.methodCall.method,
  901. job.job.methodCall.data, interval,
  902. (UA_UInt64*)(uintptr_t)jobId);
  903. }
  904. UA_DEPRECATED static UA_INLINE UA_StatusCode
  905. UA_Server_removeRepeatedJob(UA_Server *server, UA_Guid jobId) {
  906. return UA_Server_removeRepeatedCallback(server,
  907. *(UA_UInt64*)(uintptr_t)&jobId);
  908. }
  909. #ifdef __cplusplus
  910. }
  911. #endif
  912. #endif /* UA_SERVER_H_ */