PcapPlusPlus  Next
pcpp::DoIpDiagnosticBase Class Referenceabstract

Represents a DoIP Diagnostic Message sent between tester and ECU. This class includes source and target addresses. More...

#include <DoIpLayer.h>

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

Classes

struct  common_diagnostic_header
 An internal structure representing the common diagnostic header. More...
 

Public Member Functions

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...
 
virtual std::string getSummary () const =0
 Returns a human-readable summary of the message content. More...
 
- Public Member Functions inherited from pcpp::DoIpLayer
virtual DoIpPayloadTypes getPayloadType () const =0
 
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::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 DoIP Diagnostic Message sent between tester and ECU. This class includes source and target addresses.

Member Function Documentation

◆ getSourceAddress()

uint16_t pcpp::DoIpDiagnosticBase::getSourceAddress ( ) const

Gets the source logical address of the message.

Returns
16-bit address of the source ECU.

◆ getSummary()

virtual std::string pcpp::DoIpDiagnosticBase::getSummary ( ) const
pure virtual

Returns a human-readable summary of the message content.

Returns
A string summarizing the diagnostic message.

Implemented in pcpp::DoIpDiagnosticMessageNack, pcpp::DoIpDiagnosticMessageAck, and pcpp::DoIpDiagnosticMessage.

◆ getTargetAddress()

uint16_t pcpp::DoIpDiagnosticBase::getTargetAddress ( ) const

Gets the target logical address of the message.

Returns
16-bit address of the destination ECU.

◆ setSourceAddress()

void pcpp::DoIpDiagnosticBase::setSourceAddress ( uint16_t  sourceAddress)

Sets the source logical address.

Parameters
[in]sourceAddress16-bit source address.

◆ setTargetAddress()

void pcpp::DoIpDiagnosticBase::setTargetAddress ( uint16_t  targetAddress)

Sets the target logical address.

Parameters
[in]targetAddress16-bit target address.