ua_server_external_ns.h 4.9 KB

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