21 #include "usbguard/Typedefs.hpp" 22 #include "usbguard/Rule.hpp" 40 virtual void load() = 0;
41 virtual void save() = 0;
43 void serialize(std::ostream& stream)
const;
47 uint32_t appendRule(
const Rule& rule, uint32_t parent_id =
Rule::LastID,
bool lock =
true);
48 uint32_t upsertRule(
const Rule& match_rule,
const Rule& new_rule,
bool parent_insensitive =
false);
49 std::shared_ptr<Rule> getRule(uint32_t
id);
50 bool removeRule(uint32_t
id);
52 virtual std::shared_ptr<Rule> getFirstMatchingRule(std::shared_ptr<const Rule> device_rule, uint32_t from_id = 1)
const;
54 std::vector<std::shared_ptr<const Rule>> getRules();
55 uint32_t assignID(std::shared_ptr<Rule> rule);
63 mutable std::mutex _op_mutex;
65 bool _writable{
false};
69 Atomic<uint32_t> _id_next;
70 std::vector<std::shared_ptr<Rule>> _rules;
Target
Enumeration of possible rule targets.
Definition: Rule.hpp:86
Definition: RuleSet.hpp:31
Determines whether USB device mathing specified criteria should be authorized, deauthorized or remove...
Definition: Rule.hpp:77
static const uint32_t LastID
Sequence number for specifying that the last rule in the ruleset should be used in context of the ope...
Definition: Rule.hpp:194
Allows to receive signals and to communicate with the USBGuard daemon.
Definition: Interface.hpp:40