File: tsk_lvm.hpp

package info (click to toggle)
sleuthkit 4.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,268 kB
  • sloc: ansic: 143,839; cpp: 54,644; java: 39,009; xml: 2,417; python: 1,085; perl: 874; makefile: 451; sh: 196
file content (51 lines) | stat: -rw-r--r-- 1,050 bytes parent folder | download | duplicates (2)
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
/*
 * The Sleuth Kit - Add on for Linux LVM support
 *
 * Copyright (c) 2022 Joachim Metz <joachim.metz@gmail.com>
 *
 * This software is distributed under the Common Public License 1.0
 */

#pragma once

#include "tsk/base/tsk_base_i.h"

#if HAVE_LIBVSLVM

#include "tsk_pool.hpp"

#include <libbfio.h>
#include <libvslvm.h>

class LVMPool;

class LVMPool : public TSKPool {
 protected:
  TSK_IMG_INFO *_img;
  // Start of the pool data within the image
  TSK_OFF_T _offset;
  libbfio_pool_t *_file_io_pool = NULL;
  libvslvm_handle_t *_lvm_handle = NULL;
  libvslvm_volume_group_t *_lvm_volume_group = NULL;

 public:
  LVMPool(std::vector<img_t> &&imgs);

  // Moveable
  LVMPool(LVMPool &&) = default;
  LVMPool &operator=(LVMPool &&) = default;

  // Not copyable because of TSK_IMG_INFO pointer
  LVMPool(const LVMPool &) = delete;
  LVMPool &operator=(const LVMPool &) = delete;

  ~LVMPool();

  std::string identifier;

  ssize_t read(uint64_t address, char *buf, size_t buf_size) const
      noexcept final;
};

#endif /* HAVE_LIBVSLVM */