126 #pragma pack(push, 1)
162 #pragma pack(push, 1)
188 #pragma pack(push, 1)
202 #pragma pack(push, 1)
220 #pragma pack(push, 1)
243 #pragma pack(push, 1)
255 #pragma pack(push, 1)
286 #pragma pack(push, 1)
323 #pragma pack(push, 1)
345 #pragma pack(push, 1)
371 bool cleanIcmpLayer();
373 bool setEchoData(
IcmpMessageType echoType, uint16_t
id, uint16_t sequence, uint64_t timestamp,
374 const uint8_t* data,
size_t dataLen);
388 :
Layer(data, dataLen, prevLayer, packet,
ICMP)
406 return reinterpret_cast<icmphdr*
>(m_Data);
490 timeval receiveTimestamp, timeval transmitTimestamp);
572 uint8_t code, uint16_t lifetimeInSeconds,
573 const std::vector<icmp_router_address_structure>& routerAddresses);
699 static inline bool isDataValid(
const uint8_t* data,
size_t dataLen);
737 uint8_t type = data[0];
740 if (type == 8 || type == 0 || type == 10 || type == 15 || type == 16)
744 if (type == 13 || type == 14)
748 if (type == 17 || type == 18)
760 if (type == 4 || type == 11)
Definition: IpAddress.h:32
Definition: IPv4Layer.h:452
Definition: IcmpLayer.h:366
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:387
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:418
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:404
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:732
icmp_param_problem * setParamProblemData(uint8_t code, uint8_t errorOctetPointer, IPv4Layer *ipHeader, Layer *l4Header)
void parseNextLayer() override
icmp_time_exceeded * getTimeExceededData()
icmp_param_problem * getParamProblemData()
void computeCalculateFields() override
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:724
The main namespace for the PcapPlusPlus lib.
icmp_address_mask_request icmp_address_mask_reply
Definition: IcmpLayer.h:339
icmphdr icmp_router_solicitation
Definition: IcmpLayer.h:237
icmp_info_request icmp_info_reply
Definition: IcmpLayer.h:359
IcmpMessageType
Definition: IcmpLayer.h:41
@ ICMP_DEST_UNREACHABLE
Definition: IcmpLayer.h:45
@ ICMP_TIMESTAMP_REPLY
Definition: IcmpLayer.h:63
@ ICMP_TIME_EXCEEDED
Definition: IcmpLayer.h:57
@ ICMP_ECHO_REQUEST
Definition: IcmpLayer.h:51
@ ICMP_TIMESTAMP_REQUEST
Definition: IcmpLayer.h:61
@ ICMP_UNSUPPORTED
Definition: IcmpLayer.h:73
@ ICMP_PARAM_PROBLEM
Definition: IcmpLayer.h:59
@ ICMP_ADDRESS_MASK_REPLY
Definition: IcmpLayer.h:71
@ ICMP_ROUTER_SOL
Definition: IcmpLayer.h:55
@ ICMP_ECHO_REPLY
Definition: IcmpLayer.h:43
@ ICMP_INFO_REQUEST
Definition: IcmpLayer.h:65
@ ICMP_ADDRESS_MASK_REQUEST
Definition: IcmpLayer.h:69
@ ICMP_SOURCE_QUENCH
Definition: IcmpLayer.h:47
@ ICMP_REDIRECT
Definition: IcmpLayer.h:49
@ ICMP_ROUTER_ADV
Definition: IcmpLayer.h:53
@ ICMP_INFO_REPLY
Definition: IcmpLayer.h:67
OsiModelLayer
Definition: ProtocolType.h:364
@ OsiModelNetworkLayer
Definition: ProtocolType.h:370
icmp_timestamp_request icmp_timestamp_reply
Definition: IcmpLayer.h:182
icmp_time_exceeded icmp_source_quench
Definition: IcmpLayer.h:214
IcmpDestUnreachableCodes
Definition: IcmpLayer.h:81
@ IcmpDestinationNetworkProhibited
Definition: IcmpLayer.h:101
@ IcmpSourceHostIsolated
Definition: IcmpLayer.h:99
@ IcmpPrecedenceCutoff
Definition: IcmpLayer.h:119
@ IcmpHostPrecedenceViolation
Definition: IcmpLayer.h:115
@ IcmpPortUnreachable
Definition: IcmpLayer.h:89
@ IcmpSourceRouteFailed
Definition: IcmpLayer.h:93
@ IcmpHostUnreachableForTypeOfService
Definition: IcmpLayer.h:107
@ IcmpDestinationHostProhibited
Definition: IcmpLayer.h:103
@ IcmpDestinationHostUnknown
Definition: IcmpLayer.h:97
@ IcmpProtocolUnreachable
Definition: IcmpLayer.h:87
@ IcmpCommunicationProhibited
Definition: IcmpLayer.h:111
@ IcmpDestinationNetworkUnknown
Definition: IcmpLayer.h:95
@ IcmpNetworkUnreachable
Definition: IcmpLayer.h:83
@ IcmpNetworkUnreachableForTypeOfService
Definition: IcmpLayer.h:105
@ IcmpHostUnreachable
Definition: IcmpLayer.h:85
@ IcmpDatagramTooBig
Definition: IcmpLayer.h:91
const ProtocolType ICMP
Definition: ProtocolType.h:88
icmp_echo_request icmp_echo_reply
Definition: IcmpLayer.h:156
Definition: IcmpLayer.h:325
uint16_t id
Definition: IcmpLayer.h:327
uint16_t sequence
Definition: IcmpLayer.h:329
uint32_t addressMask
Definition: IcmpLayer.h:331
Definition: IcmpLayer.h:190
uint16_t unused
Definition: IcmpLayer.h:192
uint16_t nextHopMTU
Definition: IcmpLayer.h:194
Definition: IcmpLayer.h:128
uint64_t timestamp
Definition: IcmpLayer.h:134
uint16_t id
Definition: IcmpLayer.h:130
uint16_t sequence
Definition: IcmpLayer.h:132
Definition: IcmpLayer.h:143
icmp_echo_hdr * header
Definition: IcmpLayer.h:145
size_t dataLength
Definition: IcmpLayer.h:147
uint8_t * data
Definition: IcmpLayer.h:149
Definition: IcmpLayer.h:347
uint16_t sequence
Definition: IcmpLayer.h:351
uint16_t id
Definition: IcmpLayer.h:349
Definition: IcmpLayer.h:222
uint8_t unused1
Definition: IcmpLayer.h:227
uint8_t pointer
Definition: IcmpLayer.h:225
uint16_t unused2
Definition: IcmpLayer.h:229
Definition: IcmpLayer.h:245
uint32_t gatewayAddress
Definition: IcmpLayer.h:247
Definition: IcmpLayer.h:257
void setRouterAddress(IPv4Address addr, uint32_t preference)
uint32_t routerAddress
Definition: IcmpLayer.h:259
IPv4Address getAddress() const
Definition: IcmpLayer.h:275
uint32_t preferenceLevel
Definition: IcmpLayer.h:263
Definition: IcmpLayer.h:288
uint8_t addressEntrySize
Definition: IcmpLayer.h:294
uint16_t lifetime
Definition: IcmpLayer.h:296
uint8_t advertisementCount
Definition: IcmpLayer.h:291
Definition: IcmpLayer.h:305
icmp_router_advertisement_hdr * header
Definition: IcmpLayer.h:307
icmp_router_address_structure * getRouterAddress(int index) const
Definition: IcmpLayer.h:204
uint32_t unused
Definition: IcmpLayer.h:206
Definition: IcmpLayer.h:164
uint16_t id
Definition: IcmpLayer.h:166
uint32_t transmitTimestamp
Definition: IcmpLayer.h:174
uint16_t sequence
Definition: IcmpLayer.h:168
uint32_t receiveTimestamp
Definition: IcmpLayer.h:172
uint32_t originateTimestamp
Definition: IcmpLayer.h:170
Definition: IcmpLayer.h:27
uint8_t code
Definition: IcmpLayer.h:31
uint8_t type
Definition: IcmpLayer.h:29
uint16_t checksum
Definition: IcmpLayer.h:33