|
PcapPlusPlus
Next
|
#include <GvcpLayer.h>
Classes | |
| struct | gvcp_request_header |
| struct | SerializedFields |
Public Member Functions | |
| GvcpRequestLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
| GvcpRequestLayer (GvcpCommand command, GvcpFlag flag=0, uint16_t requestId=1) | |
| GvcpFlag | getFlag () const |
| void | setFlag (GvcpFlag flag) |
| bool | hasAcknowledgeFlag () const |
| uint16_t | getRequestId () const |
| void | setRequestId (uint16_t requestId) |
| GvcpCommand | getCommand () const override |
| uint16_t | getDataSize () const override |
| size_t | getHeaderLen () const override |
| void | computeCalculateFields () override |
| Calculate the data size field in the header according to the size of the data that follows the header. | |
| std::string | toString () const override |
Public Member Functions inherited from pcpp::GvcpLayer | |
| void | parseNextLayer () override |
| Creates a PayloadLayer from the rest of the message, if there is data after 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) |
Static Public Member Functions inherited from pcpp::GvcpLayer | |
| static bool | isGvcpPort (uint16_t port) |
| static GvcpLayer * | parseGvcpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) |
Protected Member Functions | |
| void | serializeLayer (ObjectScope &serializer) const override |
| GvcpRequestLayer (GvcpCommand command, GvcpFlag flag, uint16_t requestId, size_t bodyLen) | |
Protected Member Functions inherited from pcpp::GvcpLayer | |
| void | initLayer (size_t dataLen) |
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::GvcpLayer | |
| enum class | GvcpCommand : uint16_t { DiscoveredCmd = 0x0002 , DiscoveredAck = 0x0003 , ForceIpCmd = 0x0004 , ForceIpAck = 0x0005 , PacketResendCmd = 0x0040 , PacketResendAck = 0x0041 , ReadRegCmd = 0x0080 , ReadRegAck = 0x0081 , WriteRegCmd = 0x0082 , WriteRegAck = 0x0083 , ReadMemCmd = 0x0084 , ReadMemAck = 0x0085 , WriteMemCmd = 0x0086 , WriteMemAck = 0x0087 , PendingAck = 0x0089 , EventCmd = 0x00C0 , EventAck = 0x00C1 , EventDataCmd = 0x00C2 , EventDataAck = 0x00C3 , ActionCmd = 0x0100 , ActionAck = 0x0101 , Unknown = 0xFFFF } |
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... | |
Represents a GVCP request (command) message. Commands which don't have a specific layer class are represented by this class
|
inline |
A constructor that creates the layer from an existing packet raw data
| [in] | data | A pointer to the raw data |
| [in] | dataLen | Size of the data in bytes |
| [in] | prevLayer | A pointer to the previous layer |
| [in] | packet | A pointer to the Packet instance where layer will be stored in |
|
inlineexplicit |
A constructor that creates a new GVCP request which contains only the GVCP header. To add message data, add a PayloadLayer after this layer
| [in] | command | The command |
| [in] | flag | The flag, optional |
| [in] | requestId | The request ID, optional. The spec requires a non-zero value |
| std::invalid_argument | if the command is an acknowledge value (an odd value) |
|
protected |
A constructor that creates a new GVCP request with a message body of zeroed bytes after the header
| [in] | command | The command |
| [in] | flag | The flag |
| [in] | requestId | The request ID |
| [in] | bodyLen | The size of the message body in bytes |
| std::invalid_argument | if the command is an acknowledge value (an odd value) |
|
overridevirtual |
Implements pcpp::GvcpLayer.
|
overridevirtual |
Implements pcpp::GvcpLayer.
| GvcpFlag pcpp::GvcpRequestLayer::getFlag | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
Reimplemented in pcpp::GvcpForceIpRequestLayer.
| uint16_t pcpp::GvcpRequestLayer::getRequestId | ( | ) | const |
| bool pcpp::GvcpRequestLayer::hasAcknowledgeFlag | ( | ) | const |
|
static |
A static method that checks whether the data is a valid GVCP request. The data must be large enough to hold a GVCP request header and must begin with the GVCP magic number
| [in] | data | A pointer to the raw data |
| [in] | dataLen | Size of the data in bytes |
|
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::GvcpLayer.
Reimplemented in pcpp::GvcpForceIpRequestLayer, and pcpp::GvcpDiscoveryRequestLayer.
| void pcpp::GvcpRequestLayer::setFlag | ( | GvcpFlag | flag | ) |
Set the flag in the header
| [in] | flag | The flag to set |
| void pcpp::GvcpRequestLayer::setRequestId | ( | uint16_t | requestId | ) |
Set the request ID in the header
| [in] | requestId | The request ID to set |
|
overridevirtual |
Implements pcpp::Layer.