ua_server.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_SecureChannelManager *secureChannelManager;
  37. UA_SessionManager *sessionManager;
  38. UA_NodeStore *nodestore;
  39. UA_Logger logger;
  40. UA_ByteString serverCertificate;
  41. // todo: move these somewhere sane
  42. UA_ExpandedNodeId objectsNodeId;
  43. UA_NodeId hasComponentReferenceTypeId;
  44. } UA_Server;
  45. void UA_EXPORT UA_Server_init(UA_Server *server, UA_String *endpointUrl);
  46. UA_Int32 UA_EXPORT UA_Server_deleteMembers(UA_Server *server);
  47. UA_Int32 UA_EXPORT UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, const UA_ByteString *msg);
  48. /* Services for local use */
  49. UA_AddNodesResult UA_EXPORT UA_Server_addScalarVariableNode(UA_Server *server, UA_String *browseName, void *value,
  50. const UA_VTable_Entry *vt, UA_ExpandedNodeId *parentNodeId,
  51. UA_NodeId *referenceTypeId );
  52. UA_AddNodesResult UA_EXPORT UA_Server_addNode(UA_Server *server, UA_Node **node, UA_ExpandedNodeId *parentNodeId,
  53. UA_NodeId *referenceTypeId);
  54. void UA_EXPORT UA_Server_addReferences(UA_Server *server, const UA_AddReferencesRequest *request,
  55. UA_AddReferencesResponse *response);
  56. #ifdef __cplusplus
  57. } // extern "C"
  58. #endif
  59. #endif /* UA_SERVER_H_ */