|
PcapPlusPlus
Next
|
#include <BluetoothHciLayer.h>
Classes | |
| struct | SerializedFields |
Public Member Functions | |
| BluetoothHciEventLayer (uint8_t eventCode, const std::vector< uint8_t > ¶meters={}) | |
| BluetoothHciEventLayer (BluetoothHciDirection direction, uint8_t eventCode, const std::vector< uint8_t > ¶meters={}) | |
| uint8_t | getEventCode () const |
| void | setEventCode (uint8_t eventCode) |
| uint8_t | getParameterTotalLength () const |
| uint8_t * | getParameters () const |
| void | setParameters (const std::vector< uint8_t > ¶meters) |
| size_t | getHeaderLen () const override |
| std::string | toString () const override |
Public Member Functions inherited from pcpp::BluetoothHciLayer | |
| bool | hasDirectionHeader () const |
| BluetoothHciDirection | getDirection () const |
| BluetoothHciPacketType | getPacketType () const |
| void | parseNextLayer () override |
| void | computeCalculateFields () override |
| Does nothing for this layer. | |
| OsiModelLayer | getOsiModelLayer () const override |
Public Member Functions inherited from pcpp::Layer | |
| ~Layer () override | |
| Layer * | getNextLayer () const |
| Layer * | getPrevLayer () const |
| ProtocolType | getProtocol () const |
| bool | isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) const |
| uint8_t * | getData () const |
| size_t | getDataLen () const |
| uint8_t * | getLayerPayload () const |
| size_t | getLayerPayloadSize () const |
| bool | isAllocatedToPacket () const |
| void | copyData (uint8_t *toArr) const |
| Copy the raw data of this layer to another array. More... | |
| size_t | copyData (uint8_t *dest, size_t destSize) const |
| Copy the raw data of this layer to another array, with a specified maximum size. More... | |
| void | serialize (ISerializer &serializer) const |
| uint8_t * | getDataPtr (size_t offset=0) const override |
Static Public Member Functions | |
| static bool | isDataValid (const uint8_t *data, size_t dataLen, bool hasDirectionHeader) |
Static Public Member Functions inherited from pcpp::BluetoothHciLayer | |
| static BluetoothHciLayer * | parseLayer (uint8_t *data, size_t dataLen, Packet *packet, bool hasDirectionHeader) |
| static bool | isDataValid (const uint8_t *data, size_t dataLen, bool hasDirectionHeader) |
Protected Member Functions | |
| void | serializeLayer (ObjectScope &serializer) const override |
Protected Member Functions inherited from pcpp::BluetoothHciLayer | |
| BluetoothHciLayer (uint8_t *data, size_t dataLen, Packet *packet, bool hasDirectionHeader) | |
| BluetoothHciLayer (bool hasDirectionHeader) | |
| size_t | getDirectionHeaderLen () const |
Protected Member Functions inherited from pcpp::Layer | |
| Packet * | getAttachedPacket () |
| Get a pointer to the Packet this layer is attached to (if any). More... | |
| Packet const * | getAttachedPacket () const |
| Get a pointer to the Packet this layer is attached to (if any). More... | |
| void | allocData (size_t dataLen, bool zeroInit=true) |
| Requests the layer to allocate a new data buffer of the specified length. More... | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Construct the next layer in the protocol stack. No validation is performed on the data. More... | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename TFactory , typename... Args> | |
| Layer * | constructNextLayerFromFactory (TFactory factoryFn, uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Construct the next layer in the protocol stack using a factory functor. More... | |
| template<typename TFactory , typename... Args> | |
| Layer * | constructNextLayerFromFactory (TFactory factoryFn, uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| Construct the next layer in the protocol stack using a factory functor. More... | |
| template<typename T , typename... Args> | |
| Layer * | tryConstructNextLayer (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| template<typename T , typename... Args> | |
| Layer * | tryConstructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack with a fallback option. More... | |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename TFallback , typename TFactory , typename... Args> | |
| Layer * | tryConstructNextLayerFromFactoryWithFallback (TFactory factoryFn, uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack using a factory functor with a fallback option. More... | |
| template<typename TFallback , typename TFactory , typename... Args> | |
| Layer * | tryConstructNextLayerFromFactoryWithFallback (TFactory factoryFn, uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack using a factory functor with a fallback option. More... | |
Additional Inherited Members | |
Public Types inherited from pcpp::BluetoothHciLayer | |
| enum class | BluetoothHciPacketType : uint8_t { Unknown = 0x00 , Command = 0x01 , AclData = 0x02 , ScoData = 0x03 , Event = 0x04 , IsoData = 0x05 } |
| enum class | BluetoothHciDirection : uint32_t { HostToController = 0 , ControllerToHost = 1 , Unknown = 0xffffffff } |
Static Protected Member Functions inherited from pcpp::Layer | |
| template<typename T > | |
| static bool | canReinterpretAs (const uint8_t *data, size_t dataLen) |
| Check if the data is large enough to reinterpret as a type. More... | |
Static Protected Attributes inherited from pcpp::BluetoothHciLayer | |
| static constexpr size_t | directionHeaderSize = 4 |
Represents a Bluetooth HCI Event packet, identified by the H4 packet indicator octet 0x04
|
explicit |
Construct a new Event layer with no direction pseudo-header, suitable for serialization to LINKTYPE_BLUETOOTH_HCI_H4 captures
| [in] | eventCode | The HCI event code |
| [in] | parameters | The raw parameter bytes. Must contain at most 255 bytes |
| std::invalid_argument | if parameters contains more than 255 bytes |
| pcpp::BluetoothHciEventLayer::BluetoothHciEventLayer | ( | BluetoothHciDirection | direction, |
| uint8_t | eventCode, | ||
| const std::vector< uint8_t > & | parameters = {} |
||
| ) |
Construct a new Event layer prefixed with the 4-byte direction pseudo-header, suitable for serialization to LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR captures
| [in] | direction | The packet direction |
| [in] | eventCode | The HCI event code |
| [in] | parameters | The raw parameter bytes. Must contain at most 255 bytes |
| std::invalid_argument | if direction is not HostToController or ControllerToHost, or if parameters contains more than 255 bytes |
|
inline |
Get the event code of this packet
|
inlineoverridevirtual |
Implements pcpp::Layer.
|
inline |
Get a pointer to the raw event parameters
| uint8_t pcpp::BluetoothHciEventLayer::getParameterTotalLength | ( | ) | const |
Get the parameter total length. If the packet is truncated, i.e. the parameterTotalLength field is larger than the number of parameter bytes actually present, the number of bytes present is returned
|
static |
A static method that validates the input data
| [in] | data | The pointer to the beginning of a byte stream of a Bluetooth HCI Event packet |
| [in] | dataLen | The length of the byte stream |
| [in] | hasDirectionHeader | True if the data is expected to start with a 4-byte direction pseudo-header |
|
overrideprotectedvirtual |
Serializes the layer's data into a provided serializer object. This is used for generating serialized representations (like JSON) of the packet layers. This method should be overridden by derived layers to provide specific serialization logic.
| [in] | serializer | The object scope serializer to which the layer details should be written. |
Reimplemented from pcpp::Layer.
|
inline |
Set the event code of this packet
| [in] | eventCode | The new event code |
| void pcpp::BluetoothHciEventLayer::setParameters | ( | const std::vector< uint8_t > & | parameters | ) |
Replace the parameter bytes of this packet. The parameterTotalLength field is updated to match
| [in] | parameters | The new parameter bytes. Must contain at most 255 bytes |
| std::invalid_argument | if parameters contains more than 255 bytes |
| std::runtime_error | if the layer could not be extended or shortened to fit the new parameters |
|
overridevirtual |
Implements pcpp::Layer.