H5FDmirror.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. * Copyright by The HDF Group. *
  3. * All rights reserved. *
  4. * *
  5. * This file is part of HDF5. The full HDF5 copyright notice, including *
  6. * terms governing use, modification, and redistribution, is contained in *
  7. * the COPYING file, which can be found at the root of the source code *
  8. * distribution tree, or in https://www.hdfgroup.org/licenses. *
  9. * If you do not have access to either file, you may request a copy from *
  10. * help@hdfgroup.org. *
  11. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  12. /*
  13. * Purpose: Public, shared definitions for Mirror VFD & remote Writer.
  14. */
  15. #ifndef H5FDmirror_H
  16. #define H5FDmirror_H
  17. #ifdef H5_HAVE_MIRROR_VFD
  18. #define H5FD_MIRROR (H5FDperform_init(H5FD_mirror_init))
  19. #define H5FD_MIRROR_VALUE H5_VFD_MIRROR
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* ============================================================================
  24. * Mirror VFD use and operation.
  25. * ============================================================================
  26. */
  27. /* ---------------------------------------------------------------------------
  28. * Structure: H5FD_mirror_fapl_t
  29. *
  30. * Used to pass configuration information to the Mirror VFD.
  31. * Populate components as appropriate and pass structure pointer to
  32. * `H5Pset_fapl_mirror()`.
  33. *
  34. * `magic` (uint32_t)
  35. * Semi-unique number to sanity-check pointers to this structure type.
  36. * MUST equal H5FD_MIRROR_FAPL_MAGIC to be considered valid.
  37. *
  38. * `version` (uint32_t)
  39. * Indicates expected components of the structure.
  40. *
  41. * `handshake_port (int)
  42. * Port number to expect to reach the "Mirror Server" on the remote host.
  43. *
  44. * `remote_ip` (char[])
  45. * IP address string of "Mirror Server" remote host.
  46. * ---------------------------------------------------------------------------
  47. */
  48. #define H5FD_MIRROR_FAPL_MAGIC 0xF8DD514C
  49. #define H5FD_MIRROR_CURR_FAPL_T_VERSION 1
  50. #define H5FD_MIRROR_MAX_IP_LEN 32
  51. typedef struct H5FD_mirror_fapl_t {
  52. uint32_t magic;
  53. uint32_t version;
  54. int handshake_port;
  55. char remote_ip[H5FD_MIRROR_MAX_IP_LEN + 1];
  56. } H5FD_mirror_fapl_t;
  57. H5_DLL hid_t H5FD_mirror_init(void);
  58. /**
  59. * \ingroup FAPL
  60. *
  61. * \todo Add missing documentation
  62. */
  63. H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out);
  64. /**
  65. * \ingroup FAPL
  66. *
  67. * \todo Add missing documentation
  68. */
  69. H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #else /* H5_HAVE_MIRROR_VFD */
  74. #define H5FD_MIRROR (H5I_INAVLID_HID)
  75. #endif /* H5_HAVE_MIRROR_VFD */
  76. #endif /* H5FDmirror_H */