PcapPlusPlus  24.09
pcpp::SomeIpTpLayer Class Reference

#include <SomeIpLayer.h>

Inheritance diagram for pcpp::SomeIpTpLayer:
pcpp::SomeIpLayer pcpp::Layer pcpp::IDataContainer

Classes

struct  someiptphdr
 

Public Member Functions

 SomeIpTpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 SomeIpTpLayer (uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID, uint8_t interfaceVersion, MsgType type, uint8_t returnCode, uint32_t offset, bool moreSegmentsFlag, const uint8_t *const data=nullptr, size_t dataLen=0)
 
 ~SomeIpTpLayer ()
 
someiptphdrgetSomeIpTpHeader () const
 
uint32_t getOffset () const
 
void setOffset (uint32_t offset)
 
bool getMoreSegmentsFlag () const
 
void setMoreSegmentsFlag (bool flag)
 
void computeCalculateFields ()
 
std::string toString () const
 
- Public Member Functions inherited from pcpp::SomeIpLayer
 SomeIpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 SomeIpLayer (uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID, uint8_t interfaceVersion, MsgType type, uint8_t returnCode, const uint8_t *const data=nullptr, size_t dataLen=0)
 
 ~SomeIpLayer ()
 
someiphdrgetSomeIpHeader () const
 
uint32_t getMessageID () const
 
void setMessageID (uint32_t messageID)
 
uint16_t getServiceID () const
 
void setServiceID (uint16_t serviceID)
 
uint16_t getMethodID () const
 
void setMethodID (uint16_t methodID)
 
uint32_t getLengthField () const
 
uint32_t getRequestID () const
 
void setRequestID (uint32_t requestID)
 
uint16_t getSessionID () const
 
void setSessionID (uint16_t sessionID)
 
uint16_t getClientID () const
 
void setClientID (uint16_t clientID)
 
uint8_t getProtocolVersion () const
 
void setProtocolVersion (uint8_t version)
 
uint8_t getInterfaceVersion () const
 
void setInterfaceVersion (uint8_t version)
 
uint8_t getMessageTypeAsInt () const
 
SomeIpLayer::MsgType getMessageType () const
 
void setMessageType (MsgType type)
 
void setMessageType (uint8_t type)
 
uint8_t getReturnCode () const
 
void setReturnCode (uint8_t returnCode)
 
void setPayloadLength (uint32_t payloadLength)
 
uint8_t * getPduPayload () const
 
size_t getPduPayloadSize () const
 
size_t getHeaderLen () const
 
void parseNextLayer ()
 
OsiModelLayer getOsiModelLayer () const
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
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
 

Additional Inherited Members

- Public Types inherited from pcpp::SomeIpLayer
enum class  MsgType : uint8_t {
  REQUEST = 0x00 , REQUEST_ACK = 0x40 , REQUEST_NO_RETURN = 0x01 , REQUEST_NO_RETURN_ACK = 0x41 ,
  NOTIFICATION = 0x02 , NOTIFICATION_ACK = 0x42 , RESPONSE = 0x80 , RESPONSE_ACK = 0xC0 ,
  ERRORS = 0x81 , ERROR_ACK = 0xC1 , TP_REQUEST = 0x20 , TP_REQUEST_NO_RETURN = 0x21 ,
  TP_NOTIFICATION = 0x22 , TP_RESPONSE = 0xa0 , TP_ERROR = 0xa1
}
 
- Static Public Member Functions inherited from pcpp::SomeIpLayer
static LayerparseSomeIpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
static bool isSomeIpPort (uint16_t port)
 
static void addSomeIpPort (uint16_t port)
 
static void removeSomeIpPort (uint16_t port)
 
static void removeAllSomeIpPorts ()
 

Detailed Description

Represents an SOME/IP Transport Protocol Layer

Constructor & Destructor Documentation

◆ SomeIpTpLayer() [1/2]

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

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data (will be casted to someiptphdr)
[in]dataLenSize of the data in bytes
[in]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in

◆ SomeIpTpLayer() [2/2]

pcpp::SomeIpTpLayer::SomeIpTpLayer ( uint16_t  serviceID,
uint16_t  methodID,
uint16_t  clientID,
uint16_t  sessionID,
uint8_t  interfaceVersion,
MsgType  type,
uint8_t  returnCode,
uint32_t  offset,
bool  moreSegmentsFlag,
const uint8_t *const  data = nullptr,
size_t  dataLen = 0 
)

A constructor that creates empty layer and sets values

Parameters
[in]serviceIDService ID
[in]methodIDMethod ID
[in]clientIDClient ID
[in]sessionIDSession ID
[in]interfaceVersionInterface Version
[in]typeType of the message
[in]returnCodeReturn Code
[in]offsetOffset indicating the data offset in increments of 16 bytes
[in]moreSegmentsFlagFlag indicating whether more SOME/IP-TP Packets will follow
[in]dataA pointer to the raw data
[in]dataLenSize of the data in bytes

◆ ~SomeIpTpLayer()

pcpp::SomeIpTpLayer::~SomeIpTpLayer ( )
inline

Destroy the layer object

Member Function Documentation

◆ computeCalculateFields()

void pcpp::SomeIpTpLayer::computeCalculateFields ( )
virtual

Sets the message type in this layer with enabling the TP flag

Reimplemented from pcpp::SomeIpLayer.

◆ getMoreSegmentsFlag()

bool pcpp::SomeIpTpLayer::getMoreSegmentsFlag ( ) const

Get the More Segments Flag

Returns
true if the More Segments Flag is set, false if it is not set

◆ getOffset()

uint32_t pcpp::SomeIpTpLayer::getOffset ( ) const

Get the Offset. Offset is returned in multiple of 16 bytes.

Returns
The offset value

◆ getSomeIpTpHeader()

someiptphdr* pcpp::SomeIpTpLayer::getSomeIpTpHeader ( ) const
inline

Get a pointer to the basic SOME/IP-TP header. Notice this points directly to the data, so every change will change the actual packet data

Returns
A pointer to the someiptphdr

◆ setMoreSegmentsFlag()

void pcpp::SomeIpTpLayer::setMoreSegmentsFlag ( bool  flag)

Set the More Segments Flag

Parameters
[in]flagTrue if the More Segments Flag shall be set, false for resetting

◆ setOffset()

void pcpp::SomeIpTpLayer::setOffset ( uint32_t  offset)

Set the Offset. Already has to be in multiples of 16 bytes. If 32 bytes have already been transmitted, the offset has to be set to 2.

Parameters
[in]offsetOffset to set. Already has to be in multiples of 16 bytes.

◆ toString()

std::string pcpp::SomeIpTpLayer::toString ( ) const
virtual
Returns
The string representation of the SOME/IP-TP layer

Reimplemented from pcpp::SomeIpLayer.