PcapPlusPlus  Next
pcpp::DoIpDiagnosticMessageAck Class Reference

Represents a positive acknowledgment message in response to a DiagnosticMessage. More...

#include <DoIpLayer.h>

Inheritance diagram for pcpp::DoIpDiagnosticMessageAck:
pcpp::DoIpDiagnosticResponseMessageBase pcpp::DoIpDiagnosticBase pcpp::DoIpLayer pcpp::Layer pcpp::IDataContainer

Public Member Functions

 DoIpDiagnosticMessageAck (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 Constructs a DiagnosticAckMessage from raw packet data. More...
 
 DoIpDiagnosticMessageAck (uint16_t sourceAddress, uint16_t targetAddress, DoIpDiagnosticAckCodes ackCode)
 Constructs a DiagnosticAckMessage from specified field values. More...
 
DoIpDiagnosticAckCodes getAckCode () const
 Gets the diagnostic acknowledgment code. More...
 
void setAckCode (DoIpDiagnosticAckCodes code)
 Sets the acknowledgment code. More...
 
std::string getSummary () const override
 Returns a human-readable summary of the message.
 
DoIpPayloadTypes getPayloadType () const override
 Returns the DoIP payload type.
 
- Public Member Functions inherited from pcpp::DoIpDiagnosticResponseMessageBase
uint8_t getResponseCode () const
 Gets the acknowledgment/nack code (1-byte). More...
 
void setResponseCode (uint8_t code)
 Sets the acknowledgment/nack code (1-byte). More...
 
std::vector< uint8_t > getPreviousMessage () const
 Gets the optional previously echoed diagnostic message. More...
 
bool hasPreviousMessage () const
 Checks if a previous message is attached. More...
 
void setPreviousMessage (const std::vector< uint8_t > &msg)
 Sets the previous echoed diagnostic message. More...
 
void clearPreviousMessage ()
 Clears the previously stored diagnostic message.
 
- Public Member Functions inherited from pcpp::DoIpDiagnosticBase
uint16_t getSourceAddress () const
 Gets the source logical address of the message. More...
 
void setSourceAddress (uint16_t sourceAddress)
 Sets the source logical address. More...
 
uint16_t getTargetAddress () const
 Gets the target logical address of the message. More...
 
void setTargetAddress (uint16_t targetAddress)
 Sets the target logical address. More...
 
- Public Member Functions inherited from pcpp::DoIpLayer
std::string getPayloadTypeAsStr () const
 
DoIpProtocolVersion getProtocolVersion () const
 
std::string getProtocolVersionAsStr () const
 
void setProtocolVersion (DoIpProtocolVersion version)
 
void setProtocolVersion (uint8_t rawVersion)
 
uint8_t getInvertProtocolVersion () const
 
void setInvertProtocolVersion (uint8_t iVersion)
 
uint32_t getPayloadLength () const
 
void setPayloadLength (uint32_t length)
 
void parseNextLayer () override
 parse UDS layer
 
size_t getHeaderLen () const override
 
std::string toString () const override
 
void computeCalculateFields () override
 Each layer can compute field values automatically using this method. This is an abstract method.
 
OsiModelLayer getOsiModelLayer () const override
 
- Public Member Functions inherited from pcpp::Layer
 ~Layer () override
 
LayergetNextLayer () const
 
LayergetPrevLayer () 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
 
uint8_t * getDataPtr (size_t offset=0) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::DoIpDiagnosticResponseMessageBase
static bool isDataLenValid (size_t dataLen)
 Checks if data length is valid. More...
 
- Static Public Member Functions inherited from pcpp::DoIpLayer
static DoIpLayerparseDoIpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
static bool isDoIpPort (uint16_t port)
 
static bool isDataValid (uint8_t *data, size_t dataLen)
 
- Protected Member Functions inherited from pcpp::Layer
template<typename T , typename... Args>
LayerconstructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs)
 
template<typename T , typename TFallback , typename... Args>
LayertryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs)
 
- 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...
 

Detailed Description

Represents a positive acknowledgment message in response to a DiagnosticMessage.

This message is sent by a DoIP node to acknowledge the correct reception and processing of a diagnostic message. Optionally, the original message (or part of it) may be echoed back.

Constructor & Destructor Documentation

◆ DoIpDiagnosticMessageAck() [1/2]

pcpp::DoIpDiagnosticMessageAck::DoIpDiagnosticMessageAck ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)

Constructs a DiagnosticAckMessage from raw packet data.

Parameters
[in]dataPointer to the raw payload data.
[in]dataLenLength of the data buffer.
[in]prevLayerPointer to the previous protocol layer.
[in]packetPointer to the parent packet.

◆ DoIpDiagnosticMessageAck() [2/2]

pcpp::DoIpDiagnosticMessageAck::DoIpDiagnosticMessageAck ( uint16_t  sourceAddress,
uint16_t  targetAddress,
DoIpDiagnosticAckCodes  ackCode 
)

Constructs a DiagnosticAckMessage from specified field values.

Parameters
[in]sourceAddressAddress of the sending ECU.
[in]targetAddressAddress of the receiving ECU.
[in]ackCodeAcknowledgment code describing the result.

Member Function Documentation

◆ getAckCode()

DoIpDiagnosticAckCodes pcpp::DoIpDiagnosticMessageAck::getAckCode ( ) const

Gets the diagnostic acknowledgment code.

Returns
enum DoIpDiagnosticAckCodes describing the acknowledgment code.

◆ setAckCode()

void pcpp::DoIpDiagnosticMessageAck::setAckCode ( DoIpDiagnosticAckCodes  code)

Sets the acknowledgment code.

Parameters
[in]codeenum DoIpDiagnosticAckCodes describing the acknowledgment code.