ua_server.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. struct UA_SecureChannelManager;
  26. typedef struct UA_SecureChannelManager UA_SecureChannelManager;
  27. struct UA_SessionManager;
  28. typedef struct UA_SessionManager UA_SessionManager;
  29. struct UA_NodeStore;
  30. typedef struct UA_NodeStore UA_NodeStore;
  31. typedef struct UA_Server {
  32. UA_ApplicationDescription description;
  33. UA_SecureChannelManager *secureChannelManager;
  34. UA_SessionManager *sessionManager;
  35. UA_NodeStore *nodestore;
  36. UA_Logger logger;
  37. UA_ByteString serverCertificate;
  38. // todo: move these somewhere sane
  39. UA_ExpandedNodeId objectsNodeId;
  40. UA_NodeId hasComponentReferenceTypeId;
  41. } UA_Server;
  42. void UA_LIBEXPORT UA_Server_init(UA_Server *server, UA_String *endpointUrl);
  43. UA_Int32 UA_LIBEXPORT UA_Server_deleteMembers(UA_Server *server);
  44. UA_Int32 UA_LIBEXPORT UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection, const UA_ByteString *msg);
  45. /* Services for local use */
  46. UA_AddNodesResult UA_Server_addScalarVariableNode(UA_Server *server, UA_String *browseName, void *value,
  47. const UA_VTable_Entry *vt, UA_ExpandedNodeId *parentNodeId,
  48. UA_NodeId *referenceTypeId );
  49. UA_AddNodesResult UA_Server_addNode(UA_Server *server, UA_Node **node, UA_ExpandedNodeId *parentNodeId,
  50. UA_NodeId *referenceTypeId);
  51. void UA_Server_addReferences(UA_Server *server, const UA_AddReferencesRequest *request,
  52. UA_AddReferencesResponse *response);
  53. #ifdef __cplusplus
  54. } // extern "C"
  55. #endif
  56. #endif /* UA_SERVER_H_ */