PcapPlusPlus  Next
IcmpLayer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Layer.h"
4 #include "IPv4Layer.h"
5 #ifdef _MSC_VER
6 # include <winsock2.h>
7 #else
8 # include <sys/time.h>
9 #endif
10 #include <vector>
11 
13 
16 namespace pcpp
17 {
18 
21 #pragma pack(push, 1)
22  typedef struct icmphdr
23  {
25  uint8_t type;
27  uint8_t code;
29  uint16_t checksum;
30  } icmphdr;
31 #pragma pack(pop)
32  static_assert(sizeof(icmphdr) == 4, "icmphdr size is not 4 bytes");
33 
36  {
68  ICMP_UNSUPPORTED = 255
69  };
70 
74  {
110  };
111 
114 #pragma pack(push, 1)
115  typedef struct icmp_echo_hdr : icmphdr
116  {
118  uint16_t id;
120  uint16_t sequence;
122  uint64_t timestamp;
123  } icmp_echo_hdr;
124 #pragma pack(pop)
125  static_assert(sizeof(icmp_echo_hdr) == 16, "icmp_echo_hdr size is not 16 bytes");
126 
129  typedef struct icmp_echo_request
130  {
134  size_t dataLength;
136  uint8_t* data;
138 
142 
145 #pragma pack(push, 1)
147  {
149  uint16_t id;
151  uint16_t sequence;
159 #pragma pack(pop)
160  static_assert(sizeof(icmp_timestamp_request) == 20, "icmp_timestamp_request size is not 20 bytes");
161 
165  static_assert(sizeof(icmp_timestamp_reply) == 20, "icmp_timestamp_reply size is not 20 bytes");
166 
169 #pragma pack(push, 1)
171  {
173  uint16_t unused;
175  uint16_t nextHopMTU;
177 #pragma pack(pop)
178  static_assert(sizeof(icmp_destination_unreachable) == 8, "icmp_destination_unreachable size is not 8 bytes");
179 
182 #pragma pack(push, 1)
183  typedef struct icmp_time_exceeded : icmphdr
184  {
186  uint32_t unused;
188 #pragma pack(pop)
189  static_assert(sizeof(icmp_time_exceeded) == 8, "icmp_time_exceeded size is not 8 bytes");
190 
194  static_assert(sizeof(icmp_source_quench) == 8, "icmp_source_quench size is not 8 bytes");
195 
198 #pragma pack(push, 1)
199  typedef struct icmp_param_problem : icmphdr
200  {
203  uint8_t pointer;
205  uint8_t unused1;
207  uint16_t unused2;
209 #pragma pack(pop)
210  static_assert(sizeof(icmp_param_problem) == 8, "icmp_param_problem size is not 8 bytes");
211 
215  static_assert(sizeof(icmp_router_solicitation) == 4, "icmp_router_solicitation size is not 4 bytes");
216 
219 #pragma pack(push, 1)
220  typedef struct icmp_redirect : icmphdr
221  {
223  uint32_t gatewayAddress;
224  } icmp_redirect;
225 #pragma pack(pop)
226  static_assert(sizeof(icmp_redirect) == 8, "icmp_redirect size is not 8 bytes");
227 
230 #pragma pack(push, 1)
232  {
234  uint32_t routerAddress;
238  uint32_t preferenceLevel;
239 
243  void setRouterAddress(IPv4Address addr, uint32_t preference);
244 
247  {
248  return routerAddress;
249  }
250  };
251 #pragma pack(pop)
252  static_assert(sizeof(icmp_router_address_structure) == 8, "icmp_router_address_structure size is not 8 bytes");
253 
256 #pragma pack(push, 1)
258  {
266  uint16_t lifetime;
268 #pragma pack(pop)
269  static_assert(sizeof(icmp_router_advertisement_hdr) == 8, "icmp_router_advertisement_hdr size is not 8 bytes");
270 
274  {
277 
280  size_t dataLen = 0;
281 
288  };
289 
292 #pragma pack(push, 1)
294  {
296  uint16_t id;
298  uint16_t sequence;
300  uint32_t addressMask;
302 #pragma pack(pop)
303  static_assert(sizeof(icmp_address_mask_request) == 12, "icmp_address_mask_request size is not 12 bytes");
304 
308 
311 #pragma pack(push, 1)
312  typedef struct icmp_info_request : icmphdr
313  {
315  uint16_t id;
317  uint16_t sequence;
319 #pragma pack(pop)
320  static_assert(sizeof(icmp_info_request) == 8, "icmp_info_request size is not 8 bytes");
321 
325  static_assert(sizeof(icmp_info_reply) == 8, "icmp_info_reply size is not 8 bytes");
326 
329  class IcmpLayer : public Layer
330  {
331  private:
332  icmp_echo_request m_EchoData;
333  mutable icmp_router_advertisement m_RouterAdvData;
334 
335  bool cleanIcmpLayer();
336 
337  bool setEchoData(IcmpMessageType echoType, uint16_t id, uint16_t sequence, uint64_t timestamp,
338  const uint8_t* data, size_t dataLen);
339 
340  bool setIpAndL4Layers(IPv4Layer* ipLayer, Layer* l4Layer);
341 
342  public:
348  // cppcheck-suppress uninitMemberVar
349  IcmpLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
350  : Layer(data, dataLen, prevLayer, packet, ICMP)
351  {}
352 
356 
357  ~IcmpLayer() override = default;
358 
363  {
364  return reinterpret_cast<icmphdr*>(m_Data);
365  }
366 
369 
373  {
374  return getMessageType() == type;
375  }
376 
379 
388  icmp_echo_request* setEchoRequestData(uint16_t id, uint16_t sequence, uint64_t timestamp, const uint8_t* data,
389  size_t dataLen);
390 
393 
402  icmp_echo_reply* setEchoReplyData(uint16_t id, uint16_t sequence, uint64_t timestamp, const uint8_t* data,
403  size_t dataLen);
404 
407 
414  icmp_timestamp_request* setTimestampRequestData(uint16_t id, uint16_t sequence, timeval originateTimestamp);
415 
418 
427  icmp_timestamp_reply* setTimestampReplyData(uint16_t id, uint16_t sequence, timeval originateTimestamp,
428  timeval receiveTimestamp, timeval transmitTimestamp);
429 
434 
447  IPv4Layer* ipHeader, Layer* l4Header);
448 
453 
464 
469 
482  icmp_redirect* setRedirectData(uint8_t code, IPv4Address gatewayAddress, IPv4Layer* ipHeader, Layer* l4Header);
483 
487 
497  uint8_t code, uint16_t lifetimeInSeconds,
498  const std::vector<icmp_router_address_structure>& routerAddresses);
499 
503 
509 
514 
526  icmp_time_exceeded* setTimeExceededData(uint8_t code, IPv4Layer* ipHeader, Layer* l4Header);
527 
530 
544  icmp_param_problem* setParamProblemData(uint8_t code, uint8_t errorOctetPointer, IPv4Layer* ipHeader,
545  Layer* l4Header);
546 
550 
557  icmp_address_mask_request* setAddressMaskRequestData(uint16_t id, uint16_t sequence, IPv4Address mask);
558 
561 
568  icmp_address_mask_reply* setAddressMaskReplyData(uint16_t id, uint16_t sequence, IPv4Address mask);
569 
573 
579  icmp_info_request* setInfoRequestData(uint16_t id, uint16_t sequence);
580 
584 
590  icmp_info_reply* setInfoReplyData(uint16_t id, uint16_t sequence);
591 
596  static inline bool isDataValid(const uint8_t* data, size_t dataLen);
597 
598  // implement abstract methods
599 
603  void parseNextLayer() override;
604 
608  size_t getHeaderLen() const override;
609 
611  void computeCalculateFields() override;
612 
613  std::string toString() const override;
614 
616  {
617  return OsiModelNetworkLayer;
618  }
619 
624  {
626  static std::vector<FieldDescriptor> all()
627  {
628  auto result = Layer::SerializedFields::all();
629  std::initializer_list<FieldDescriptor> extra{ Type,
630  TypeName,
631  Code,
632  Checksum,
633  Id,
634  Sequence,
635  Timestamp,
639  NextHopMTU,
641  AddressMask,
642  Pointer,
644  Lifetime,
645  RouterAddresses };
646  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
647  return result;
648  }
649 
651  static const FieldDescriptor Type;
652 
654  static const FieldDescriptor TypeName;
655 
657  static const FieldDescriptor Code;
658 
660  static const FieldDescriptor Checksum;
661 
664  static const FieldDescriptor Id;
665 
668  static const FieldDescriptor Sequence;
669 
672 
676 
680 
684 
687 
690 
693 
695  static const FieldDescriptor Pointer;
696 
699 
701  static const FieldDescriptor Lifetime;
702 
706 
709 
712 
715  };
716 
717  protected:
718  void serializeLayer(ObjectScope& serializer) const override;
719  };
720 
721  // implementation of inline methods
722 
723  bool IcmpLayer::isDataValid(const uint8_t* data, size_t dataLen)
724  {
725  if (dataLen < sizeof(icmphdr))
726  return false;
727 
728  uint8_t type = data[0];
729 
730  // ICMP_ECHO_REQUEST, ICMP_ECHO_REPLY, ICMP_ROUTER_SOL
731  if (type == 8 || type == 0 || type == 10)
732  return true;
733 
734  // ICMP_INFO_REQUEST, ICMP_INFO_REPLY
735  if (type == 15 || type == 16)
736  return dataLen >= sizeof(icmp_info_request);
737 
738  // ICMP_TIMESTAMP_REQUEST, ICMP_TIMESTAMP_REPLY
739  if (type == 13 || type == 14)
740  return dataLen >= sizeof(icmp_timestamp_request);
741 
742  // ICMP_ADDRESS_MASK_REPLY, ICMP_ADDRESS_MASK_REQUEST
743  if (type == 17 || type == 18)
744  return dataLen >= sizeof(icmp_address_mask_request);
745 
746  // ICMP_DEST_UNREACHABLE
747  if (type == 3)
748  return dataLen >= sizeof(icmp_destination_unreachable);
749 
750  // ICMP_REDIRECT
751  if (type == 5)
752  return dataLen >= sizeof(icmp_redirect);
753 
754  // ICMP_TIME_EXCEEDED, ICMP_SOURCE_QUENCH
755  if (type == 4 || type == 11)
756  return dataLen >= sizeof(icmp_time_exceeded);
757 
758  // ICMP_PARAM_PROBLEM
759  if (type == 12)
760  return dataLen >= sizeof(icmp_param_problem);
761 
762  // ICMP_ROUTER_ADV
763  if (type == 9)
764  {
765  if (dataLen < sizeof(icmp_router_advertisement_hdr))
766  return false;
767 
768  const auto* routerAdv = reinterpret_cast<const icmp_router_advertisement_hdr*>(data);
769  return routerAdv->advertisementCount <=
770  (dataLen - sizeof(icmp_router_advertisement_hdr)) / sizeof(icmp_router_address_structure);
771  }
772 
773  return false;
774  }
775 
776 } // namespace pcpp
Definition: IpAddress.h:30
Definition: IPv4Layer.h:410
Definition: IcmpLayer.h:330
icmp_router_solicitation * getRouterSolicitationData()
icmp_address_mask_request * setAddressMaskRequestData(uint16_t id, uint16_t sequence, IPv4Address mask)
icmp_echo_request * getEchoRequestData()
icmp_info_reply * getInfoReplyData()
icmp_info_request * setInfoRequestData(uint16_t id, uint16_t sequence)
icmp_echo_reply * getEchoReplyData()
size_t getHeaderLen() const override
icmp_source_quench * getSourceQuenchdata()
icmp_echo_reply * setEchoReplyData(uint16_t id, uint16_t sequence, uint64_t timestamp, const uint8_t *data, size_t dataLen)
icmp_echo_request * setEchoRequestData(uint16_t id, uint16_t sequence, uint64_t timestamp, const uint8_t *data, size_t dataLen)
IcmpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: IcmpLayer.h:349
icmp_router_solicitation * setRouterSolicitationData()
icmp_address_mask_reply * setAddressMaskReplyData(uint16_t id, uint16_t sequence, IPv4Address mask)
icmp_router_advertisement * setRouterAdvertisementData(uint8_t code, uint16_t lifetimeInSeconds, const std::vector< icmp_router_address_structure > &routerAddresses)
icmp_redirect * getRedirectData()
icmp_address_mask_request * getAddressMaskRequestData()
icmp_address_mask_reply * getAddressMaskReplyData()
icmp_timestamp_request * getTimestampRequestData()
bool isMessageOfType(IcmpMessageType type) const
Definition: IcmpLayer.h:372
icmp_redirect * setRedirectData(uint8_t code, IPv4Address gatewayAddress, IPv4Layer *ipHeader, Layer *l4Header)
icmp_timestamp_reply * getTimestampReplyData()
icmp_destination_unreachable * setDestUnreachableData(IcmpDestUnreachableCodes code, uint16_t nextHopMTU, IPv4Layer *ipHeader, Layer *l4Header)
icmphdr * getIcmpHeader() const
Definition: IcmpLayer.h:362
icmp_timestamp_request * setTimestampRequestData(uint16_t id, uint16_t sequence, timeval originateTimestamp)
icmp_router_advertisement * getRouterAdvertisementData() const
icmp_info_request * getInfoRequestData()
icmp_destination_unreachable * getDestUnreachableData()
icmp_time_exceeded * setTimeExceededData(uint8_t code, IPv4Layer *ipHeader, Layer *l4Header)
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: IcmpLayer.h:723
icmp_param_problem * setParamProblemData(uint8_t code, uint8_t errorOctetPointer, IPv4Layer *ipHeader, Layer *l4Header)
void parseNextLayer() override
icmp_time_exceeded * getTimeExceededData()
void serializeLayer(ObjectScope &serializer) const override
icmp_param_problem * getParamProblemData()
void computeCalculateFields() override
Calculate ICMP checksum field.
icmp_timestamp_reply * setTimestampReplyData(uint16_t id, uint16_t sequence, timeval originateTimestamp, timeval receiveTimestamp, timeval transmitTimestamp)
icmp_info_reply * setInfoReplyData(uint16_t id, uint16_t sequence)
std::string toString() const override
IcmpMessageType getMessageType() const
icmp_source_quench * setSourceQuenchdata(IPv4Layer *ipHeader, Layer *l4Header)
OsiModelLayer getOsiModelLayer() const override
Definition: IcmpLayer.h:615
Definition: Layer.h:117
Definition: Serializers.h:230
Definition: Packet.h:49
const ProtocolType ICMP
ICMP protocol.
Definition: ProtocolType.h:81
The main namespace for the PcapPlusPlus lib.
Definition: AssertionUtils.h:19
icmp_address_mask_request icmp_address_mask_reply
Definition: IcmpLayer.h:307
icmphdr icmp_router_solicitation
Definition: IcmpLayer.h:214
icmp_info_request icmp_info_reply
Definition: IcmpLayer.h:324
IcmpMessageType
An enum of all supported ICMP message types.
Definition: IcmpLayer.h:36
@ ICMP_DEST_UNREACHABLE
ICMP destination unreachable message.
Definition: IcmpLayer.h:40
@ ICMP_TIMESTAMP_REPLY
ICMP timestamp reply message.
Definition: IcmpLayer.h:58
@ ICMP_TIME_EXCEEDED
ICMP time-to-live excceded message.
Definition: IcmpLayer.h:52
@ ICMP_ECHO_REQUEST
ICMP echo (ping) request message.
Definition: IcmpLayer.h:46
@ ICMP_TIMESTAMP_REQUEST
ICMP timestamp request message.
Definition: IcmpLayer.h:56
@ ICMP_UNSUPPORTED
ICMP message type unsupported by PcapPlusPlus.
Definition: IcmpLayer.h:68
@ ICMP_PARAM_PROBLEM
ICMP parameter problem message.
Definition: IcmpLayer.h:54
@ ICMP_ADDRESS_MASK_REPLY
ICMP address mask reply message.
Definition: IcmpLayer.h:66
@ ICMP_ROUTER_SOL
ICMP router soliciatation message.
Definition: IcmpLayer.h:50
@ ICMP_ECHO_REPLY
ICMP echo (ping) reply message.
Definition: IcmpLayer.h:38
@ ICMP_INFO_REQUEST
ICMP information request message.
Definition: IcmpLayer.h:60
@ ICMP_ADDRESS_MASK_REQUEST
ICMP address mask request message.
Definition: IcmpLayer.h:64
@ ICMP_SOURCE_QUENCH
ICMP source quench message.
Definition: IcmpLayer.h:42
@ ICMP_REDIRECT
ICMP redirect message.
Definition: IcmpLayer.h:44
@ ICMP_ROUTER_ADV
ICMP router advertisement message.
Definition: IcmpLayer.h:48
@ ICMP_INFO_REPLY
ICMP information reply message.
Definition: IcmpLayer.h:62
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:425
@ OsiModelNetworkLayer
Network layer (layer 3)
Definition: ProtocolType.h:431
icmp_timestamp_request icmp_timestamp_reply
Definition: IcmpLayer.h:164
icmp_time_exceeded icmp_source_quench
Definition: IcmpLayer.h:193
IcmpDestUnreachableCodes
Definition: IcmpLayer.h:74
@ IcmpDestinationNetworkProhibited
The destination network is administratively prohibited.
Definition: IcmpLayer.h:94
@ IcmpSourceHostIsolated
Source host isolated error.
Definition: IcmpLayer.h:92
@ IcmpPrecedenceCutoff
Definition: IcmpLayer.h:109
@ IcmpHostPrecedenceViolation
Definition: IcmpLayer.h:106
@ IcmpPortUnreachable
Port unreachable error (the designated protocol is unable to inform the host of the incoming message)
Definition: IcmpLayer.h:82
@ IcmpSourceRouteFailed
Source route failed error.
Definition: IcmpLayer.h:86
@ IcmpHostUnreachableForTypeOfService
The host is unreachable for Type Of Service.
Definition: IcmpLayer.h:100
@ IcmpDestinationHostProhibited
The destination host is administratively prohibited.
Definition: IcmpLayer.h:96
@ IcmpDestinationHostUnknown
Destination host unknown error.
Definition: IcmpLayer.h:90
@ IcmpProtocolUnreachable
Protocol unreachable error (the designated transport protocol is not supported)
Definition: IcmpLayer.h:80
@ IcmpCommunicationProhibited
Definition: IcmpLayer.h:103
@ IcmpDestinationNetworkUnknown
Destination network unknown error.
Definition: IcmpLayer.h:88
@ IcmpNetworkUnreachable
Network unreachable error.
Definition: IcmpLayer.h:76
@ IcmpNetworkUnreachableForTypeOfService
The network is unreachable for Type Of Service.
Definition: IcmpLayer.h:98
@ IcmpHostUnreachable
Host unreachable error.
Definition: IcmpLayer.h:78
@ IcmpDatagramTooBig
The datagram is too big. Packet fragmentation is required but the 'don't fragment' (DF) flag is on.
Definition: IcmpLayer.h:84
icmp_echo_request icmp_echo_reply
Definition: IcmpLayer.h:141
Definition: Serializers.h:18
Definition: IcmpLayer.h:624
static const FieldDescriptor AddressEntrySize
Number of 32-bit words per router address entry in router advertisement messages (typically 2)
Definition: IcmpLayer.h:698
static const FieldDescriptor GatewayAddress
Gateway IPv4 address for redirect messages, as a string.
Definition: IcmpLayer.h:689
static const FieldDescriptor Id
Identifier for echo, timestamp, information, and address mask request/reply messages,...
Definition: IcmpLayer.h:664
static std::vector< FieldDescriptor > all()
Definition: IcmpLayer.h:626
static const FieldDescriptor TransmitTimestamp
Transmit timestamp for timestamp request/reply messages (milliseconds since midnight UTC),...
Definition: IcmpLayer.h:683
static const FieldDescriptor Timestamp
Timestamp for echo request/reply messages.
Definition: IcmpLayer.h:671
static const FieldDescriptor Type
ICMP message type, as an integer.
Definition: IcmpLayer.h:651
static const FieldDescriptor NextHopMTU
Next-hop MTU for destination unreachable messages, in host byte order.
Definition: IcmpLayer.h:686
static const FieldDescriptor TypeName
ICMP message type, as a string.
Definition: IcmpLayer.h:654
static const FieldDescriptor Lifetime
Router advertisement lifetime in seconds, in host byte order.
Definition: IcmpLayer.h:701
static const FieldDescriptor AddressMask
Subnet address mask for address mask request/reply messages, as a string.
Definition: IcmpLayer.h:692
static const FieldDescriptor ReceiveTimestamp
Receive timestamp for timestamp request/reply messages (milliseconds since midnight UTC),...
Definition: IcmpLayer.h:679
static const FieldDescriptor RouterAddress
Router IPv4 address, as a string; element of RouterAddressEntry, not included in all()
Definition: IcmpLayer.h:711
static const FieldDescriptor Checksum
Checksum, in hexadecimal notation.
Definition: IcmpLayer.h:660
static const FieldDescriptor PreferenceLevel
Preference level for the router address; element of RouterAddressEntry, not included in all()
Definition: IcmpLayer.h:714
static const FieldDescriptor RouterAddressEntry
Router address entry descriptor; not included in all()
Definition: IcmpLayer.h:708
static const FieldDescriptor Code
ICMP message code, as an integer.
Definition: IcmpLayer.h:657
static const FieldDescriptor RouterAddresses
Array of router addresses in router advertisement messages; elements described by RouterAddressEntry.
Definition: IcmpLayer.h:705
static const FieldDescriptor Pointer
Pointer byte offset for parameter problem messages.
Definition: IcmpLayer.h:695
static const FieldDescriptor Sequence
Sequence number for echo, timestamp, information, and address mask request/reply messages,...
Definition: IcmpLayer.h:668
static const FieldDescriptor OriginateTimestamp
Originate timestamp for timestamp request/reply messages (milliseconds since midnight UTC),...
Definition: IcmpLayer.h:675
Definition: Layer.h:212
static std::vector< FieldDescriptor > all()
Definition: Layer.h:214
Definition: IcmpLayer.h:294
uint16_t id
the address mask request identifier
Definition: IcmpLayer.h:296
uint16_t sequence
the address mask request sequence
Definition: IcmpLayer.h:298
uint32_t addressMask
the subnet mask of the requesting host
Definition: IcmpLayer.h:300
Definition: IcmpLayer.h:171
uint16_t unused
unused 2 bytes
Definition: IcmpLayer.h:173
uint16_t nextHopMTU
contains the MTU of the next-hop network if a code 4 error occurs
Definition: IcmpLayer.h:175
Definition: IcmpLayer.h:116
uint64_t timestamp
a timestamp of when the message was sent
Definition: IcmpLayer.h:122
uint16_t id
the echo (ping) request identifier
Definition: IcmpLayer.h:118
uint16_t sequence
the echo (ping) request sequence number
Definition: IcmpLayer.h:120
Definition: IcmpLayer.h:130
icmp_echo_hdr * header
a pointer to the header data
Definition: IcmpLayer.h:132
size_t dataLength
most echo requests/replies contain some payload data. This is the data length
Definition: IcmpLayer.h:134
uint8_t * data
most echo requests/replies contain some payload data. This is a pointer to this data
Definition: IcmpLayer.h:136
Definition: IcmpLayer.h:313
uint16_t sequence
the information request sequence
Definition: IcmpLayer.h:317
uint16_t id
the information request identifier
Definition: IcmpLayer.h:315
Definition: IcmpLayer.h:200
uint8_t unused1
unused 1 byte
Definition: IcmpLayer.h:205
uint8_t pointer
Definition: IcmpLayer.h:203
uint16_t unused2
unused 2 bytes
Definition: IcmpLayer.h:207
Definition: IcmpLayer.h:221
uint32_t gatewayAddress
an IPv4 address of the gateway to which the redirection should be sent
Definition: IcmpLayer.h:223
Definition: IcmpLayer.h:232
void setRouterAddress(IPv4Address addr, uint32_t preference)
uint32_t routerAddress
the IPv4 address of the advertised router
Definition: IcmpLayer.h:234
IPv4Address getAddress() const
Definition: IcmpLayer.h:246
uint32_t preferenceLevel
Definition: IcmpLayer.h:238
Definition: IcmpLayer.h:258
uint8_t addressEntrySize
Definition: IcmpLayer.h:264
uint16_t lifetime
the maximum number of seconds that the router addresses in this list may be considered valid
Definition: IcmpLayer.h:266
uint8_t advertisementCount
Definition: IcmpLayer.h:261
Definition: IcmpLayer.h:274
icmp_router_advertisement_hdr * header
a pointer to the header data on the packet
Definition: IcmpLayer.h:276
size_t dataLen
Definition: IcmpLayer.h:280
icmp_router_address_structure * getRouterAddress(int index) const
Definition: IcmpLayer.h:184
uint32_t unused
unused 4 bytes
Definition: IcmpLayer.h:186
Definition: IcmpLayer.h:147
uint16_t id
the timestamp request identifier
Definition: IcmpLayer.h:149
uint32_t transmitTimestamp
relevant for timestamp reply only - the time the echoer last touched the message on sending it
Definition: IcmpLayer.h:157
uint16_t sequence
the timestamp request sequence number
Definition: IcmpLayer.h:151
uint32_t receiveTimestamp
relevant for timestamp reply only - the time the echoer first touched it on receipt
Definition: IcmpLayer.h:155
uint32_t originateTimestamp
the time (in milliseconds since midnight) the sender last touched the packet
Definition: IcmpLayer.h:153
Definition: IcmpLayer.h:23
uint8_t code
message code
Definition: IcmpLayer.h:27
uint8_t type
message type
Definition: IcmpLayer.h:25
uint16_t checksum
message checksum
Definition: IcmpLayer.h:29