1 #ifndef PACKETPP_SOMEIP_LAYER 2 #define PACKETPP_SOMEIP_LAYER 5 #include <unordered_set> 96 :
Layer(data, dataLen, prevLayer, packet)
114 SomeIpLayer(uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID, uint8_t interfaceVersion,
115 MsgType type, uint8_t returnCode,
const uint8_t *
const data =
nullptr,
size_t dataLen = 0);
338 virtual std::string
toString()
const;
349 static const uint8_t SOMEIP_PROTOCOL_VERSION = 1;
350 virtual size_t getSomeIpHeaderLen()
const {
return sizeof(
someiphdr); }
353 static std::unordered_set<uint16_t> m_SomeIpPorts;
367 #pragma pack(push, 1) 400 SomeIpTpLayer(uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID,
401 uint8_t interfaceVersion,
MsgType type, uint8_t returnCode, uint32_t offset,
bool moreSegmentsFlag,
402 const uint8_t *
const data =
nullptr,
size_t dataLen = 0);
420 uint32_t getOffset()
const;
427 void setOffset(uint32_t offset);
433 bool getMoreSegmentsFlag()
const;
439 void setMoreSegmentsFlag(
bool flag);
452 static const uint32_t SOMEIP_TP_MORE_FLAG_MASK = 0x01;
453 static const uint32_t SOMEIP_TP_OFFSET_MASK = 0xFFFFFFF0;
455 size_t getSomeIpHeaderLen()
const {
return sizeof(
someiptphdr); }
457 static uint8_t setTpFlag(uint8_t messageType);
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:298
void setMessageID(uint32_t messageID)
OsiModelLayer getOsiModelLayer() const
Definition: SomeIpLayer.h:343
size_t getPduPayloadSize() const
Definition: SomeIpLayer.h:317
uint8_t interfaceVersion
Definition: SomeIpLayer.h:80
Definition: SomeIpLayer.h:368
uint16_t sessionID
Definition: SomeIpLayer.h:76
uint32_t getLengthField() const
virtual std::string toString() const
void setServiceID(uint16_t serviceID)
void setInterfaceVersion(uint8_t version)
void setSessionID(uint16_t sessionID)
Definition: ProtocolType.h:313
uint8_t returnCode
Definition: SomeIpLayer.h:84
uint8_t getInterfaceVersion() const
uint16_t getClientID() const
uint16_t methodID
Definition: SomeIpLayer.h:70
uint8_t * getPduPayload() const
Definition: SomeIpLayer.h:312
uint8_t msgType
Definition: SomeIpLayer.h:82
uint8_t getProtocolVersion() const
void setReturnCode(uint8_t returnCode)
uint8_t getMessageTypeAsInt() const
static bool isSomeIpPort(uint16_t port)
Definition: SomeIpLayer.h:65
void setProtocolVersion(uint8_t version)
uint16_t getMethodID() const
virtual void computeCalculateFields()
Definition: SomeIpLayer.h:328
SomeIpTpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SomeIpLayer.h:383
uint16_t getServiceID() const
void setMessageType(MsgType type)
uint32_t length
Definition: SomeIpLayer.h:72
const ProtocolType SomeIP
Definition: ProtocolType.h:288
uint8_t protocolVersion
Definition: SomeIpLayer.h:78
uint32_t getRequestID() const
Definition: SomeIpLayer.h:20
SomeIpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SomeIpLayer.h:95
uint32_t offsetAndFlag
Definition: SomeIpLayer.h:372
uint8_t getReturnCode() const
someiptphdr * getSomeIpTpHeader() const
Definition: SomeIpLayer.h:414
~SomeIpTpLayer()
Definition: SomeIpLayer.h:407
void setRequestID(uint32_t requestID)
MsgType
Definition: SomeIpLayer.h:26
static void removeAllSomeIpPorts()
uint16_t clientID
Definition: SomeIpLayer.h:74
size_t getHeaderLen() const
Definition: SomeIpLayer.h:323
uint16_t serviceID
Definition: SomeIpLayer.h:68
Definition: SomeIpLayer.h:360
someiphdr * getSomeIpHeader() const
Definition: SomeIpLayer.h:138
void setClientID(uint16_t clientID)
static void removeSomeIpPort(uint16_t port)
void setPayloadLength(uint32_t payloadLength)
uint16_t getSessionID() const
SomeIpLayer::MsgType getMessageType() const
void setMethodID(uint16_t methodID)
static void addSomeIpPort(uint16_t port)
~SomeIpLayer()
Definition: SomeIpLayer.h:120
static Layer * parseSomeIpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
uint32_t getMessageID() const