libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
SystemCall.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <introvirt/core/fwd.hh>
19#include <introvirt/util/json/json.hh>
20
21#include <cstdint>
22#include <iostream>
23#include <memory>
24#include <string>
25
26namespace introvirt {
27
32 public:
38 virtual const std::string& name() const = 0;
39
44 virtual void write(std::ostream& os = std::cout) const = 0;
45
49 virtual Json::Value json() const = 0;
50
54 virtual bool will_return() const = 0;
55
65 virtual void data(const std::string& key, const std::shared_ptr<void>& value) = 0;
66
70 virtual void data(const std::string& key, std::shared_ptr<void>&& value) = 0;
71
80 virtual std::shared_ptr<void> data(const std::string& key) = 0;
81
87 virtual std::shared_ptr<const void> data(const std::string& key) const = 0;
88
95 virtual bool supported() const = 0;
96
102 virtual void handle_return_event(Event& event) = 0;
103
107 virtual ~SystemCall() = default;
108};
109
110} // namespace introvirt
Interface class for hypervisor events.
Definition Event.hh:43
Definition SystemCall.hh:31
virtual const std::string & name() const =0
Get the name of the system call.
virtual bool will_return() const =0
virtual bool supported() const =0
Check if this system call is supported by a more specific handler.
virtual std::shared_ptr< const void > data(const std::string &key) const =0
Retrieve arbitrary data stored with the SystemCall.
virtual std::shared_ptr< void > data(const std::string &key)=0
Retrieve arbitrary data stored with the SystemCall.
virtual Json::Value json() const =0
virtual void write(std::ostream &os=std::cout) const =0
Write a human-readable description of this system call.
virtual void data(const std::string &key, std::shared_ptr< void > &&value)=0
Store arbitrary data with the SystemCall.
virtual void data(const std::string &key, const std::shared_ptr< void > &value)=0
Store arbitrary data with the SystemCall.
virtual void handle_return_event(Event &event)=0
Handle a system call return event.
virtual ~SystemCall()=default
Destroy the instance.
Core IntroVirt classes.
Definition Cr0.hh:20