USBGuard
Software framework that protects your computer against rogue USB devices by implementing basic whitelisting and blacklisting capabilities.
Public Member Functions | Protected Attributes | List of all members
usbguard::RuleSet Class Referenceabstract
Inheritance diagram for usbguard::RuleSet:
usbguard::MemoryRuleSet

Public Member Functions

 RuleSet (Interface *const interface_ptr)
 
 RuleSet (const RuleSet &rhs)
 
const RuleSetoperator= (const RuleSet &rhs)
 
virtual void load ()=0
 
virtual void save ()=0
 
void serialize (std::ostream &stream) const
 
void setDefaultTarget (Rule::Target target)
 
Rule::Target getDefaultTarget () const
 
uint32_t appendRule (const Rule &rule, uint32_t parent_id=Rule::LastID, bool lock=true)
 
uint32_t upsertRule (const Rule &match_rule, const Rule &new_rule, bool parent_insensitive=false)
 
std::shared_ptr< RulegetRule (uint32_t id)
 
bool removeRule (uint32_t id)
 
virtual std::shared_ptr< RulegetFirstMatchingRule (std::shared_ptr< const Rule > device_rule, uint32_t from_id=1) const
 
std::vector< std::shared_ptr< const Rule > > getRules ()
 
uint32_t assignID (std::shared_ptr< Rule > rule)
 
uint32_t assignID ()
 
void setWritable ()
 
void clearWritable ()
 
bool isWritable ()
 

Protected Attributes

std::mutex _op_mutex
 
bool _writable {false}
 
Interface_interface_ptr {nullptr}
 
Rule::Target _default_target
 
Atomic< uint32_t > _id_next
 
std::vector< std::shared_ptr< Rule > > _rules
 

The documentation for this class was generated from the following files: