ioctl.cpp
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #include <ioctl.h>
23 #include <ioctl_private.h>
24 
25 ioctl::ioctl() :
26  m_d {std::make_unique<ioctl_private>()}
27 { }
28 
29 void
31 {
32  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
33  d->open();
34 }
35 
36 void
37 ioctl::call_ioctl_add_module(const binary_data &module_data)
38 {
39  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
40  d->call_ioctl_add_module(module_data.data(), module_data.size());
41 }
42 
43 void
45 {
46  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
47  d->call_ioctl_load_vmm();
48 }
49 
50 void
52 {
53  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
54  d->call_ioctl_unload_vmm();
55 }
56 
57 void
59 {
60  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
61  d->call_ioctl_start_vmm();
62 }
63 
64 void
66 {
67  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
68  d->call_ioctl_stop_vmm();
69 }
70 
71 void
72 ioctl::call_ioctl_dump_vmm(gsl::not_null<drr_pointer> drr, vcpuid_type vcpuid)
73 {
74  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
75  d->call_ioctl_dump_vmm(drr, vcpuid);
76 }
77 
78 void
79 ioctl::call_ioctl_vmm_status(gsl::not_null<status_pointer> status)
80 {
81  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
82  d->call_ioctl_vmm_status(status);
83 }
84 
85 void
86 ioctl::call_ioctl_vmcall(gsl::not_null<registers_pointer> regs, cpuid_type cpuid)
87 {
88  if (auto d = dynamic_cast<ioctl_private *>(m_d.get()))
89  d->call_ioctl_vmcall(regs, cpuid);
90 }
virtual void call_ioctl_vmm_status(gsl::not_null< status_pointer > status)
Definition: ioctl.cpp:82
virtual void call_ioctl_start_vmm()
Definition: ioctl.cpp:61
ioctl()
Definition: ioctl.cpp:25
Definition: vcpuid.h:29
debug_ring_resources_t * drr
virtual void call_ioctl_stop_vmm()
Definition: ioctl.cpp:68
virtual void call_ioctl_unload_vmm()
Definition: ioctl.cpp:54
virtual void call_ioctl_dump_vmm(gsl::not_null< drr_pointer > drr, vcpuid_type vcpuid)
Definition: ioctl.cpp:75
virtual void call_ioctl_load_vmm()
Definition: ioctl.cpp:47
virtual void open()
Definition: ioctl.cpp:30
virtual void call_ioctl_vmcall(gsl::not_null< registers_pointer > regs, cpuid_type cpuid)
Definition: ioctl.cpp:89
virtual void call_ioctl_add_module(const binary_data &module_data)
Definition: ioctl.cpp:37