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 
380 
389  icmp_echo_request* setEchoRequestData(uint16_t id, uint16_t sequence, uint64_t timestamp, const uint8_t* data,
390  size_t dataLen);
391 
395 
404  icmp_echo_reply* setEchoReplyData(uint16_t id, uint16_t sequence, uint64_t timestamp, const uint8_t* data,
405  size_t dataLen);
406 
409 
416  icmp_timestamp_request* setTimestampRequestData(uint16_t id, uint16_t sequence, timeval originateTimestamp);
417 
420 
429  icmp_timestamp_reply* setTimestampReplyData(uint16_t id, uint16_t sequence, timeval originateTimestamp,
430  timeval receiveTimestamp, timeval transmitTimestamp);
431 
436 
449  IPv4Layer* ipHeader, Layer* l4Header);
450 
455 
466 
471 
484  icmp_redirect* setRedirectData(uint8_t code, IPv4Address gatewayAddress, IPv4Layer* ipHeader, Layer* l4Header);
485 
489 
499  uint8_t code, uint16_t lifetimeInSeconds,
500  const std::vector<icmp_router_address_structure>& routerAddresses);
501 
505 
511 
516 
528  icmp_time_exceeded* setTimeExceededData(uint8_t code, IPv4Layer* ipHeader, Layer* l4Header);
529 
532 
546  icmp_param_problem* setParamProblemData(uint8_t code, uint8_t errorOctetPointer, IPv4Layer* ipHeader,
547  Layer* l4Header);
548 
552 
559  icmp_address_mask_request* setAddressMaskRequestData(uint16_t id, uint16_t sequence, IPv4Address mask);
560 
563 
570  icmp_address_mask_reply* setAddressMaskReplyData(uint16_t id, uint16_t sequence, IPv4Address mask);
571 
575 
581  icmp_info_request* setInfoRequestData(uint16_t id, uint16_t sequence);
582 
586 
592  icmp_info_reply* setInfoReplyData(uint16_t id, uint16_t sequence);
593 
598  static inline bool isDataValid(const uint8_t* data, size_t dataLen);
599 
600  // implement abstract methods
601 
605  void parseNextLayer() override;
606 
610  size_t getHeaderLen() const override;
611 
613  void computeCalculateFields() override;
614 
615  std::string toString() const override;
616 
618  {
619  return OsiModelNetworkLayer;
620  }
621 
626  {
628  static std::vector<FieldDescriptor> all()
629  {
630  auto result = Layer::SerializedFields::all();
631  std::initializer_list<FieldDescriptor> extra{ Type,
632  TypeName,
633  Code,
634  Checksum,
635  Id,
636  Sequence,
637  Timestamp,
641  NextHopMTU,
643  AddressMask,
644  Pointer,
646  Lifetime,
647  RouterAddresses };
648  std::copy(extra.begin(), extra.end(), std::back_inserter(result));
649  return result;
650  }
651 
653  static const FieldDescriptor Type;
654 
656  static const FieldDescriptor TypeName;
657 
659  static const FieldDescriptor Code;
660 
662  static const FieldDescriptor Checksum;
663 
666  static const FieldDescriptor Id;
667 
670  static const FieldDescriptor Sequence;
671 
674 
678 
682 
686 
689 
692 
695 
697  static const FieldDescriptor Pointer;
698 
701 
703  static const FieldDescriptor Lifetime;
704 
708 
711 
714 
717  };
718 
719  protected:
720  void serializeLayer(ObjectScope& serializer) const override;
721  };
722 
723  // implementation of inline methods
724 
725  bool IcmpLayer::isDataValid(const uint8_t* data, size_t dataLen)
726  {
727  if (dataLen < sizeof(icmphdr))
728  return false;
729 
730  uint8_t type = data[0];
731 
732  // ICMP_ECHO_REQUEST, ICMP_ECHO_REPLY, ICMP_ROUTER_SOL
733  if (type == 8 || type == 0 || type == 10)
734  return true;
735 
736  // ICMP_INFO_REQUEST, ICMP_INFO_REPLY
737  if (type == 15 || type == 16)
738  return dataLen >= sizeof(icmp_info_request);
739 
740  // ICMP_TIMESTAMP_REQUEST, ICMP_TIMESTAMP_REPLY
741  if (type == 13 || type == 14)
742  return dataLen >= sizeof(icmp_timestamp_request);
743 
744  // ICMP_ADDRESS_MASK_REPLY, ICMP_ADDRESS_MASK_REQUEST
745  if (type == 17 || type == 18)
746  return dataLen >= sizeof(icmp_address_mask_request);
747 
748  // ICMP_DEST_UNREACHABLE
749  if (type == 3)
750  return dataLen >= sizeof(icmp_destination_unreachable);
751 
752  // ICMP_REDIRECT
753  if (type == 5)
754  return dataLen >= sizeof(icmp_redirect);
755 
756  // ICMP_TIME_EXCEEDED, ICMP_SOURCE_QUENCH
757  if (type == 4 || type == 11)
758  return dataLen >= sizeof(icmp_time_exceeded);
759 
760  // ICMP_PARAM_PROBLEM
761  if (type == 12)
762  return dataLen >= sizeof(icmp_param_problem);
763 
764  // ICMP_ROUTER_ADV
765  if (type == 9)
766  {
767  if (dataLen < sizeof(icmp_router_advertisement_hdr))
768  return false;
769 
770  const auto* routerAdv = reinterpret_cast<const icmp_router_advertisement_hdr*>(data);
771  return routerAdv->advertisementCount <=
772  (dataLen - sizeof(icmp_router_advertisement_hdr)) / sizeof(icmp_router_address_structure);
773  }
774 
775  return false;
776  }
777 
778 } // 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:725
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:617
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:430
@ OsiModelNetworkLayer
Network layer (layer 3)
Definition: ProtocolType.h:436
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:626
static const FieldDescriptor AddressEntrySize
Number of 32-bit words per router address entry in router advertisement messages (typically 2)
Definition: IcmpLayer.h:700
static const FieldDescriptor GatewayAddress
Gateway IPv4 address for redirect messages, as a string.
Definition: IcmpLayer.h:691
static const FieldDescriptor Id
Identifier for echo, timestamp, information, and address mask request/reply messages,...
Definition: IcmpLayer.h:666
static std::vector< FieldDescriptor > all()
Definition: IcmpLayer.h:628
static const FieldDescriptor TransmitTimestamp
Transmit timestamp for timestamp request/reply messages (milliseconds since midnight UTC),...
Definition: IcmpLayer.h:685
static const FieldDescriptor Timestamp
Timestamp for echo request/reply messages.
Definition: IcmpLayer.h:673
static const FieldDescriptor Type
ICMP message type, as an integer.
Definition: IcmpLayer.h:653
static const FieldDescriptor NextHopMTU
Next-hop MTU for destination unreachable messages, in host byte order.
Definition: IcmpLayer.h:688
static const FieldDescriptor TypeName
ICMP message type, as a string.
Definition: IcmpLayer.h:656
static const FieldDescriptor Lifetime
Router advertisement lifetime in seconds, in host byte order.
Definition: IcmpLayer.h:703
static const FieldDescriptor AddressMask
Subnet address mask for address mask request/reply messages, as a string.
Definition: IcmpLayer.h:694
static const FieldDescriptor ReceiveTimestamp
Receive timestamp for timestamp request/reply messages (milliseconds since midnight UTC),...
Definition: IcmpLayer.h:681
static const FieldDescriptor RouterAddress
Router IPv4 address, as a string; element of RouterAddressEntry, not included in all()
Definition: IcmpLayer.h:713
static const FieldDescriptor Checksum
Checksum, in hexadecimal notation.
Definition: IcmpLayer.h:662
static const FieldDescriptor PreferenceLevel
Preference level for the router address; element of RouterAddressEntry, not included in all()
Definition: IcmpLayer.h:716
static const FieldDescriptor RouterAddressEntry
Router address entry descriptor; not included in all()
Definition: IcmpLayer.h:710
static const FieldDescriptor Code
ICMP message code, as an integer.
Definition: IcmpLayer.h:659
static const FieldDescriptor RouterAddresses
Array of router addresses in router advertisement messages; elements described by RouterAddressEntry.
Definition: IcmpLayer.h:707
static const FieldDescriptor Pointer
Pointer byte offset for parameter problem messages.
Definition: IcmpLayer.h:697
static const FieldDescriptor Sequence
Sequence number for echo, timestamp, information, and address mask request/reply messages,...
Definition: IcmpLayer.h:670
static const FieldDescriptor OriginateTimestamp
Originate timestamp for timestamp request/reply messages (milliseconds since midnight UTC),...
Definition: IcmpLayer.h:677
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