Parses USB descriptors.
More...
#include <USB.hpp>
|
|
| USBDescriptorParser (USBDescriptorParserHooks &hooks) |
| |
| size_t | parse (std::istream &stream) |
| | Initiate parsing of USB descriptors from an input stream. More...
|
| |
| const std::vector< USBDescriptor > * | getDescriptor (uint8_t bDescriptorType) const |
| | Returns a pointer to a USBDescriptor of type bDescriptorType that is stored in the USB descriptor state. More...
|
| |
| void | setDescriptor (uint8_t bDescriptorType, const USBDescriptor &descriptor) |
| | Set the active instance of an USB descriptor of type bDescriptorType. More...
|
| |
| void | delDescriptor (uint8_t bDescriptorType) |
| | Delete the active instance of an USB descriptor of bDescriptorType type. More...
|
| |
| bool | haveDescriptor (uint8_t bDescriptorType) const |
| | Checks whether descriptor state contains a USB descriptor of type bDescriptorType. More...
|
| |
| const std::vector< std::pair< uint8_t, size_t > > | getDescriptorCounts () const |
| | Returns a vector of (bDescriptorType, count) pairs. More...
|
| |
◆ delDescriptor()
| void usbguard::USBDescriptorParser::delDescriptor |
( |
uint8_t |
bDescriptorType | ) |
|
Delete the active instance of an USB descriptor of bDescriptorType type.
- Parameters
-
| bDescriptorType | Type of descriptor to remove. |
◆ getDescriptor()
| const std::vector< USBDescriptor > * usbguard::USBDescriptorParser::getDescriptor |
( |
uint8_t |
bDescriptorType | ) |
const |
Returns a pointer to a USBDescriptor of type bDescriptorType that is stored in the USB descriptor state.
If there's no such descriptor, then nullptr is returned.
- Parameters
-
| bDescriptorType | Type of descriptor. |
- Returns
- Pointer to a USBDescriptor of type
bDescriptorType or nullptr if there's no such descriptor.
◆ getDescriptorCounts()
| const std::vector< std::pair< uint8_t, size_t > > usbguard::USBDescriptorParser::getDescriptorCounts |
( |
| ) |
const |
Returns a vector of (bDescriptorType, count) pairs.
- Returns
- Vector of (
bDescriptorType, count) pairs.
◆ haveDescriptor()
| bool usbguard::USBDescriptorParser::haveDescriptor |
( |
uint8_t |
bDescriptorType | ) |
const |
Checks whether descriptor state contains a USB descriptor of type bDescriptorType.
- Parameters
-
| bDescriptorType | Type of descriptor. |
- Returns
- True if the descriptor state contains a USB descriptor of type bDescriptorType, false otherwise.
◆ parse()
| size_t usbguard::USBDescriptorParser::parse |
( |
std::istream & |
stream | ) |
|
Initiate parsing of USB descriptors from an input stream.
- Parameters
-
- Returns
- Number of bytes succesfully parsed/processed from the stream.
◆ setDescriptor()
| void usbguard::USBDescriptorParser::setDescriptor |
( |
uint8_t |
bDescriptorType, |
|
|
const USBDescriptor & |
descriptor |
|
) |
| |
Set the active instance of an USB descriptor of type bDescriptorType.
- Parameters
-
| bDescriptorType | Type of descriptor. @descriptor Descriptor to set. |
The documentation for this class was generated from the following files: