ua_server_external_ns.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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_addOneWayReference)
  41. (void *ensHandle, const UA_AddReferencesItem *item);
  42. typedef UA_Int32 (*UA_ExternalNodeStore_deleteNodes)
  43. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_DeleteNodesItem *nodesToDelete, UA_UInt32 *indices,
  44. UA_UInt32 indicesSize, UA_StatusCode *deleteNodesResults, UA_DiagnosticInfo *diagnosticInfos);
  45. typedef UA_Int32 (*UA_ExternalNodeStore_deleteReferences)
  46. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_DeleteReferencesItem *referenceToDelete,
  47. UA_UInt32 *indices, UA_UInt32 indicesSize, UA_StatusCode deleteReferencesresults,
  48. UA_DiagnosticInfo *diagnosticInfos);
  49. typedef UA_Int32 (*UA_ExternalNodeStore_readNodes)
  50. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_ReadValueId *readValueIds, UA_UInt32 *indices,
  51. UA_UInt32 indicesSize,UA_DataValue *readNodesResults, UA_Boolean timeStampToReturn,
  52. UA_DiagnosticInfo *diagnosticInfos);
  53. typedef UA_Int32 (*UA_ExternalNodeStore_writeNodes)
  54. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_WriteValue *writeValues, UA_UInt32 *indices,
  55. UA_UInt32 indicesSize, UA_StatusCode *writeNodesResults, UA_DiagnosticInfo *diagnosticInfo);
  56. typedef UA_Int32 (*UA_ExternalNodeStore_browseNodes)
  57. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_BrowseDescription *browseDescriptions,
  58. UA_UInt32 *indices, UA_UInt32 indicesSize, UA_UInt32 requestedMaxReferencesPerNode,
  59. UA_BrowseResult *browseResults, UA_DiagnosticInfo *diagnosticInfos);
  60. typedef UA_Int32 (*UA_ExternalNodeStore_translateBrowsePathsToNodeIds)
  61. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_BrowsePath *browsePath, UA_UInt32 *indices,
  62. UA_UInt32 indicesSize, UA_BrowsePathResult *browsePathResults, UA_DiagnosticInfo *diagnosticInfos);
  63. typedef UA_Int32 (*UA_ExternalNodeStore_call)
  64. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_CallMethodRequest *request, UA_UInt32 *indices,
  65. UA_UInt32 indicesSize,UA_CallMethodResult *results);
  66. typedef UA_Int32 (*UA_ExternalNodeStore_delete)(void *ensHandle);
  67. typedef struct UA_ExternalNodeStore {
  68. void *ensHandle;
  69. UA_ExternalNodeStore_addNodes addNodes;
  70. UA_ExternalNodeStore_deleteNodes deleteNodes;
  71. UA_ExternalNodeStore_writeNodes writeNodes;
  72. UA_ExternalNodeStore_readNodes readNodes;
  73. UA_ExternalNodeStore_browseNodes browseNodes;
  74. UA_ExternalNodeStore_translateBrowsePathsToNodeIds translateBrowsePathsToNodeIds;
  75. UA_ExternalNodeStore_addReferences addReferences;
  76. UA_ExternalNodeStore_deleteReferences deleteReferences;
  77. UA_ExternalNodeStore_call call;
  78. UA_ExternalNodeStore_addOneWayReference addOneWayReference;
  79. UA_ExternalNodeStore_delete destroy;
  80. } UA_ExternalNodeStore;
  81. UA_StatusCode UA_EXPORT
  82. UA_Server_addExternalNamespace(UA_Server *server, const UA_String *url,
  83. UA_ExternalNodeStore *nodeStore, UA_UInt16 *assignedNamespaceIndex);
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* UA_SERVER_EXTERNAL_NS_H_ */