|
PcapPlusPlus
Next
|
#include <GtpLayer.h>
Public Member Functions | |
| GtpV2Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
| GtpV2Layer (GtpV2MessageType messageType, uint32_t sequenceNumber, bool setTeid=false, uint32_t teid=0, bool setMessagePriority=false, std::bitset< 4 > messagePriority=0) | |
| GtpV2MessageType | getMessageType () const |
| void | setMessageType (const GtpV2MessageType &type) |
| uint16_t | getMessageLength () const |
| bool | isPiggybacking () const |
| std::pair< bool, uint32_t > | getTeid () const |
| void | setTeid (uint32_t teid) |
| void | unsetTeid () |
| Unset Tunnel Endpoint Identifier (TEID) if exists in the layer (otherwise does nothing) | |
| uint32_t | getSequenceNumber () const |
| void | setSequenceNumber (uint32_t sequenceNumber) |
| std::pair< bool, uint8_t > | getMessagePriority () const |
| void | setMessagePriority (const std::bitset< 4 > &messagePriority) |
| void | unsetMessagePriority () |
| Unset Message Priority if exists in the layer (otherwise does nothing) | |
| GtpV2InformationElement | getFirstInformationElement () const |
| GtpV2InformationElement | getNextInformationElement (GtpV2InformationElement infoElement) const |
| GtpV2InformationElement | getInformationElement (GtpV2InformationElement::Type infoElementType) const |
| size_t | getInformationElementCount () const |
| GtpV2InformationElement | addInformationElement (const GtpV2InformationElementBuilder &infoElementBuilder) |
| GtpV2InformationElement | addInformationElementAfter (const GtpV2InformationElementBuilder &infoElementBuilder, GtpV2InformationElement::Type infoElementType) |
| bool | removeInformationElement (GtpV2InformationElement::Type infoElementType) |
| bool | removeAllInformationElements () |
| void | parseNextLayer () override |
| Identifies if the next layer is GTPv2 piggyback. Otherwise sets PayloadLayer. | |
| size_t | getHeaderLen () const override |
| void | computeCalculateFields () override |
| Computes the piggybacking flag by checking if the next layer is also a GTPv2 message. | |
| 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 | isGTPv2Port (uint16_t port) |
| 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... | |
A class representing the GTPv2 defined in 3GPP TS 29.274
|
inline |
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::GtpV2Layer::GtpV2Layer | ( | GtpV2MessageType | messageType, |
| uint32_t | sequenceNumber, | ||
| bool | setTeid = false, |
||
| uint32_t | teid = 0, |
||
| bool | setMessagePriority = false, |
||
| std::bitset< 4 > | messagePriority = 0 |
||
| ) |
A constructor that creates a new GTPv2 message
| messageType | GTPv2 message type |
| sequenceNumber | Message sequence number |
| setTeid | Whether or not to set Tunnel Endpoint Identifier in this message |
| teid | Tunnel Endpoint Identifier value. Only used if setTeid is set to true |
| setMessagePriority | Whether or not to set Message Priority in this message |
| messagePriority | Message Priority. Only used if setMessagePriority to true |
| GtpV2InformationElement pcpp::GtpV2Layer::addInformationElement | ( | const GtpV2InformationElementBuilder & | infoElementBuilder | ) |
Add a new Information Element (IE) at the end of the layer
| [in] | infoElementBuilder | A GtpV2InformationElementBuilder object that contains the requested IE data to add |
| GtpV2InformationElement pcpp::GtpV2Layer::addInformationElementAfter | ( | const GtpV2InformationElementBuilder & | infoElementBuilder, |
| GtpV2InformationElement::Type | infoElementType | ||
| ) |
Add a new Information Element (IE) after an existing one
| [in] | infoElementBuilder | A GtpV2InformationElementBuilder object that contains the requested IE data to add |
| [in] | infoElementType | The IE type which the newly added option will come after |
| GtpV2InformationElement pcpp::GtpV2Layer::getFirstInformationElement | ( | ) | const |
|
overridevirtual |
Implements pcpp::Layer.
| GtpV2InformationElement pcpp::GtpV2Layer::getInformationElement | ( | GtpV2InformationElement::Type | infoElementType | ) | const |
Get a GTPv2 Information Element (IE) by type
| [in] | infoElementType | GTPv2 Information Element (IE) type |
| size_t pcpp::GtpV2Layer::getInformationElementCount | ( | ) | const |
| uint16_t pcpp::GtpV2Layer::getMessageLength | ( | ) | const |
| std::pair<bool, uint8_t> pcpp::GtpV2Layer::getMessagePriority | ( | ) | const |
Get the Message Property if exists
| GtpV2MessageType pcpp::GtpV2Layer::getMessageType | ( | ) | const |
| GtpV2InformationElement pcpp::GtpV2Layer::getNextInformationElement | ( | GtpV2InformationElement | infoElement | ) | const |
Get the GTPv2 Information Element (IE) that comes after a given IE. If the given IE was the last one, the returned value will contain a logical null (GtpV2InformationElement::isNull() == true)
| [in] | infoElement | A given GTPv2 Information Element |
|
inlineoverridevirtual |
Implements pcpp::Layer.
| uint32_t pcpp::GtpV2Layer::getSequenceNumber | ( | ) | const |
| std::pair<bool, uint32_t> pcpp::GtpV2Layer::getTeid | ( | ) | const |
Get the Tunnel Endpoint Identifier (TEID) if exists
|
static |
A static method that takes a byte array and detects whether it is a GTPv2 message
| [in] | data | A byte array |
| [in] | dataSize | The byte array size (in bytes) |
|
inlinestatic |
A static method that checks whether the port is considered as GTPv2
| [in] | port | The port number to be checked |
| bool pcpp::GtpV2Layer::isPiggybacking | ( | ) | const |
| bool pcpp::GtpV2Layer::removeAllInformationElements | ( | ) |
Remove all Information Elements (IE) in this layer
| bool pcpp::GtpV2Layer::removeInformationElement | ( | GtpV2InformationElement::Type | infoElementType | ) |
Remove an existing Information Element (IE) from the layer
| [in] | infoElementType | The IE type to remove |
| void pcpp::GtpV2Layer::setMessagePriority | ( | const std::bitset< 4 > & | messagePriority | ) |
Set Message Priority
| messagePriority | The Message Priority value to set |
| void pcpp::GtpV2Layer::setMessageType | ( | const GtpV2MessageType & | type | ) |
Set message type
| type | The message type to set |
| void pcpp::GtpV2Layer::setSequenceNumber | ( | uint32_t | sequenceNumber | ) |
Set the sequence number
| sequenceNumber | The sequence number value to set |
| void pcpp::GtpV2Layer::setTeid | ( | uint32_t | teid | ) |
Set Tunnel Endpoint Identifier (TEID)
| teid | The TEID value to set |
|
overridevirtual |
Implements pcpp::Layer.