summaryrefslogtreecommitdiffstats
path: root/src/H5FDros3.h
blob: 7dfc95bee887fa6ae6694900af0a2c5430b97570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/*
 * Read-Only S3 Virtual File Driver (VFD)                                   
 *
 * Programmer:  John Mainzer
 *              2017-10-10
 *
 * Purpose:	The public header file for the ros3 driver.
 */
#ifndef H5FDros3_H
#define H5FDros3_H

#define H5FD_ROS3 (H5FD_ros3_init())

#ifdef __cplusplus
extern "C" {
#endif

/****************************************************************************
 *
 * Structure: H5FD_ros3_fapl_t
 *
 * Purpose:
 *
 *     H5FD_ros3_fapl_t is a public structure that is used to pass S3 
 *     authentication data to the appropriate S3 VFD via the FAPL.  A pointer 
 *     to an instance of this structure is a parameter to H5Pset_fapl_ros3() 
 *     and H5Pget_fapl_ros3().
 *
 *
 *
 * `version` (int32_t)
 *
 *     Version number of the H5FD_ros3_fapl_t structure.  Any instance passed 
 *     to the above calls must have a recognized version number, or an error
 *     will be flagged.
 *
 *     This field should be set to H5FD__CURR_ROS3_FAPL_T_VERSION.
 *
 * `authenticate` (hbool_t)
 *
 *     Flag TRUE or FALSE whether or not requests are to be authenticated
 *     with the AWS4 algorithm. 
 *     If TRUE, `aws_region`, `secret_id`, and `secret_key` must be populated. 
 *     If FALSE, those three components are unused.
 *
 * `aws_region` (char[])
 *
 *     String: name of the AWS "region" of the host, e.g. "us-east-1".
 *
 * `secret_id` (char[])
 *
 *     String: "Access ID" for the resource.
 *
 * `secret_key` (char[])
 *
 *     String: "Secret Access Key" associated with the ID and resource.
 *
 *
 *
 * Programmer: John Mainzer
 *
 * Changes:
 *
 *     - Add documentation of fields (except `version`)
 *     --- Jacob Smith 2017-12-04
 *
 ****************************************************************************/

#define H5FD__CURR_ROS3_FAPL_T_VERSION     1

#define H5FD__ROS3_MAX_REGION_LEN         32
#define H5FD__ROS3_MAX_SECRET_ID_LEN     128
#define H5FD__ROS3_MAX_SECRET_KEY_LEN    128

typedef struct H5FD_ros3_fapl_t {
    int32_t version;
    hbool_t authenticate;
    char    aws_region[H5FD__ROS3_MAX_REGION_LEN + 1];
    char    secret_id[H5FD__ROS3_MAX_SECRET_ID_LEN + 1];
    char    secret_key[H5FD__ROS3_MAX_SECRET_KEY_LEN + 1];
} H5FD_ros3_fapl_t;

H5_DLL hid_t H5FD_ros3_init(void);
H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa_out);
H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t * fa);

#ifdef __cplusplus
}
#endif

#endif /* ifndef H5FDros3_H */