ua_server.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_H_
  16. #define UA_SERVER_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #include "ua_types.h"
  21. #include "ua_types_generated.h"
  22. #include "ua_connection.h"
  23. #include "ua_log.h"
  24. /** @defgroup server Server */
  25. //identifier numbers are different for XML and binary, so we have to substract an offset for comparison
  26. #define UA_ENCODINGOFFSET_XML 1
  27. #define UA_ENCODINGOFFSET_BINARY 2
  28. struct UA_SecureChannelManager;
  29. typedef struct UA_SecureChannelManager UA_SecureChannelManager;
  30. struct UA_SessionManager;
  31. typedef struct UA_SessionManager UA_SessionManager;
  32. struct UA_NodeStore;
  33. typedef struct UA_NodeStore UA_NodeStore;
  34. typedef struct UA_Server {
  35. UA_ApplicationDescription description;
  36. UA_Int32 endpointDescriptionsSize;
  37. UA_EndpointDescription *endpointDescriptions;
  38. UA_ByteString serverCertificate;
  39. UA_SecureChannelManager *secureChannelManager;
  40. UA_SessionManager *sessionManager;
  41. UA_NodeStore *nodestore;
  42. UA_Logger logger;
  43. // todo: move these somewhere sane
  44. UA_ExpandedNodeId objectsNodeId;
  45. UA_NodeId hasComponentReferenceTypeId;
  46. } UA_Server;
  47. void UA_EXPORT UA_Server_init(UA_Server *server, UA_String *endpointUrl, UA_ByteString *serverCertificate);
  48. UA_StatusCode UA_EXPORT UA_Server_deleteMembers(UA_Server *server);
  49. void UA_EXPORT UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, const UA_ByteString *msg);
  50. /* Services for local use */
  51. UA_AddNodesResult UA_EXPORT UA_Server_addScalarVariableNode(UA_Server *server, UA_String *browseName, void *value,
  52. const UA_VTable_Entry *vt, UA_ExpandedNodeId *parentNodeId,
  53. UA_NodeId *referenceTypeId );
  54. UA_AddNodesResult UA_EXPORT UA_Server_addNode(UA_Server *server, UA_Node **node, UA_ExpandedNodeId *parentNodeId,
  55. UA_NodeId *referenceTypeId);
  56. void UA_EXPORT UA_Server_addReferences(UA_Server *server, const UA_AddReferencesRequest *request,
  57. UA_AddReferencesResponse *response);
  58. #ifdef __cplusplus
  59. } // extern "C"
  60. #endif
  61. #endif /* UA_SERVER_H_ */