ioctl_driver.h
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 #ifndef IOCTL_DRIVER_H
23 #define IOCTL_DRIVER_H
24 
25 #include <command_line_parser.h>
26 #include <file.h>
27 #include <ioctl.h>
28 
40 {
41 public:
42 
45 
57  ioctl_driver(gsl::not_null<file *> f,
58  gsl::not_null<ioctl *> ctl,
59  gsl::not_null<command_line_parser *> clp);
60 
66  ~ioctl_driver() = default;
67 
77  void process();
78 
79 private:
80 
81  void load_vmm();
82  void unload_vmm();
83  void start_vmm();
84  void stop_vmm();
85  void dump_vmm();
86  void vmm_status();
87  void vmcall();
88 
89  void vmcall_send_regs(registers_type &regs);
90  void vmcall_versions(registers_type &regs);
91  void vmcall_registers(registers_type &regs);
92  void vmcall_data(registers_type &regs);
93  void vmcall_data_string(registers_type &regs);
94  void vmcall_data_binary(registers_type &regs);
95  void vmcall_event(registers_type &regs);
96  void vmcall_unittest(registers_type &regs);
97 
98  status_type get_status() const;
99 
100 private:
101 
102  gsl::not_null<file *> m_file;
103  gsl::not_null<ioctl *> m_ioctl;
104  gsl::not_null<command_line_parser *> m_clp;
105 };
106 
107 #endif
ioctl::registers_type registers_type
ioctl::status_type status_type
Definition: ioctl_driver.h:43
~ioctl_driver()=default
int64_t status_type
Definition: ioctl.h:57
ioctl_driver(gsl::not_null< file *> f, gsl::not_null< ioctl *> ctl, gsl::not_null< command_line_parser *> clp)
vmcall_versions