30 virtual uint8_t*
getDataPtr(
size_t offset = 0)
const = 0;
156 return m_Packet !=
nullptr;
169 return (uint8_t*)(m_Data + offset);
207 bool m_IsAllocatedInPacket;
210 : m_Data(nullptr), m_DataLen(0), m_Packet(nullptr), m_Protocol(
UnknownProtocol), m_NextLayer(nullptr),
211 m_PrevLayer(nullptr), m_IsAllocatedInPacket(false)
215 : m_Data(data), m_DataLen(dataLen), m_Packet(packet), m_Protocol(protocol), m_NextLayer(nullptr),
216 m_PrevLayer(prevLayer), m_IsAllocatedInPacket(false)
220 Layer(
const Layer& other);
221 Layer& operator=(
const Layer& other);
223 void setNextLayer(Layer* nextLayer)
225 m_NextLayer = nextLayer;
227 void setPrevLayer(Layer* prevLayer)
229 m_PrevLayer = prevLayer;
232 virtual bool extendLayer(
int offsetInLayer,
size_t numOfBytesToExtend);
233 virtual bool shortenLayer(
int offsetInLayer,
size_t numOfBytesToShorten);
238 inline std::ostream& operator<<(std::ostream& os,
const pcpp::Layer& layer)
virtual uint8_t * getDataPtr(size_t offset=0) const =0
void copyData(uint8_t *toArr) const
uint8_t * getLayerPayload() const
Definition: Layer.h:130
uint8_t * getDataPtr(size_t offset=0) const
Definition: Layer.h:167
virtual std::string toString() const =0
size_t getDataLen() const
Definition: Layer.h:122
uint8_t * getData() const
Definition: Layer.h:114
virtual void parseNextLayer()=0
bool isMemberOfProtocolFamily(ProtocolTypeFamily protocolTypeFamily) const
Layer * getNextLayer() const
Definition: Layer.h:83
bool isAllocatedToPacket() const
Definition: Layer.h:154
Layer * getPrevLayer() const
Definition: Layer.h:91
ProtocolType getProtocol() const
Definition: Layer.h:99
size_t getLayerPayloadSize() const
Definition: Layer.h:138
virtual void computeCalculateFields()=0
virtual size_t getHeaderLen() const =0
virtual OsiModelLayer getOsiModelLayer() const =0
The main namespace for the PcapPlusPlus lib.
uint8_t ProtocolType
Definition: ProtocolType.h:17
OsiModelLayer
Definition: ProtocolType.h:354
uint32_t ProtocolTypeFamily
Definition: ProtocolType.h:23
const ProtocolType UnknownProtocol
Definition: ProtocolType.h:28