PcapPlusPlus  Next
pcpp::DoIpEntityStatusResponse Class Reference

Represents a DoIP Entity Status Response message. More...

#include <DoIpLayer.h>

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

Public Member Functions

 DoIpEntityStatusResponse (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 Constructs the layer from raw DoIP packet data. More...
 
 DoIpEntityStatusResponse (DoIpEntityStatusResponseCode nodeType, uint8_t maxConcurrentSockets, uint8_t currentlyOpenSockets)
 Constructs the message using provided field values. More...
 
DoIpPayloadTypes getPayloadType () const override
 Returns the DoIP payload type. More...
 
DoIpEntityStatusResponseCode getNodeType () const
 Gets the type of the DoIP node. More...
 
uint8_t getMaxConcurrentSockets () const
 Gets the maximum number of concurrent sockets supported. More...
 
uint8_t getCurrentlyOpenSockets () const
 Gets the number of currently open sockets. More...
 
uint32_t getMaxDataSize () const
 Gets the optional maximum data size field. More...
 
void setNodeType (DoIpEntityStatusResponseCode status)
 Sets the DoIP node type. More...
 
void setMaxConcurrentSockets (uint8_t sockets)
 Sets the maximum number of concurrent sockets. More...
 
void setCurrentlyOpenSockets (uint8_t sockets)
 Sets the number of currently open sockets. More...
 
void setMaxDataSize (uint32_t data)
 Sets the maximum data size field. More...
 
bool hasMaxDataSize () const
 Checks if the optional max data size is present. More...
 
void clearMaxDataSize ()
 Clears the optional max data size field.
 
std::string getSummary () const
 Returns a human-readable summary of the message. 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
 

Static Public Member Functions

static bool isDataLenValid (size_t dataLen)
 Checks if the Entity Status 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 Entity Status Response message.

This message provides the status of a DoIP entity, such as its type, the number of concurrent sockets it can support, and optionally the max data size.

Constructor & Destructor Documentation

◆ DoIpEntityStatusResponse() [1/2]

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

Constructs the layer from raw DoIP packet data.

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

◆ DoIpEntityStatusResponse() [2/2]

pcpp::DoIpEntityStatusResponse::DoIpEntityStatusResponse ( DoIpEntityStatusResponseCode  nodeType,
uint8_t  maxConcurrentSockets,
uint8_t  currentlyOpenSockets 
)

Constructs the message using provided field values.

Parameters
[in]nodeTypeType of the DoIP node (default: GATEWAY).
[in]maxConcurrentSocketsMaximum supported concurrent sockets.
[in]currentlyOpenSocketsCurrently active sockets.

Member Function Documentation

◆ getCurrentlyOpenSockets()

uint8_t pcpp::DoIpEntityStatusResponse::getCurrentlyOpenSockets ( ) const

Gets the number of currently open sockets.

Returns
Number of currently open sockets.

◆ getMaxConcurrentSockets()

uint8_t pcpp::DoIpEntityStatusResponse::getMaxConcurrentSockets ( ) const

Gets the maximum number of concurrent sockets supported.

Returns
Max supported concurrent sockets.

◆ getMaxDataSize()

uint32_t pcpp::DoIpEntityStatusResponse::getMaxDataSize ( ) const

Gets the optional maximum data size field.

Exceptions
std::runtime_errorif the max data size is not present.
Note
To use this method safely, check beforehand if the max data size is present using hasMaxDataSize().
Returns
The maximum data size in bytes.

◆ getNodeType()

DoIpEntityStatusResponseCode pcpp::DoIpEntityStatusResponse::getNodeType ( ) const

Gets the type of the DoIP node.

Returns
enum DoIpEntityStatusResponseCode representing the node type.

◆ getPayloadType()

DoIpPayloadTypes pcpp::DoIpEntityStatusResponse::getPayloadType ( ) const
inlineoverridevirtual

Returns the DoIP payload type.

Returns
DoIpPayloadTypes::ENTITY_STATUS_RESPONSE

Implements pcpp::DoIpLayer.

◆ getSummary()

std::string pcpp::DoIpEntityStatusResponse::getSummary ( ) const

Returns a human-readable summary of the message.

Returns
A string summarizing the Entity Status Response.

◆ hasMaxDataSize()

bool pcpp::DoIpEntityStatusResponse::hasMaxDataSize ( ) const

Checks if the optional max data size is present.

Returns
True if max data size is available, false otherwise.

◆ isDataLenValid()

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

Checks if the Entity Status Response data length is valid.

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

◆ setCurrentlyOpenSockets()

void pcpp::DoIpEntityStatusResponse::setCurrentlyOpenSockets ( uint8_t  sockets)

Sets the number of currently open sockets.

Parameters
[in]socketsNew count of currently open sockets.

◆ setMaxConcurrentSockets()

void pcpp::DoIpEntityStatusResponse::setMaxConcurrentSockets ( uint8_t  sockets)

Sets the maximum number of concurrent sockets.

Parameters
[in]socketsNew maximum concurrent socket count.

◆ setMaxDataSize()

void pcpp::DoIpEntityStatusResponse::setMaxDataSize ( uint32_t  data)

Sets the maximum data size field.

Parameters
[in]datauint32_t representing the max data size.

◆ setNodeType()

void pcpp::DoIpEntityStatusResponse::setNodeType ( DoIpEntityStatusResponseCode  status)

Sets the DoIP node type.

Parameters
[in]statusenum DoIpEntityStatusResponseCode representing the node type to set.