PcapPlusPlus  Next
pcpp::DoIpRoutingActivationResponse Class Reference

Represents a DoIP Routing Activation Response message. More...

#include <DoIpLayer.h>

Inheritance diagram for pcpp::DoIpRoutingActivationResponse:
pcpp::DoIpLayer pcpp::Layer pcpp::IDataContainer

Public Member Functions

 DoIpRoutingActivationResponse (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 Constructs the layer from raw DoIP packet data. More...
 
 DoIpRoutingActivationResponse (uint16_t logicalAddressExternalTester, uint16_t sourceAddress, DoIpRoutingResponseCodes responseCode)
 Constructs the message from field values. More...
 
uint16_t getLogicalAddressExternalTester () const
 Gets the logical address of the external tester. More...
 
void setLogicalAddressExternalTester (uint16_t addr)
 Sets the logical address of the external tester. More...
 
uint16_t getSourceAddress () const
 Gets the source address. More...
 
void setSourceAddress (uint16_t sourceAddress)
 Sets the source address. More...
 
DoIpRoutingResponseCodes getResponseCode () const
 Gets the routing response code. More...
 
void setResponseCode (DoIpRoutingResponseCodes code)
 Sets the routing response code. More...
 
std::array< uint8_t, DOIP_RESERVED_ISO_LEN > getReservedIso () const
 Gets the reserved ISO bytes. More...
 
void setReservedIso (const std::array< uint8_t, DOIP_RESERVED_ISO_LEN > &reservedIso)
 Sets the reserved ISO bytes. More...
 
std::array< uint8_t, DOIP_RESERVED_OEM_LEN > getReservedOem () const
 Gets pointer to reserved OEM bytes if present. More...
 
void setReservedOem (const std::array< uint8_t, DOIP_RESERVED_OEM_LEN > &reservedOem)
 Sets the reserved OEM bytes. More...
 
bool hasReservedOem () const
 Checks if OEM reserved bytes are present. More...
 
void clearReservedOem ()
 Clears the OEM reserved bytes.
 
std::string getSummary () const
 Returns a human-readable summary of the message.
 
DoIpPayloadTypes getPayloadType () const override
 Returns the DoIP payload type for this message.
 
- 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
 

Static Public Member Functions

static bool isDataLenValid (size_t dataLen)
 Checks if the routing activation response 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)
 

Additional Inherited Members

- 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 Routing Activation Response message.

Provides parsing and construction for Routing Activation Response messages as defined by the DoIP protocol.

Constructor & Destructor Documentation

◆ DoIpRoutingActivationResponse() [1/2]

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

Constructs the layer from raw DoIP packet data.

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

◆ DoIpRoutingActivationResponse() [2/2]

pcpp::DoIpRoutingActivationResponse::DoIpRoutingActivationResponse ( uint16_t  logicalAddressExternalTester,
uint16_t  sourceAddress,
DoIpRoutingResponseCodes  responseCode 
)

Constructs the message from field values.

Parameters
[in]logicalAddressExternalTesterLogical address of the external tester.
[in]sourceAddressECU source address.
[in]responseCodeThe routing response code.

Member Function Documentation

◆ getLogicalAddressExternalTester()

uint16_t pcpp::DoIpRoutingActivationResponse::getLogicalAddressExternalTester ( ) const

Gets the logical address of the external tester.

Returns
The 2-byte logical address of the external tester.

◆ getReservedIso()

std::array<uint8_t, DOIP_RESERVED_ISO_LEN> pcpp::DoIpRoutingActivationResponse::getReservedIso ( ) const

Gets the reserved ISO bytes.

Returns
4-byte array representing the reserved ISO bytes.

◆ getReservedOem()

std::array<uint8_t, DOIP_RESERVED_OEM_LEN> pcpp::DoIpRoutingActivationResponse::getReservedOem ( ) const

Gets pointer to reserved OEM bytes if present.

Exceptions
std::runtime_errorif the reserved OEM bytes are not present.
Note
before using this method, check beforehand if the reserved OEM bytes are present using hasReservedOem().

◆ getResponseCode()

DoIpRoutingResponseCodes pcpp::DoIpRoutingActivationResponse::getResponseCode ( ) const

Gets the routing response code.

Returns
enum DoIpRoutingResponseCodes representing the routing response code.

◆ getSourceAddress()

uint16_t pcpp::DoIpRoutingActivationResponse::getSourceAddress ( ) const

Gets the source address.

Returns
The 2-byte source address.

◆ hasReservedOem()

bool pcpp::DoIpRoutingActivationResponse::hasReservedOem ( ) const

Checks if OEM reserved bytes are present.

Returns
true if OEM reserved bytes are present, false otherwise.

◆ isDataLenValid()

static bool pcpp::DoIpRoutingActivationResponse::isDataLenValid ( size_t  dataLen)
inlinestatic

Checks if the routing activation response data length is valid.

Parameters
[in]dataLenThe length of the data.
Returns
true if the data is valid, false otherwise.

◆ setLogicalAddressExternalTester()

void pcpp::DoIpRoutingActivationResponse::setLogicalAddressExternalTester ( uint16_t  addr)

Sets the logical address of the external tester.

Parameters
[in]addrThe logical address of the external tester to set.

◆ setReservedIso()

void pcpp::DoIpRoutingActivationResponse::setReservedIso ( const std::array< uint8_t, DOIP_RESERVED_ISO_LEN > &  reservedIso)

Sets the reserved ISO bytes.

Parameters
[in]reservedIsoThe reserved ISO bytes to set.

◆ setReservedOem()

void pcpp::DoIpRoutingActivationResponse::setReservedOem ( const std::array< uint8_t, DOIP_RESERVED_OEM_LEN > &  reservedOem)

Sets the reserved OEM bytes.

Parameters
[in]reservedOemThe reserved OEM bytes to set.

◆ setResponseCode()

void pcpp::DoIpRoutingActivationResponse::setResponseCode ( DoIpRoutingResponseCodes  code)

Sets the routing response code.

Parameters
[in]codeThe routing response code to set.

◆ setSourceAddress()

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

Sets the source address.

Parameters
[in]sourceAddressThe source address to set.