H5FDros3.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. * Read-Only S3 Virtual File Driver (VFD)
  14. *
  15. * Programmer: John Mainzer
  16. * 2017-10-10
  17. *
  18. * Purpose: The public header file for the ros3 driver.
  19. */
  20. #ifndef H5FDros3_H
  21. #define H5FDros3_H
  22. #ifdef H5_HAVE_ROS3_VFD
  23. #define H5FD_ROS3 (H5FDperform_init(H5FD_ros3_init))
  24. #define H5FD_ROS3_VALUE H5_VFD_ROS3
  25. #else
  26. #define H5FD_ROS3 (H5I_INVALID_HID)
  27. #define H5FD_ROS3_VALUE H5_VFD_INVALID
  28. #endif /* H5_HAVE_ROS3_VFD */
  29. #ifdef H5_HAVE_ROS3_VFD
  30. /****************************************************************************
  31. *
  32. * Structure: H5FD_ros3_fapl_t
  33. *
  34. * Purpose:
  35. *
  36. * H5FD_ros3_fapl_t is a public structure that is used to pass S3
  37. * authentication data to the appropriate S3 VFD via the FAPL. A pointer
  38. * to an instance of this structure is a parameter to H5Pset_fapl_ros3()
  39. * and H5Pget_fapl_ros3().
  40. *
  41. *
  42. *
  43. * `version` (int32_t)
  44. *
  45. * Version number of the H5FD_ros3_fapl_t structure. Any instance passed
  46. * to the above calls must have a recognized version number, or an error
  47. * will be flagged.
  48. *
  49. * This field should be set to H5FD_CURR_ROS3_FAPL_T_VERSION.
  50. *
  51. * `authenticate` (hbool_t)
  52. *
  53. * Flag TRUE or FALSE whether or not requests are to be authenticated
  54. * with the AWS4 algorithm.
  55. * If TRUE, `aws_region`, `secret_id`, and `secret_key` must be populated.
  56. * If FALSE, those three components are unused.
  57. *
  58. * `aws_region` (char[])
  59. *
  60. * String: name of the AWS "region" of the host, e.g. "us-east-1".
  61. *
  62. * `secret_id` (char[])
  63. *
  64. * String: "Access ID" for the resource.
  65. *
  66. * `secret_key` (char[])
  67. *
  68. * String: "Secret Access Key" associated with the ID and resource.
  69. *
  70. ****************************************************************************/
  71. #define H5FD_CURR_ROS3_FAPL_T_VERSION 1
  72. #define H5FD_ROS3_MAX_REGION_LEN 32
  73. #define H5FD_ROS3_MAX_SECRET_ID_LEN 128
  74. #define H5FD_ROS3_MAX_SECRET_KEY_LEN 128
  75. typedef struct H5FD_ros3_fapl_t {
  76. int32_t version;
  77. hbool_t authenticate;
  78. char aws_region[H5FD_ROS3_MAX_REGION_LEN + 1];
  79. char secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN + 1];
  80. char secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN + 1];
  81. } H5FD_ros3_fapl_t;
  82. #ifdef __cplusplus
  83. extern "C" {
  84. #endif
  85. H5_DLL hid_t H5FD_ros3_init(void);
  86. /**
  87. * \ingroup FAPL
  88. *
  89. * \todo Add missing documentation
  90. */
  91. H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out);
  92. /**
  93. * \ingroup FAPL
  94. *
  95. * \todo Add missing documentation
  96. */
  97. H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa);
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif /* H5_HAVE_ROS3_VFD */
  102. #endif /* ifndef H5FDros3_H */