ua_server_external_ns.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C) 2014 the contributors as stated in the AUTHORS file
  3. *
  4. * This file is part of open62541. open62541 is free software: you can
  5. * redistribute it and/or modify it under the terms of the GNU Lesser General
  6. * Public License, version 3 (as published by the Free Software Foundation) with
  7. * a static linking exception as stated in the LICENSE file provided with
  8. * open62541.
  9. *
  10. * open62541 is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  13. * details.
  14. */
  15. #ifndef UA_SERVER_EXTERNAL_NS_H_
  16. #define UA_SERVER_EXTERNAL_NS_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /**
  21. * An external application that manages its own data and data model. To plug in
  22. * outside data sources, one can use
  23. *
  24. * - VariableNodes with a data source (functions that are called for read and write access)
  25. * - An external nodestore that is mapped to specific namespaces
  26. *
  27. * If no external nodestore is defined for a nodeid, it is always looked up in
  28. * the "local" nodestore of open62541. Namespace Zero is always in the local
  29. * nodestore.
  30. *
  31. * @{
  32. */
  33. typedef UA_Int32 (*UA_ExternalNodeStore_addNodes)
  34. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_AddNodesItem *nodesToAdd, UA_UInt32 *indices,
  35. UA_UInt32 indicesSize, UA_AddNodesResult* addNodesResults, UA_DiagnosticInfo *diagnosticInfos);
  36. typedef UA_Int32 (*UA_ExternalNodeStore_addReferences)
  37. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_AddReferencesItem* referencesToAdd,
  38. UA_UInt32 *indices,UA_UInt32 indicesSize, UA_StatusCode *addReferencesResults,
  39. UA_DiagnosticInfo *diagnosticInfos);
  40. typedef UA_Int32 (*UA_ExternalNodeStore_deleteNodes)
  41. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_DeleteNodesItem *nodesToDelete, UA_UInt32 *indices,
  42. UA_UInt32 indicesSize, UA_StatusCode *deleteNodesResults, UA_DiagnosticInfo *diagnosticInfos);
  43. typedef UA_Int32 (*UA_ExternalNodeStore_deleteReferences)
  44. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_DeleteReferencesItem *referenceToDelete,
  45. UA_UInt32 *indices, UA_UInt32 indicesSize, UA_StatusCode deleteReferencesresults,
  46. UA_DiagnosticInfo *diagnosticInfos);
  47. typedef UA_Int32 (*UA_ExternalNodeStore_readNodes)
  48. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_ReadValueId *readValueIds, UA_UInt32 *indices,
  49. UA_UInt32 indicesSize,UA_DataValue *readNodesResults, UA_Boolean timeStampToReturn,
  50. UA_DiagnosticInfo *diagnosticInfos);
  51. typedef UA_Int32 (*UA_ExternalNodeStore_writeNodes)
  52. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_WriteValue *writeValues, UA_UInt32 *indices,
  53. UA_UInt32 indicesSize, UA_StatusCode *writeNodesResults, UA_DiagnosticInfo *diagnosticInfo);
  54. typedef UA_Int32 (*UA_ExternalNodeStore_browseNodes)
  55. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_BrowseDescription *browseDescriptions,
  56. UA_UInt32 *indices, UA_UInt32 indicesSize, UA_UInt32 requestedMaxReferencesPerNode,
  57. UA_BrowseResult *browseResults, UA_DiagnosticInfo *diagnosticInfos);
  58. typedef UA_Int32 (*UA_ExternalNodeStore_translateBrowsePathsToNodeIds)
  59. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_BrowsePath *browsePath, UA_UInt32 *indices,
  60. UA_UInt32 indicesSize, UA_BrowsePathResult *browsePathResults, UA_DiagnosticInfo *diagnosticInfos);
  61. typedef UA_Int32 (*UA_ExternalNodeStore_delete)(void *ensHandle);
  62. typedef struct UA_ExternalNodeStore {
  63. void *ensHandle;
  64. UA_ExternalNodeStore_addNodes addNodes;
  65. UA_ExternalNodeStore_deleteNodes deleteNodes;
  66. UA_ExternalNodeStore_writeNodes writeNodes;
  67. UA_ExternalNodeStore_readNodes readNodes;
  68. UA_ExternalNodeStore_browseNodes browseNodes;
  69. UA_ExternalNodeStore_translateBrowsePathsToNodeIds translateBrowsePathsToNodeIds;
  70. UA_ExternalNodeStore_addReferences addReferences;
  71. UA_ExternalNodeStore_deleteReferences deleteReferences;
  72. UA_ExternalNodeStore_delete destroy;
  73. } UA_ExternalNodeStore;
  74. UA_StatusCode UA_EXPORT
  75. UA_Server_addExternalNamespace(UA_Server *server, const UA_String *url,
  76. UA_ExternalNodeStore *nodeStore, UA_UInt16 *assignedNamespaceIndex);
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif /* UA_SERVER_EXTERNAL_NS_H_ */