|
PcapPlusPlus
25.05
|
#include <S7CommLayer.h>
Public Member Functions | |
| S7CommLayer (uint8_t msgType, uint16_t pduRef, uint16_t paramLength, uint16_t dataLength, uint8_t errorClass=0, uint8_t errorCode=0) | |
| S7CommLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
| uint8_t | getProtocolId () const |
| uint8_t | getMsgType () const |
| uint16_t | getPduRef () const |
| uint16_t | getParamLength () const |
| uint16_t | getDataLength () const |
| uint8_t | getErrorCode () const |
| uint8_t | getErrorClass () const |
| const S7CommParameter * | getParameter () |
| void | setMsgType (uint8_t msgType) const |
| void | setPduRef (uint16_t pduRef) const |
| void | setErrorCode (uint8_t errorCode) const |
| void | setErrorClass (uint8_t errorClass) const |
| size_t | getHeaderLen () const override |
| void | computeCalculateFields () override |
| Does nothing for this layer (S7CommLayer is always last) | |
| void | parseNextLayer () override |
| Does nothing for this layer (S7CommLayer is always last) | |
| std::string | toString () const override |
| OsiModelLayer | getOsiModelLayer () const override |
Public Member Functions inherited from pcpp::Layer | |
| ~Layer () override | |
| Layer * | getNextLayer () const |
| Layer * | getPrevLayer () 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 | isDataValid (const uint8_t *data, size_t dataSize) |
Additional Inherited Members | |
Protected Member Functions inherited from pcpp::Layer | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (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... | |
Represents a S7COMM (S7 Communication) protocol
| pcpp::S7CommLayer::S7CommLayer | ( | uint8_t | msgType, |
| uint16_t | pduRef, | ||
| uint16_t | paramLength, | ||
| uint16_t | dataLength, | ||
| uint8_t | errorClass = 0, |
||
| uint8_t | errorCode = 0 |
||
| ) |
A constructor that allocates a new S7comm header
| [in] | msgType | The general type of the message |
| [in] | pduRef | Link responses to their requests |
| [in] | paramLength | The length of the parameter field |
| [in] | dataLength | The length of the data field |
| [in] | errorClass | The value of the error class |
| [in] | errorCode | The value of the error code |
| uint16_t pcpp::S7CommLayer::getDataLength | ( | ) | const |
| uint8_t pcpp::S7CommLayer::getErrorClass | ( | ) | const |
| uint8_t pcpp::S7CommLayer::getErrorCode | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
| uint8_t pcpp::S7CommLayer::getMsgType | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
| const S7CommParameter* pcpp::S7CommLayer::getParameter | ( | ) |
| uint16_t pcpp::S7CommLayer::getParamLength | ( | ) | const |
| uint16_t pcpp::S7CommLayer::getPduRef | ( | ) | const |
| uint8_t pcpp::S7CommLayer::getProtocolId | ( | ) | const |
|
static |
A static method that takes a byte array and detects whether it is a S7COMM
| [in] | data | A byte array |
| [in] | dataSize | The byte array size (in bytes) |
| void pcpp::S7CommLayer::setErrorClass | ( | uint8_t | errorClass | ) | const |
Set the value of the error class
| [in] | errorClass | The value of the error class |
| void pcpp::S7CommLayer::setErrorCode | ( | uint8_t | errorCode | ) | const |
Set the value of the error code
| [in] | errorCode | The value of the error code |
| void pcpp::S7CommLayer::setMsgType | ( | uint8_t | msgType | ) | const |
Set the value of the message type
| [in] | msgType | The value of the message type |
| void pcpp::S7CommLayer::setPduRef | ( | uint16_t | pduRef | ) | const |
Set the value of the PDU ref
| [in] | pduRef | The value of the PDU ref |
|
overridevirtual |
Implements pcpp::Layer.