PcapPlusPlus
22.11
|
#include <SomeIpSdLayer.h>
Public Member Functions | |
SomeIpSdLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
SomeIpSdLayer (uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID, uint8_t interfaceVersion, MsgType type, uint8_t returnCode, uint8_t flags) | |
~SomeIpSdLayer () | |
uint8_t | getFlags () const |
void | setFlags (uint8_t flags) |
uint32_t | getNumEntries () const |
uint32_t | getNumOptions () const |
const EntriesVec | getEntries () const |
const OptionsVec | getOptions () const |
const OptionsVec | getOptionsFromEntry (uint32_t index) const |
uint32_t | addEntry (const SomeIpSdEntry &entry) |
bool | addOptionTo (uint32_t indexEntry, const SomeIpSdOption &option) |
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 () | |
someiphdr * | getSomeIpHeader () 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 () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () 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 |
Static Public Member Functions | |
static bool | isSomeIpSdPort (uint16_t port) |
Static Public Member Functions inherited from pcpp::SomeIpLayer | |
static Layer * | parseSomeIpLayer (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 () |
Additional Inherited Members | |
Public Types inherited from pcpp::SomeIpLayer | |
enum | MsgType : uint8_t { MsgType::REQUEST = 0x00, MsgType::REQUEST_ACK = 0x40, MsgType::REQUEST_NO_RETURN = 0x01, MsgType::REQUEST_NO_RETURN_ACK = 0x41, MsgType::NOTIFICATION = 0x02, MsgType::NOTIFICATION_ACK = 0x42, MsgType::RESPONSE = 0x80, MsgType::RESPONSE_ACK = 0xC0, MsgType::ERRORS = 0x81, MsgType::ERROR_ACK = 0xC1, MsgType::TP_REQUEST = 0x20, MsgType::TP_REQUEST_NO_RETURN = 0x21, MsgType::TP_NOTIFICATION = 0x22, MsgType::TP_RESPONSE = 0xa0, MsgType::TP_ERROR = 0xa1 } |
Implementation of the SOME/IP-SD protocol
pcpp::SomeIpSdLayer::SomeIpSdLayer | ( | uint8_t * | data, |
size_t | dataLen, | ||
Layer * | prevLayer, | ||
Packet * | packet | ||
) |
A constructor that creates the layer from an existing packet raw data
[in] | data | A pointer to the raw data |
[in] | dataLen | Size of the data in bytes |
[in] | prevLayer | A pointer to the previous layer |
[in] | packet | A pointer to the Packet instance where layer will be stored in |
pcpp::SomeIpSdLayer::SomeIpSdLayer | ( | uint16_t | serviceID, |
uint16_t | methodID, | ||
uint16_t | clientID, | ||
uint16_t | sessionID, | ||
uint8_t | interfaceVersion, | ||
MsgType | type, | ||
uint8_t | returnCode, | ||
uint8_t | flags | ||
) |
Construct a new SomeIpSdLayer object
[in] | serviceID | Service ID |
[in] | methodID | Method ID |
[in] | clientID | Client ID |
[in] | sessionID | Session ID |
[in] | interfaceVersion | Interface Version |
[in] | type | Type of the message |
[in] | returnCode | Return Code |
[in] | flags | Flags that shall be used in the header |
|
inline |
Destroy the layer object
uint32_t pcpp::SomeIpSdLayer::addEntry | ( | const SomeIpSdEntry & | entry | ) |
Adds a given entry to the layer and returns the index of the entry
[in] | entry | Pointer to the entry that shall be added to the layer |
bool pcpp::SomeIpSdLayer::addOptionTo | ( | uint32_t | indexEntry, |
const SomeIpSdOption & | option | ||
) |
Adds an option to an entry that has already been added to the layer by using addEntry(). The option is also added to the layer itself. If the option cannot by assigned to the entry, the option is not copied into the layer.
[in] | indexEntry | Index of the entry where the option shall be added. First Entry has index 0 |
[in] | option | Pointer to the option that shall be added |
|
inlinevirtual |
Does nothing for this layer
Reimplemented from pcpp::SomeIpLayer.
const EntriesVec pcpp::SomeIpSdLayer::getEntries | ( | ) | const |
Get the Entries from this layer
uint8_t pcpp::SomeIpSdLayer::getFlags | ( | ) | const |
Get the Flags of the layer
uint32_t pcpp::SomeIpSdLayer::getNumEntries | ( | ) | const |
Get the number of entries in this layer
uint32_t pcpp::SomeIpSdLayer::getNumOptions | ( | ) | const |
Get the number of options in this layer
const OptionsVec pcpp::SomeIpSdLayer::getOptions | ( | ) | const |
Get the Options from this layer
const OptionsVec pcpp::SomeIpSdLayer::getOptionsFromEntry | ( | uint32_t | index | ) | const |
Get the Options from a specific Entry
[in] | index | Index of the Entry, starting with 0. |
|
inlinestatic |
Checks if given port is a SOME/IP-SD protocol port
[in] | port | Port to check |
void pcpp::SomeIpSdLayer::setFlags | ( | uint8_t | flags | ) |
Set the Flags of the layer
[in] | flags | Flags to set |
|
virtual |
Reimplemented from pcpp::SomeIpLayer.