]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/crypto/luks/Header.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_LIBRBD_CRYPTO_LUKS_HEADER_H
5 #define CEPH_LIBRBD_CRYPTO_LUKS_HEADER_H
7 #include <libcryptsetup.h>
8 #include "common/ceph_context.h"
9 #include "include/buffer.h"
17 Header(CephContext
* cct
);
21 int write(const ceph::bufferlist
& bl
);
22 ssize_t
read(ceph::bufferlist
* bl
);
24 int format(const char* type
, const char* alg
, const char* key
,
25 size_t key_size
, const char* cipher_mode
, uint32_t sector_size
,
26 uint32_t data_alignment
, bool insecure_fast_mode
);
27 int add_keyslot(const char* passphrase
, size_t passphrase_size
);
28 int load(const char* type
);
29 int read_volume_key(const char* passphrase
, size_t passphrase_size
,
30 char* volume_key
, size_t* volume_key_size
);
32 int get_sector_size();
33 uint64_t get_data_offset();
34 const char* get_cipher();
35 const char* get_cipher_mode();
38 void libcryptsetup_log(int level
, const char* msg
);
39 static void libcryptsetup_log_wrapper(int level
, const char* msg
,
44 struct crypt_device
*m_cd
;
51 #endif // CEPH_LIBRBD_CRYPTO_LUKS_HEADER_H