4 #include <unordered_set>
112 SomeIpLayer(uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID,
113 uint8_t interfaceVersion,
MsgType type, uint8_t returnCode,
const uint8_t*
const data =
nullptr,
139 return reinterpret_cast<someiphdr*
>(m_Data);
316 return m_Data + getSomeIpHeaderLen();
365 static const uint8_t SOMEIP_PROTOCOL_VERSION = 1;
366 virtual size_t getSomeIpHeaderLen()
const
368 return sizeof(someiphdr);
372 static std::unordered_set<uint16_t> m_SomeIpPorts;
386 #pragma pack(push, 1)
420 SomeIpTpLayer(uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID,
421 uint8_t interfaceVersion,
MsgType type, uint8_t returnCode, uint32_t offset,
422 bool moreSegmentsFlag,
const uint8_t*
const data =
nullptr,
size_t dataLen = 0);
475 static const uint32_t SOMEIP_TP_MORE_FLAG_MASK = 0x01;
476 static const uint32_t SOMEIP_TP_OFFSET_MASK = 0xFFFFFFF0;
478 size_t getSomeIpHeaderLen()
const override
483 static uint8_t setTpFlag(uint8_t messageType);
Definition: SomeIpLayer.h:20
void setRequestID(uint32_t requestID)
size_t getPduPayloadSize() const
Definition: SomeIpLayer.h:322
~SomeIpLayer() override=default
void setClientID(uint16_t clientID)
virtual void computeCalculateFields() override
Definition: SomeIpLayer.h:339
void setMessageType(MsgType type)
void setProtocolVersion(uint8_t version)
uint8_t getReturnCode() const
virtual std::string toString() const override
static void removeSomeIpPort(uint16_t port)
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)
OsiModelLayer getOsiModelLayer() const override
Definition: SomeIpLayer.h:355
void setMessageID(uint32_t messageID)
uint16_t getMethodID() const
void setServiceID(uint16_t serviceID)
static bool isSomeIpPort(uint16_t port)
void setMethodID(uint16_t methodID)
size_t getHeaderLen() const override
Definition: SomeIpLayer.h:331
void parseNextLayer() override
someiphdr * getSomeIpHeader() const
Definition: SomeIpLayer.h:137
void setReturnCode(uint8_t returnCode)
SomeIpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SomeIpLayer.h:94
MsgType
Definition: SomeIpLayer.h:26
uint32_t getLengthField() const
uint32_t getMessageID() const
uint8_t getInterfaceVersion() const
uint16_t getServiceID() const
uint32_t getRequestID() const
uint8_t getMessageTypeAsInt() const
void setMessageType(uint8_t type)
uint8_t getProtocolVersion() const
SomeIpLayer::MsgType getMessageType() const
uint8_t * getPduPayload() const
Definition: SomeIpLayer.h:314
static void addSomeIpPort(uint16_t port)
void setSessionID(uint16_t sessionID)
void setInterfaceVersion(uint8_t version)
void setPayloadLength(uint32_t payloadLength)
uint16_t getClientID() const
uint16_t getSessionID() const
static void removeAllSomeIpPorts()
static Layer * parseSomeIpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SomeIpLayer.h:380
bool getMoreSegmentsFlag() const
SomeIpTpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SomeIpLayer.h:402
someiptphdr * getSomeIpTpHeader() const
Definition: SomeIpLayer.h:434
void setMoreSegmentsFlag(bool flag)
void computeCalculateFields() override
std::string toString() const override
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)
uint32_t getOffset() const
~SomeIpTpLayer() override=default
void setOffset(uint32_t offset)
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:364
@ OsiModelApplicationLayer
Definition: ProtocolType.h:378
const ProtocolType SomeIP
Definition: ProtocolType.h:293
Definition: SomeIpLayer.h:65
uint8_t returnCode
Definition: SomeIpLayer.h:83
uint8_t protocolVersion
Definition: SomeIpLayer.h:77
uint32_t length
Definition: SomeIpLayer.h:71
uint16_t sessionID
Definition: SomeIpLayer.h:75
uint16_t clientID
Definition: SomeIpLayer.h:73
uint8_t msgType
Definition: SomeIpLayer.h:81
uint16_t serviceID
Definition: SomeIpLayer.h:67
uint16_t methodID
Definition: SomeIpLayer.h:69
uint8_t interfaceVersion
Definition: SomeIpLayer.h:79
Definition: SomeIpLayer.h:388
uint32_t offsetAndFlag
Definition: SomeIpLayer.h:391