|
PcapPlusPlus
Next
|
#include <GvcpLayer.h>
Classes | |
| struct | SerializedFields |
Public Types | |
| 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 } |
Public Member Functions | |
| virtual GvcpCommand | getCommand () const =0 |
| virtual uint16_t | getDataSize () const =0 |
| 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 |
| virtual size_t | getHeaderLen () const =0 |
| virtual void | computeCalculateFields ()=0 |
| Each layer can compute field values automatically using this method. This is an abstract method. | |
| virtual std::string | toString () const =0 |
Static Public Member Functions | |
| 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 |
| 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 | |
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... | |
An abstract class representing the GigE Vision Control Protocol (GVCP). The class is implemented according to the GigE Vision specification 2.0. A GVCP layer holds the GVCP header, followed by the message fields that its class knows how to parse. parseNextLayer() puts the rest of the message, if any, in a PayloadLayer
|
strong |
GVCP command defines the command values and the corresponding acknowledge values. See more in the spec "18 Command and Acknowledge Values"
| Enumerator | |
|---|---|
| DiscoveredCmd | Discovery command (Discovery Protocol Control) |
| DiscoveredAck | Discovery acknowledge (Discovery Protocol Control) |
| ForceIpCmd | Force IP command (Discovery Protocol Control) |
| ForceIpAck | Force IP acknowledge (Discovery Protocol Control) |
| PacketResendCmd | Packet resend command (Streaming Protocol Control) |
| PacketResendAck | Packet resend acknowledge (Streaming Protocol Control). The resent packet must be on the stream channel. |
| ReadRegCmd | Read register command (Device Memory Access) |
| ReadRegAck | Read register acknowledge (Device Memory Access) |
| WriteRegCmd | Write register command (Device Memory Access) |
| WriteRegAck | Write register acknowledge (Device Memory Access) |
| ReadMemCmd | Read memory command (Device Memory Access) |
| ReadMemAck | Read memory acknowledge (Device Memory Access) |
| WriteMemCmd | Write memory command (Device Memory Access) |
| WriteMemAck | Write memory acknowledge (Device Memory Access) |
| PendingAck | Pending acknowledge (Device Memory Access) |
| EventCmd | Event command (Asynchronous Events) |
| EventAck | Event acknowledge (Asynchronous Events) |
| EventDataCmd | Event data command (Asynchronous Events) |
| EventDataAck | Event data acknowledge (Asynchronous Events) |
| ActionCmd | Action command (Miscellaneous) |
| ActionAck | Action acknowledge (Miscellaneous) |
| Unknown | Unknown command. |
|
pure virtual |
Implemented in pcpp::GvcpAcknowledgeLayer, and pcpp::GvcpRequestLayer.
|
pure virtual |
Implemented in pcpp::GvcpAcknowledgeLayer, and pcpp::GvcpRequestLayer.
|
inlineoverridevirtual |
Implements pcpp::Layer.
|
protected |
Allocate zeroed data for a new layer and set the protocol
| [in] | dataLen | The size of the data to allocate in bytes |
|
inlinestatic |
A static method that checks whether the port is considered as GVCP
| [in] | port | The port number to be checked |
|
static |
A static method that parses the raw data and creates the matching GVCP layer. If the data begins with the GVCP magic number, the method creates a request layer, otherwise an acknowledge layer. For Discovery and Force IP messages, the method creates their specific layers, unless the data is too short for the fields of these messages
| [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 |
|
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.
Reimplemented in pcpp::GvcpForceIpRequestLayer, pcpp::GvcpDiscoveryAcknowledgeLayer, pcpp::GvcpDiscoveryRequestLayer, pcpp::GvcpAcknowledgeLayer, and pcpp::GvcpRequestLayer.