ua_server_internal.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef UA_SERVER_INTERNAL_H_
  2. #define UA_SERVER_INTERNAL_H_
  3. #include "ua_config.h"
  4. #ifdef UA_MULTITHREADING
  5. #define _LGPL_SOURCE
  6. #include <urcu.h>
  7. #include <urcu/wfcqueue.h>
  8. #endif
  9. #include "ua_server.h"
  10. #include "ua_session_manager.h"
  11. #include "ua_securechannel_manager.h"
  12. #include "ua_nodestore.h"
  13. /** Mapping of namespace-id and url to an external nodestore. For namespaces
  14. that have no mapping defined, the internal nodestore is used by default. */
  15. typedef struct UA_ExternalNamespace {
  16. UA_UInt16 index;
  17. UA_String url;
  18. UA_ExternalNodeStore externalNodeStore;
  19. } UA_ExternalNamespace;
  20. // forward declarations
  21. struct UA_TimedWork;
  22. typedef struct UA_TimedWork UA_TimedWork;
  23. struct UA_DelayedWork;
  24. typedef struct UA_DelayedWork UA_DelayedWork;
  25. struct UA_Server {
  26. UA_ApplicationDescription description;
  27. UA_Int32 endpointDescriptionsSize;
  28. UA_EndpointDescription *endpointDescriptions;
  29. UA_ByteString serverCertificate;
  30. UA_SecureChannelManager secureChannelManager;
  31. UA_SessionManager sessionManager;
  32. UA_Logger logger;
  33. UA_NodeStore *nodestore;
  34. UA_Int32 externalNamespacesSize;
  35. UA_ExternalNamespace *externalNamespaces;
  36. UA_Int32 nlsSize;
  37. UA_ServerNetworkLayer *nls;
  38. UA_UInt32 random_seed;
  39. #ifdef UA_MULTITHREADING
  40. UA_Boolean *running;
  41. UA_UInt16 nThreads;
  42. UA_UInt32 **workerCounters;
  43. UA_DelayedWork *delayedWork;
  44. // worker threads wait on the queue
  45. struct cds_wfcq_head dispatchQueue_head;
  46. struct cds_wfcq_tail dispatchQueue_tail;
  47. #endif
  48. LIST_HEAD(UA_TimedWorkList, UA_TimedWork) timedWork;
  49. };
  50. void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, const UA_ByteString *msg);
  51. UA_AddNodesResult UA_Server_addNodeWithSession(UA_Server *server, UA_Session *session, UA_Node *node,
  52. const UA_ExpandedNodeId *parentNodeId,
  53. const UA_NodeId *referenceTypeId);
  54. UA_AddNodesResult UA_Server_addNode(UA_Server *server, UA_Node *node, const UA_ExpandedNodeId *parentNodeId,
  55. const UA_NodeId *referenceTypeId);
  56. UA_StatusCode UA_Server_addReferenceWithSession(UA_Server *server, UA_Session *session, const UA_AddReferencesItem *item);
  57. void UA_Server_deleteTimedWork(UA_Server *server);
  58. /** The (nodes) AttributeIds are defined in part 6, table A1 of the standard */
  59. typedef enum {
  60. UA_ATTRIBUTEID_NODEID = 1,
  61. UA_ATTRIBUTEID_NODECLASS = 2,
  62. UA_ATTRIBUTEID_BROWSENAME = 3,
  63. UA_ATTRIBUTEID_DISPLAYNAME = 4,
  64. UA_ATTRIBUTEID_DESCRIPTION = 5,
  65. UA_ATTRIBUTEID_WRITEMASK = 6,
  66. UA_ATTRIBUTEID_USERWRITEMASK = 7,
  67. UA_ATTRIBUTEID_ISABSTRACT = 8,
  68. UA_ATTRIBUTEID_SYMMETRIC = 9,
  69. UA_ATTRIBUTEID_INVERSENAME = 10,
  70. UA_ATTRIBUTEID_CONTAINSNOLOOPS = 11,
  71. UA_ATTRIBUTEID_EVENTNOTIFIER = 12,
  72. UA_ATTRIBUTEID_VALUE = 13,
  73. UA_ATTRIBUTEID_DATATYPE = 14,
  74. UA_ATTRIBUTEID_VALUERANK = 15,
  75. UA_ATTRIBUTEID_ARRAYDIMENSIONS = 16,
  76. UA_ATTRIBUTEID_ACCESSLEVEL = 17,
  77. UA_ATTRIBUTEID_USERACCESSLEVEL = 18,
  78. UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL = 19,
  79. UA_ATTRIBUTEID_HISTORIZING = 20,
  80. UA_ATTRIBUTEID_EXECUTABLE = 21,
  81. UA_ATTRIBUTEID_USEREXECUTABLE = 22
  82. } UA_AttributeId;
  83. #endif /* UA_SERVER_INTERNAL_H_ */