]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab ft=cpp | |
3 | ||
4 | #ifndef CEPH_RGW_KMIP_CLIENT_H | |
5 | #define CEPH_RGW_KMIP_CLIENT_H | |
6 | ||
7 | class RGWKMIPManager; | |
8 | ||
9 | class RGWKMIPTransceiver { | |
10 | public: | |
11 | enum kmip_operation { | |
12 | CREATE, | |
13 | LOCATE, | |
14 | GET, | |
15 | GET_ATTRIBUTES, | |
16 | GET_ATTRIBUTE_LIST, | |
17 | DESTROY | |
18 | }; | |
19 | CephContext *cct; | |
20 | kmip_operation operation; | |
21 | char *name = 0; | |
22 | char *unique_id = 0; | |
23 | // output - must free | |
24 | char *out = 0; // unique_id, several | |
25 | struct { // unique_ids, locate | |
26 | char **strings; | |
27 | int string_count; | |
28 | } outlist[1] = {{0, 0}}; | |
29 | struct { // key, get | |
30 | unsigned char *data; | |
31 | int keylen; | |
32 | } outkey[1] = {0, 0}; | |
33 | // end must free | |
34 | int ret; | |
35 | bool done; | |
36 | ceph::mutex lock = ceph::make_mutex("rgw_kmip_req::lock"); | |
37 | ceph::condition_variable cond; | |
38 | ||
39 | int wait(optional_yield y); | |
40 | RGWKMIPTransceiver(CephContext * const cct, | |
41 | kmip_operation operation) | |
42 | : cct(cct), | |
43 | operation(operation), | |
44 | ret(-EDOM), | |
45 | done(false) | |
46 | {} | |
47 | ~RGWKMIPTransceiver(); | |
48 | ||
49 | int send(); | |
50 | int process(optional_yield y); | |
51 | }; | |
52 | ||
53 | class RGWKMIPManager { | |
54 | protected: | |
55 | CephContext *cct; | |
56 | bool is_started = false; | |
57 | RGWKMIPManager(CephContext *cct) : cct(cct) {}; | |
58 | public: | |
59 | virtual ~RGWKMIPManager() { }; | |
60 | virtual int start() = 0; | |
61 | virtual void stop() = 0; | |
62 | virtual int add_request(RGWKMIPTransceiver*) = 0; | |
63 | }; | |
64 | ||
65 | void rgw_kmip_client_init(RGWKMIPManager &); | |
66 | void rgw_kmip_client_cleanup(); | |
67 | #endif |