PcapPlusPlus  Next
GvcpLayer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "IpAddress.h"
4 #include "Layer.h"
5 #include "MacAddress.h"
6 #include <algorithm>
7 #include <initializer_list>
8 #include <iterator>
9 #include <ostream>
10 #include <string>
11 
15 
18 namespace pcpp
19 {
22  using GvcpFlag = uint8_t;
23 
32  class GvcpLayer : public Layer
33  {
34  public:
37  enum class GvcpCommand : uint16_t
38  {
40  DiscoveredCmd = 0x0002,
42  DiscoveredAck = 0x0003,
44  ForceIpCmd = 0x0004,
46  ForceIpAck = 0x0005,
47 
49  PacketResendCmd = 0x0040,
51  PacketResendAck = 0x0041,
52 
54  ReadRegCmd = 0x0080,
56  ReadRegAck = 0x0081,
58  WriteRegCmd = 0x0082,
60  WriteRegAck = 0x0083,
62  ReadMemCmd = 0x0084,
64  ReadMemAck = 0x0085,
66  WriteMemCmd = 0x0086,
68  WriteMemAck = 0x0087,
70  PendingAck = 0x0089,
71 
73  EventCmd = 0x00C0,
75  EventAck = 0x00C1,
77  EventDataCmd = 0x00C2,
79  EventDataAck = 0x00C3,
80 
82  ActionCmd = 0x0100,
84  ActionAck = 0x0101,
85 
87  Unknown = 0xFFFF
88  };
89 
93  static bool isGvcpPort(uint16_t port)
94  {
95  return port == 3956;
96  }
97 
107  static GvcpLayer* parseGvcpLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet);
108 
111  virtual GvcpCommand getCommand() const = 0;
112 
114  virtual uint16_t getDataSize() const = 0;
115 
116  // Overridden methods
117 
119  void parseNextLayer() override;
120 
123  {
125  }
126 
131  {
133  static std::vector<FieldDescriptor> all()
134  {
135  auto result = Layer::SerializedFields::all();
136  std::initializer_list<FieldDescriptor> extra{ Command, CommandName };
137  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
138  return result;
139  }
140 
142  static const FieldDescriptor Command;
143 
146 
147  // cppcheck-suppress duplInheritedMember
149  static constexpr uint16_t MaxID = Layer::SerializedFields::MaxID + 2;
150  };
151 
152  protected:
153  void serializeLayer(ObjectScope& serializer) const override;
154 
155  GvcpLayer() = default;
156 
157  GvcpLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
158  : Layer(data, dataLen, prevLayer, packet, GVCP)
159  {}
160 
163  void initLayer(size_t dataLen);
164 
165  private:
168  static uint16_t getRawCommand(const uint8_t* data);
169  };
170 
173  std::ostream& operator<<(std::ostream& os, GvcpLayer::GvcpCommand command);
174 
179  {
180  public:
186  GvcpRequestLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
187  : GvcpLayer(data, dataLen, prevLayer, packet)
188  {}
189 
196  explicit GvcpRequestLayer(GvcpCommand command, GvcpFlag flag = 0, uint16_t requestId = 1)
197  : GvcpRequestLayer(command, flag, requestId, 0)
198  {}
199 
205  static bool isDataValid(const uint8_t* data, size_t dataLen);
206 
208  GvcpFlag getFlag() const;
209 
212  void setFlag(GvcpFlag flag);
213 
215  bool hasAcknowledgeFlag() const;
216 
218  uint16_t getRequestId() const;
219 
222  void setRequestId(uint16_t requestId);
223 
224  // Overridden methods
225 
227  GvcpCommand getCommand() const override;
228 
230  uint16_t getDataSize() const override;
231 
233  size_t getHeaderLen() const override
234  {
235  return sizeof(gvcp_request_header);
236  }
237 
239  void computeCalculateFields() override;
240 
242  std::string toString() const override;
243 
248  {
250  static std::vector<FieldDescriptor> all()
251  {
252  auto result = GvcpLayer::SerializedFields::all();
253  std::initializer_list<FieldDescriptor> extra{ Flag, AcknowledgeRequired, RequestId };
254  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
255  return result;
256  }
257 
259  static const FieldDescriptor Flag;
260 
263 
266 
267  // cppcheck-suppress duplInheritedMember
269  static constexpr uint16_t MaxID = GvcpLayer::SerializedFields::MaxID + 3;
270  };
271 
272  protected:
273  void serializeLayer(ObjectScope& serializer) const override;
274 
275 #pragma pack(push, 1)
279  {
281  uint8_t magicNumber;
283  uint8_t flag;
285  uint16_t command;
287  uint16_t dataSize;
289  uint16_t requestId;
290  };
291 #pragma pack(pop)
292  static_assert(sizeof(gvcp_request_header) == 8, "gvcp_request_header size is not 8 bytes");
293 
300  GvcpRequestLayer(GvcpCommand command, GvcpFlag flag, uint16_t requestId, size_t bodyLen);
301 
302  private:
303  // GvcpLayer::parseGvcpLayer() reads the command from the header
304  friend class GvcpLayer;
305 
306  gvcp_request_header* getGvcpHeader() const
307  {
308  return reinterpret_cast<gvcp_request_header*>(m_Data);
309  }
310  };
311 
316  {
317  public:
320  enum class GvcpResponseStatus : uint16_t
321  {
323  Success = 0x0000,
325  PacketResend = 0x0100,
327  NotImplemented = 0x8001,
329  InvalidParameter = 0x8002,
331  InvalidAddress = 0x8003,
333  WriteProtect = 0x8004,
335  BadAlignment = 0x8005,
337  AccessDenied = 0x8006,
340  Busy = 0x8007,
342  LocalProblem = 0x8008,
344  MsgMismatch = 0x8009,
346  InvalidProtocol = 0x800A,
348  NoMsg = 0x800B,
350  PacketUnavailable = 0x800C,
352  DataOverrun = 0x800D,
354  InvalidHeader = 0x800E,
356  WrongConfig = 0x800F,
359  PacketNotYetAvailable = 0x8010,
364  PacketRemovedFromMemory = 0x8012,
366  NoRefTime = 0x8013,
371  Overflow = 0x8015,
373  ActionLate = 0x8016,
375  LeaderTrailerOverflow = 0x8017,
377  Error = 0x8FFF,
379  Unknown = 0xFFFF
380  };
381 
387  GvcpAcknowledgeLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
388  : GvcpLayer(data, dataLen, prevLayer, packet)
389  {}
390 
397  GvcpAcknowledgeLayer(GvcpResponseStatus status, GvcpCommand command, uint16_t ackId = 0)
398  : GvcpAcknowledgeLayer(status, command, ackId, 0)
399  {}
400 
405  static bool isDataValid(const uint8_t* data, size_t dataLen);
406 
410 
414 
416  uint16_t getAckId() const;
417 
420  void setAckId(uint16_t ackId);
421 
422  // Overridden methods
423 
425  GvcpCommand getCommand() const override;
426 
428  uint16_t getDataSize() const override;
429 
431  size_t getHeaderLen() const override
432  {
433  return sizeof(gvcp_ack_header);
434  }
435 
437  void computeCalculateFields() override;
438 
440  std::string toString() const override;
441 
446  {
448  static std::vector<FieldDescriptor> all()
449  {
450  auto result = GvcpLayer::SerializedFields::all();
451  std::initializer_list<FieldDescriptor> extra{ Status, StatusName, AckId };
452  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
453  return result;
454  }
455 
457  static const FieldDescriptor Status;
458 
461 
463  static const FieldDescriptor AckId;
464 
465  // cppcheck-suppress duplInheritedMember
467  static constexpr uint16_t MaxID = GvcpLayer::SerializedFields::MaxID + 3;
468  };
469 
470  protected:
471  void serializeLayer(ObjectScope& serializer) const override;
472 
473 #pragma pack(push, 1)
477  {
479  uint16_t status;
481  uint16_t command;
483  uint16_t dataSize;
485  uint16_t ackId;
486  };
487 #pragma pack(pop)
488  static_assert(sizeof(gvcp_ack_header) == 8, "gvcp_ack_header size is not 8 bytes");
489 
496  GvcpAcknowledgeLayer(GvcpResponseStatus status, GvcpCommand command, uint16_t ackId, size_t bodyLen);
497 
498  private:
499  // GvcpLayer::parseGvcpLayer() reads the command from the header
500  friend class GvcpLayer;
501 
502  gvcp_ack_header* getGvcpHeader() const
503  {
504  return reinterpret_cast<gvcp_ack_header*>(m_Data);
505  }
506  };
507 
510  std::ostream& operator<<(std::ostream& os, GvcpAcknowledgeLayer::GvcpResponseStatus status);
511 
515  {
516  public:
522  GvcpDiscoveryRequestLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
523  : GvcpRequestLayer(data, dataLen, prevLayer, packet)
524  {}
525 
530  explicit GvcpDiscoveryRequestLayer(bool allowBroadcastAck = false, bool acknowledgeRequired = true,
531  uint16_t requestId = 1);
532 
536 
539  void setAllowBroadcastAckFlag(bool allowBroadcastAck);
544  {
546  static std::vector<FieldDescriptor> all()
547  {
549  std::initializer_list<FieldDescriptor> extra{ AllowBroadcastAck };
550  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
551  return result;
552  }
553 
556 
557  // cppcheck-suppress duplInheritedMember
559  static constexpr uint16_t MaxID = GvcpRequestLayer::SerializedFields::MaxID + 1;
560  };
561 
562  protected:
563  void serializeLayer(ObjectScope& serializer) const override;
564  };
565 
569  {
570  public:
573  struct GvcpVersion
574  {
576  uint16_t major;
578  uint16_t minor;
579  };
580 
586  GvcpDiscoveryAcknowledgeLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
587  : GvcpAcknowledgeLayer(data, dataLen, prevLayer, packet)
588  {}
589 
595  uint16_t ackId = 0);
596 
597  // cppcheck-suppress duplInheritedMember
602  static bool isDataValid(const uint8_t* data, size_t dataLen);
603 
606 
609  void setVersion(const GvcpVersion& version);
610 
613 
616  void setMacAddress(const MacAddress& macAddress);
617 
620 
623  void setIpAddress(const IPv4Address& ipAddress);
624 
627 
630  void setSubnetMask(const IPv4Address& subnetMask);
631 
634 
637  void setGatewayIpAddress(const IPv4Address& gatewayIpAddress);
638 
640  std::string getManufacturerName() const;
641 
644  void setManufacturerName(const std::string& manufacturerName);
645 
647  std::string getModelName() const;
648 
651  void setModelName(const std::string& modelName);
652 
654  std::string getDeviceVersion() const;
655 
658  void setDeviceVersion(const std::string& deviceVersion);
659 
662 
665  void setManufacturerSpecificInformation(const std::string& info);
666 
668  std::string getSerialNumber() const;
669 
672  void setSerialNumber(const std::string& serialNumber);
673 
675  std::string getUserDefinedName() const;
676 
679  void setUserDefinedName(const std::string& userDefinedName);
680 
681  // Overridden methods
682 
684  size_t getHeaderLen() const override
685  {
686  return sizeof(gvcp_ack_header) + sizeof(gvcp_discovery_body);
687  }
688 
693  {
695  static std::vector<FieldDescriptor> all()
696  {
698  std::initializer_list<FieldDescriptor> extra{
702  };
703  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
704  return result;
705  }
706 
709 
712 
715 
718 
721 
724 
727 
730 
733 
736 
739 
742 
743  // cppcheck-suppress duplInheritedMember
745  static constexpr uint16_t MaxID = GvcpAcknowledgeLayer::SerializedFields::MaxID + 12;
746  };
747 
748  protected:
749  void serializeLayer(ObjectScope& serializer) const override;
750 
751  private:
752 #pragma pack(push, 1)
754  struct gvcp_discovery_body
755  {
757  uint16_t versionMajor;
759  uint16_t versionMinor;
761  uint32_t deviceMode;
763  uint16_t reserved;
765  uint8_t macAddress[6];
767  uint32_t supportedIpConfigOptions;
769  uint32_t ipConfigCurrent;
771  uint8_t reserved2[12];
773  uint32_t ipAddress;
775  uint8_t reserved3[12];
777  uint32_t subnetMask;
779  uint8_t reserved4[12];
781  uint32_t defaultGateway;
783  char manufacturerName[32];
785  char modelName[32];
787  char deviceVersion[32];
789  char manufacturerSpecificInformation[48];
791  char serialNumber[16];
793  char userDefinedName[16];
794  };
795 #pragma pack(pop)
796  static_assert(sizeof(gvcp_discovery_body) == 248, "gvcp_discovery_body size is not 248 bytes");
797 
798  gvcp_discovery_body* getGvcpDiscoveryBody() const
799  {
800  return reinterpret_cast<gvcp_discovery_body*>(m_Data + sizeof(gvcp_ack_header));
801  }
802  };
803 
807  {
808  public:
814  GvcpForceIpRequestLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
815  : GvcpRequestLayer(data, dataLen, prevLayer, packet)
816  {}
817 
825  GvcpForceIpRequestLayer(const MacAddress& macAddress, const IPv4Address& ipAddress,
826  const IPv4Address& subnetMask, const IPv4Address& gatewayIpAddress, GvcpFlag flag = 0,
827  uint16_t requestId = 1);
828 
829  // cppcheck-suppress duplInheritedMember
835  static bool isDataValid(const uint8_t* data, size_t dataLen);
836 
839 
842  void setMacAddress(const MacAddress& macAddress);
843 
846 
849  void setIpAddress(const IPv4Address& ipAddress);
850 
853 
856  void setSubnetMask(const IPv4Address& subnetMask);
857 
860 
863  void setGatewayIpAddress(const IPv4Address& gatewayIpAddress);
864 
865  // Overridden methods
866 
868  size_t getHeaderLen() const override
869  {
870  return sizeof(gvcp_request_header) + sizeof(gvcp_forceip_body);
871  }
872 
877  {
879  static std::vector<FieldDescriptor> all()
880  {
882  std::initializer_list<FieldDescriptor> extra{ MacAddress, IpAddress, SubnetMask, GatewayIpAddress };
883  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
884  return result;
885  }
886 
889 
892 
895 
898 
899  // cppcheck-suppress duplInheritedMember
901  static constexpr uint16_t MaxID = GvcpRequestLayer::SerializedFields::MaxID + 4;
902  };
903 
904  protected:
905  void serializeLayer(ObjectScope& serializer) const override;
906 
907  private:
908 #pragma pack(push, 1)
910  struct gvcp_forceip_body
911  {
913  uint8_t reserved[2];
915  uint8_t macAddress[6];
917  uint8_t reserved2[12];
919  uint32_t ipAddress;
921  uint8_t reserved3[12];
923  uint32_t subnetMask;
925  uint8_t reserved4[12];
927  uint32_t gateway;
928  };
929 #pragma pack(pop)
930  static_assert(sizeof(gvcp_forceip_body) == 56, "gvcp_forceip_body size is not 56 bytes");
931 
932  gvcp_forceip_body* getGvcpForceIpBody() const
933  {
934  return reinterpret_cast<gvcp_forceip_body*>(m_Data + sizeof(gvcp_request_header));
935  }
936  };
937 
941  {
942  public:
948  GvcpForceIpAcknowledgeLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
949  : GvcpAcknowledgeLayer(data, dataLen, prevLayer, packet)
950  {}
951 
956  uint16_t ackId = 0)
957  : GvcpAcknowledgeLayer(status, GvcpCommand::ForceIpAck, ackId)
958  {}
959  };
960 } // namespace pcpp
Definition: GvcpLayer.h:316
GvcpResponseStatus getStatus() const
void serializeLayer(ObjectScope &serializer) const override
GvcpCommand getCommand() const override
GvcpAcknowledgeLayer(GvcpResponseStatus status, GvcpCommand command, uint16_t ackId, size_t bodyLen)
uint16_t getAckId() const
void setAckId(uint16_t ackId)
static bool isDataValid(const uint8_t *data, size_t dataLen)
void setStatus(GvcpResponseStatus status)
GvcpAcknowledgeLayer(GvcpResponseStatus status, GvcpCommand command, uint16_t ackId=0)
Definition: GvcpLayer.h:397
uint16_t getDataSize() const override
std::string toString() const override
size_t getHeaderLen() const override
Definition: GvcpLayer.h:431
void computeCalculateFields() override
Calculate the data size field in the header according to the size of the data that follows the header...
GvcpAcknowledgeLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:387
GvcpResponseStatus
Definition: GvcpLayer.h:321
@ Overflow
A device queue or packet data has overflowed.
@ DataOverrun
Internal memory of GVSP transmitter overrun (typically for image acquisition)
@ WriteProtect
The addressed register cannot be written to.
@ Success
Command executed successfully.
@ InvalidParameter
At least one parameter provided in the command is invalid (or out of range) for the device.
@ InvalidAddress
An attempt was made to access a non-existent address space location.
@ ActionLate
The requested scheduled action command was requested at a time that is already past.
@ PacketResend
Only applies to packet being resent.
@ NoRefTime
The device is not synchronized to a master clock to be used as time reference.
@ PacketRemovedFromMemory
The requested packet is not available anymore and has been discarded from the GVSP transmitter memory...
@ PacketUnavailable
The requested packet is not available anymore.
@ NotImplemented
Command is not supported by the device.
@ LeaderTrailerOverflow
Leader or trailer overflow (GEV 2.1)
@ AccessDenied
An attempt was made to access an address location which is currently/momentary not accessible.
@ BadAlignment
A badly aligned address offset or data size was specified.
@ InvalidHeader
The message header is not valid. Some of its fields do not match the specification.
Definition: GvcpLayer.h:569
std::string getUserDefinedName() const
void serializeLayer(ObjectScope &serializer) const override
size_t getHeaderLen() const override
Definition: GvcpLayer.h:684
void setModelName(const std::string &modelName)
void setUserDefinedName(const std::string &userDefinedName)
std::string getDeviceVersion() const
void setVersion(const GvcpVersion &version)
GvcpDiscoveryAcknowledgeLayer(GvcpResponseStatus status=GvcpResponseStatus::Success, uint16_t ackId=0)
void setMacAddress(const MacAddress &macAddress)
static bool isDataValid(const uint8_t *data, size_t dataLen)
std::string getSerialNumber() const
void setSubnetMask(const IPv4Address &subnetMask)
void setManufacturerName(const std::string &manufacturerName)
IPv4Address getGatewayIpAddress() const
void setManufacturerSpecificInformation(const std::string &info)
std::string getManufacturerSpecificInformation() const
std::string getManufacturerName() const
void setSerialNumber(const std::string &serialNumber)
void setGatewayIpAddress(const IPv4Address &gatewayIpAddress)
void setIpAddress(const IPv4Address &ipAddress)
GvcpDiscoveryAcknowledgeLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:586
void setDeviceVersion(const std::string &deviceVersion)
Definition: GvcpLayer.h:515
void serializeLayer(ObjectScope &serializer) const override
void setAllowBroadcastAckFlag(bool allowBroadcastAck)
GvcpDiscoveryRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:522
GvcpDiscoveryRequestLayer(bool allowBroadcastAck=false, bool acknowledgeRequired=true, uint16_t requestId=1)
Definition: GvcpLayer.h:941
GvcpForceIpAcknowledgeLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:948
GvcpForceIpAcknowledgeLayer(GvcpResponseStatus status=GvcpResponseStatus::Success, uint16_t ackId=0)
Definition: GvcpLayer.h:955
Definition: GvcpLayer.h:807
void setSubnetMask(const IPv4Address &subnetMask)
IPv4Address getGatewayIpAddress() const
IPv4Address getIpAddress() const
IPv4Address getSubnetMask() const
MacAddress getMacAddress() const
GvcpForceIpRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:814
void setIpAddress(const IPv4Address &ipAddress)
static bool isDataValid(const uint8_t *data, size_t dataLen)
GvcpForceIpRequestLayer(const MacAddress &macAddress, const IPv4Address &ipAddress, const IPv4Address &subnetMask, const IPv4Address &gatewayIpAddress, GvcpFlag flag=0, uint16_t requestId=1)
void setGatewayIpAddress(const IPv4Address &gatewayIpAddress)
void serializeLayer(ObjectScope &serializer) const override
size_t getHeaderLen() const override
Definition: GvcpLayer.h:868
void setMacAddress(const MacAddress &macAddress)
Definition: GvcpLayer.h:33
virtual GvcpCommand getCommand() const =0
OsiModelLayer getOsiModelLayer() const override
Definition: GvcpLayer.h:122
GvcpCommand
Definition: GvcpLayer.h:38
@ ReadMemCmd
Read memory command (Device Memory Access)
@ ForceIpCmd
Force IP command (Discovery Protocol Control)
@ ForceIpAck
Force IP acknowledge (Discovery Protocol Control)
@ DiscoveredAck
Discovery acknowledge (Discovery Protocol Control)
@ WriteRegCmd
Write register command (Device Memory Access)
@ ReadRegCmd
Read register command (Device Memory Access)
@ EventDataAck
Event data acknowledge (Asynchronous Events)
@ ActionCmd
Action command (Miscellaneous)
@ ActionAck
Action acknowledge (Miscellaneous)
@ WriteMemAck
Write memory acknowledge (Device Memory Access)
@ WriteRegAck
Write register acknowledge (Device Memory Access)
@ WriteMemCmd
Write memory command (Device Memory Access)
@ EventAck
Event acknowledge (Asynchronous Events)
@ ReadMemAck
Read memory acknowledge (Device Memory Access)
@ PendingAck
Pending acknowledge (Device Memory Access)
@ Unknown
Unknown command.
@ PacketResendAck
Packet resend acknowledge (Streaming Protocol Control). The resent packet must be on the stream chann...
@ EventCmd
Event command (Asynchronous Events)
@ EventDataCmd
Event data command (Asynchronous Events)
@ ReadRegAck
Read register acknowledge (Device Memory Access)
@ PacketResendCmd
Packet resend command (Streaming Protocol Control)
@ DiscoveredCmd
Discovery command (Discovery Protocol Control)
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.
void initLayer(size_t dataLen)
void serializeLayer(ObjectScope &serializer) const override
static bool isGvcpPort(uint16_t port)
Definition: GvcpLayer.h:93
static GvcpLayer * parseGvcpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:179
std::string toString() const override
static bool isDataValid(const uint8_t *data, size_t dataLen)
bool hasAcknowledgeFlag() const
GvcpRequestLayer(GvcpCommand command, GvcpFlag flag, uint16_t requestId, size_t bodyLen)
GvcpRequestLayer(GvcpCommand command, GvcpFlag flag=0, uint16_t requestId=1)
Definition: GvcpLayer.h:196
void serializeLayer(ObjectScope &serializer) const override
GvcpCommand getCommand() const override
uint16_t getRequestId() const
uint16_t getDataSize() const override
void setRequestId(uint16_t requestId)
void computeCalculateFields() override
Calculate the data size field in the header according to the size of the data that follows the header...
size_t getHeaderLen() const override
Definition: GvcpLayer.h:233
GvcpFlag getFlag() const
GvcpRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GvcpLayer.h:186
void setFlag(GvcpFlag flag)
Definition: IpAddress.h:30
Definition: Layer.h:117
Definition: MacAddress.h:24
Definition: Serializers.h:230
Definition: Packet.h:49
const ProtocolType GVCP
GigE Vision Control Protocol (GVCP)
Definition: ProtocolType.h:270
The main namespace for the PcapPlusPlus lib.
Definition: AssertionUtils.h:19
uint8_t GvcpFlag
Definition: GvcpLayer.h:22
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:420
@ OsiModelApplicationLayer
Application layer (layer 7)
Definition: ProtocolType.h:436
std::ostream & operator<<(std::ostream &os, GvcpAcknowledgeLayer::GvcpResponseStatus status)
Definition: Serializers.h:18
static const FieldDescriptor Status
Response status value.
Definition: GvcpLayer.h:457
static constexpr uint16_t MaxID
Maximum field ID used by GvcpAcknowledgeLayer.
Definition: GvcpLayer.h:467
static std::vector< FieldDescriptor > all()
Definition: GvcpLayer.h:448
static const FieldDescriptor AckId
Acknowledge ID.
Definition: GvcpLayer.h:463
static const FieldDescriptor StatusName
Name of the response status, or "Unknown".
Definition: GvcpLayer.h:460
uint16_t status
Response status.
Definition: GvcpLayer.h:479
uint16_t command
Command.
Definition: GvcpLayer.h:481
uint16_t ackId
Acknowledge ID.
Definition: GvcpLayer.h:485
uint16_t dataSize
Data size (the size of the message without the header)
Definition: GvcpLayer.h:483
uint16_t minor
The version minor number.
Definition: GvcpLayer.h:578
uint16_t major
The version major number.
Definition: GvcpLayer.h:576
static const FieldDescriptor SubnetMask
Device subnet mask, as a string.
Definition: GvcpLayer.h:720
static constexpr uint16_t MaxID
Maximum field ID used by GvcpDiscoveryAcknowledgeLayer.
Definition: GvcpLayer.h:745
static const FieldDescriptor ManufacturerSpecificInformation
Manufacturer specific information.
Definition: GvcpLayer.h:735
static const FieldDescriptor ManufacturerName
Manufacturer name.
Definition: GvcpLayer.h:726
static std::vector< FieldDescriptor > all()
Definition: GvcpLayer.h:695
static const FieldDescriptor UserDefinedName
User defined name.
Definition: GvcpLayer.h:741
static const FieldDescriptor GatewayIpAddress
Device default gateway IP address, as a string.
Definition: GvcpLayer.h:723
static const FieldDescriptor ModelName
Model name.
Definition: GvcpLayer.h:729
static const FieldDescriptor DeviceVersion
Device version.
Definition: GvcpLayer.h:732
static const FieldDescriptor IpAddress
Device IP address, as a string.
Definition: GvcpLayer.h:717
static const FieldDescriptor SerialNumber
Serial number.
Definition: GvcpLayer.h:738
static const FieldDescriptor VersionMajor
GigE Vision spec version major number.
Definition: GvcpLayer.h:708
static const FieldDescriptor MacAddress
Device MAC address, as a string.
Definition: GvcpLayer.h:714
static const FieldDescriptor VersionMinor
GigE Vision spec version minor number.
Definition: GvcpLayer.h:711
static const FieldDescriptor AllowBroadcastAck
Whether the allow-broadcast-acknowledge bit is set.
Definition: GvcpLayer.h:555
static constexpr uint16_t MaxID
Maximum field ID used by GvcpDiscoveryRequestLayer.
Definition: GvcpLayer.h:559
static std::vector< FieldDescriptor > all()
Definition: GvcpLayer.h:546
static const FieldDescriptor MacAddress
MAC address of the device to configure, as a string.
Definition: GvcpLayer.h:888
static const FieldDescriptor GatewayIpAddress
Default gateway IP address to force on the device, as a string.
Definition: GvcpLayer.h:897
static std::vector< FieldDescriptor > all()
Definition: GvcpLayer.h:879
static const FieldDescriptor IpAddress
IP address to force on the device, as a string.
Definition: GvcpLayer.h:891
static const FieldDescriptor SubnetMask
Subnet mask to force on the device, as a string.
Definition: GvcpLayer.h:894
static constexpr uint16_t MaxID
Maximum field ID used by GvcpForceIpRequestLayer.
Definition: GvcpLayer.h:901
Definition: GvcpLayer.h:131
static constexpr uint16_t MaxID
Maximum field ID used by GvcpLayer.
Definition: GvcpLayer.h:149
static const FieldDescriptor CommandName
Name of the command or acknowledge value, or "Unknown".
Definition: GvcpLayer.h:145
static std::vector< FieldDescriptor > all()
Definition: GvcpLayer.h:133
static const FieldDescriptor Command
Command or acknowledge value.
Definition: GvcpLayer.h:142
Definition: GvcpLayer.h:248
static const FieldDescriptor RequestId
Request ID.
Definition: GvcpLayer.h:265
static constexpr uint16_t MaxID
Maximum field ID used by GvcpRequestLayer.
Definition: GvcpLayer.h:269
static std::vector< FieldDescriptor > all()
Definition: GvcpLayer.h:250
static const FieldDescriptor AcknowledgeRequired
Whether the acknowledge-required bit is set.
Definition: GvcpLayer.h:262
static const FieldDescriptor Flag
Flag from the header.
Definition: GvcpLayer.h:259
uint16_t command
Command.
Definition: GvcpLayer.h:285
uint16_t dataSize
Data size (the size of the message without the header)
Definition: GvcpLayer.h:287
uint8_t magicNumber
Magic number, always 0x42.
Definition: GvcpLayer.h:281
uint16_t requestId
Request ID.
Definition: GvcpLayer.h:289
uint8_t flag
GVCP flag.
Definition: GvcpLayer.h:283
Definition: Layer.h:212
static std::vector< FieldDescriptor > all()
Definition: Layer.h:214
static constexpr uint16_t MaxID
Maximum field ID used by the layer.
Definition: Layer.h:229