PcapPlusPlus  Next
GtpLayer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Layer.h"
4 #include "TLVData.h"
5 #include <vector>
6 #include <bitset>
7 
9 
12 namespace pcpp
13 {
14 
15 #pragma pack(push, 1)
18  struct gtpv1_header
19  {
20 #if (BYTE_ORDER == LITTLE_ENDIAN)
22  uint8_t npduNumberFlag : 1,
28  reserved : 1,
32  version : 3;
33 #else
35  uint8_t version : 3,
37  protocolType : 1,
39  reserved : 1,
45  npduNumberFlag : 1;
46 #endif
48  uint8_t messageType;
49 
52  uint16_t messageLength;
53 
56  uint32_t teid;
57  };
58 #pragma pack(pop)
59  static_assert(sizeof(gtpv1_header) == 8, "gtpv1_header size is not 8 bytes");
60 
65  {
203  GtpV1_GPDU = 255
204  };
205 
208  class GtpV1Layer : public Layer
209  {
210  private:
211  struct gtpv1_header_extra
212  {
213  uint16_t sequenceNumber;
214  uint8_t npduNumber;
215  uint8_t nextExtensionHeader;
216  };
217 
218  gtpv1_header_extra* getHeaderExtra() const;
219 
220  void init(GtpV1MessageType messageType, uint32_t teid, bool setSeqNum, uint16_t seqNum, bool setNpduNum,
221  uint8_t npduNum);
222 
223  public:
227  {
228  friend class GtpV1Layer;
229 
230  private:
231  uint8_t* m_Data;
232  size_t m_DataLen;
233  uint8_t m_ExtType;
234 
235  GtpExtension(uint8_t* data, size_t dataLen, uint8_t type);
236 
237  void setNextHeaderType(uint8_t nextHeaderType);
238 
239  static GtpExtension createGtpExtension(uint8_t* data, size_t dataLen, uint8_t extType, uint16_t content);
240 
241  public:
244 
247  GtpExtension(const GtpExtension& other);
248 
253 
256  bool isNull() const;
257 
259  uint8_t getExtensionType() const;
260 
263  size_t getTotalLength() const;
264 
267  size_t getContentLength() const;
268 
271  uint8_t* getContent() const;
272 
275  uint8_t getNextExtensionHeaderType() const;
276 
281  }; // GtpExtension
282 
283  ~GtpV1Layer() override = default;
284 
290  GtpV1Layer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
291  : Layer(data, dataLen, prevLayer, packet, GTPv1)
292  {}
293 
297  GtpV1Layer(GtpV1MessageType messageType, uint32_t teid);
298 
310  GtpV1Layer(GtpV1MessageType messageType, uint32_t teid, bool setSeqNum, uint16_t seqNum, bool setNpduNum,
311  uint8_t npduNum);
312 
317  static bool isGTPv1(const uint8_t* data, size_t dataSize);
318 
322  {
323  return reinterpret_cast<gtpv1_header*>(m_Data);
324  }
325 
330  bool getSequenceNumber(uint16_t& seqNumber) const;
331 
336  bool setSequenceNumber(uint16_t seqNumber);
337 
342  bool getNpduNumber(uint8_t& npduNum) const;
343 
348  bool setNpduNumber(uint8_t npduNum);
349 
355  bool getNextExtensionHeaderType(uint8_t& nextExtType) const;
356 
360 
369  GtpExtension addExtension(uint8_t extensionType, uint16_t extensionContent);
370 
373 
375  std::string getMessageTypeAsString() const;
376 
378  bool isGTPUMessage() const;
379 
381  bool isGTPCMessage() const;
382 
386  static bool isGTPv1Port(uint16_t port)
387  {
388  return port == 2152 /* GTP-U */ || port == 2123 /* GTP-C */;
389  }
390 
391  // implement abstract methods
392 
394  void parseNextLayer() override;
395 
400  size_t getHeaderLen() const override;
401 
404  void computeCalculateFields() override;
405 
406  std::string toString() const override;
407 
409  {
410  return OsiModelTransportLayer;
411  }
412  };
413 
417  {
418  public:
420  enum Value : uint8_t
421  {
423  Unknown = 0,
523  CSPaging = 151,
535  ISRStatus = 157,
588  };
589 
590  GtpV2MessageType() = default;
591 
592  // cppcheck-suppress noExplicitConstructor
595  constexpr GtpV2MessageType(Value value) : m_Value(value)
596  {}
597 
599  std::string toString() const;
600 
605  static GtpV2MessageType fromUintValue(uint8_t value);
606 
607  // Allow switch and comparisons.
608  constexpr operator Value() const
609  {
610  return m_Value;
611  }
612 
613  // Prevent usage: if(GtpV2MessageType)
614  explicit operator bool() const = delete;
615 
616  private:
618  };
619 
623  class GtpV2InformationElement : public TLVRecord<uint8_t, uint16_t>
624  {
625  public:
627  enum class Type : uint8_t
628  {
630  Unknown = 0,
632  Imsi = 1,
634  Cause = 2,
636  Recovery = 3,
638  StnSr = 51,
640  Apn = 71,
642  Ambr = 72,
644  Ebi = 73,
646  IpAddress = 74,
648  Mei = 75,
650  Msisdn = 76,
652  Indication = 77,
654  Pco = 78,
656  Paa = 79,
658  BearerQos = 80,
660  FlowQos = 81,
662  RatType = 82,
664  ServingNetwork = 83,
666  BearerTft = 84,
668  Tad = 85,
670  Uli = 86,
672  FTeid = 87,
674  Tmsi = 88,
676  GlobalCnId = 89,
682  DelayValue = 92,
684  BearerContext = 93,
686  ChargingId = 94,
690  TraceInformation = 96,
692  BearerFlags = 97,
694  PdnType = 99,
696  Pti = 100,
698  MmContext1 = 103,
700  MmContext2 = 104,
702  MmContext3 = 105,
704  MmContext4 = 106,
706  MmContext5 = 107,
708  MmContext6 = 108,
710  PdnConnection = 109,
712  PduNumbers = 110,
714  PTmsi = 111,
716  PTmsiSignature = 112,
718  HopCounter = 113,
720  UeTimeZone = 114,
722  TraceReference = 115,
726  Guti = 117,
728  FContainer = 118,
730  FCause = 119,
732  PlmnId = 120,
734  TargetIdentification = 121,
736  PacketFlowId = 123,
738  RabContext = 124,
742  PortNumber = 126,
744  ApnRestriction = 127,
746  SelectionMode = 128,
748  SourceIdentification = 129,
750  ChangeReportingAction = 131,
752  FqCsid = 132,
754  ChannelNeeded = 133,
756  EmlppPriority = 134,
758  NodeType = 135,
760  Fqdn = 136,
762  Ti = 137,
764  MbmsSessionDuration = 138,
766  MbmsServiceArea = 139,
768  MbmsSessionIdentifier = 140,
770  MbmsFlowIdentifier = 141,
776  RfspIndex = 144,
778  Uci = 145,
782  CsgId = 147,
784  Cmi = 148,
786  ServiceIndicator = 149,
788  DetachType = 150,
790  Ldn = 151,
792  NodeFeatures = 152,
796  Throttling = 154,
798  Arp = 155,
800  EpcTimer = 156,
804  Tmgi = 158,
810  MdtConfiguration = 162,
812  Apco = 163,
820  ChangeToReportFlags = 167,
822  ActionIndication = 168,
824  TwanIdentifier = 169,
826  UliTimestamp = 170,
828  MbmsFlags = 171,
830  RanNasCause = 172,
834  Twmi = 174,
836  NodeNumber = 175,
838  NodeIdentifier = 176,
850  Metric = 182,
852  SequenceNumber = 183,
860  IntegerNumber = 187,
862  MillisecondTimeStamp = 188,
866  EcgiList = 190,
868  RemoteUeContext = 191,
870  RemoteUserId = 192,
872  RemoteUeIpInformation = 193,
876  ScefPdnConnection = 195,
880  ExtendedPco = 197,
884  Counter = 199,
886  MappedUeUsageType = 200,
892  MaximumPacketLossRate = 203,
894  ApnRateControlStatus = 204,
902  V2xContext = 208,
904  Pc5QosParameters = 209,
906  ServicesAuthorized = 210,
908  BitRate = 211,
910  Pc5QosFlow = 212,
912  SgiPtpTunnelAddress = 213
913  };
914 
917  explicit GtpV2InformationElement(uint8_t* infoElementRawData) : TLVRecord(infoElementRawData)
918  {}
919 
920  ~GtpV2InformationElement() override = default;
921 
924 
926  uint8_t getCRFlag();
927 
929  uint8_t getInstance();
930 
931  // implement abstract methods
932 
933  size_t getValueOffset() const override
934  {
935  return sizeof(uint8_t);
936  }
937 
938  size_t getTotalSize() const override;
939 
940  size_t getDataSize() const override;
941  };
942 
947  {
948  public:
955  GtpV2InformationElementBuilder(GtpV2InformationElement::Type infoElementType, const std::bitset<4>& crFlag,
956  const std::bitset<4>& instance, const std::vector<uint8_t>& infoElementValue);
957 
961 
962  private:
963  std::bitset<4> m_CRFlag;
964  std::bitset<4> m_Instance;
965  };
966 
969  class GtpV2Layer : public Layer
970  {
971  public:
972  ~GtpV2Layer() override = default;
973 
979  GtpV2Layer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
980  : Layer(data, dataLen, prevLayer, packet, GTPv2)
981  {}
982 
990  GtpV2Layer(GtpV2MessageType messageType, uint32_t sequenceNumber, bool setTeid = false, uint32_t teid = 0,
991  bool setMessagePriority = false, std::bitset<4> messagePriority = 0);
992 
996  static bool isGTPv2Port(uint16_t port)
997  {
998  return port == 2123;
999  }
1000 
1005  static bool isDataValid(const uint8_t* data, size_t dataSize);
1006 
1009 
1013 
1017  uint16_t getMessageLength() const;
1018 
1021  bool isPiggybacking() const;
1022 
1026  std::pair<bool, uint32_t> getTeid() const;
1027 
1030  void setTeid(uint32_t teid);
1031 
1033  void unsetTeid();
1034 
1036  uint32_t getSequenceNumber() const;
1037 
1040  void setSequenceNumber(uint32_t sequenceNumber);
1041 
1045  std::pair<bool, uint8_t> getMessagePriority() const;
1046 
1049  void setMessagePriority(const std::bitset<4>& messagePriority);
1050 
1053 
1057 
1064 
1070 
1073 
1080 
1088  GtpV2InformationElement::Type infoElementType);
1089 
1094 
1098 
1099  // implement abstract methods
1100 
1102  void parseNextLayer() override;
1103 
1105  size_t getHeaderLen() const override;
1106 
1108  void computeCalculateFields() override;
1109 
1110  std::string toString() const override;
1111 
1113  {
1114  return OsiModelTransportLayer;
1115  }
1116 
1117  private:
1118 #pragma pack(push, 1)
1119  struct gtpv2_basic_header
1120  {
1121 #if (BYTE_ORDER == LITTLE_ENDIAN)
1122  uint8_t unused : 2, messagePriorityPresent : 1, teidPresent : 1, piggybacking : 1, version : 3;
1123 #else
1124  uint8_t version : 3, piggybacking : 1, teidPresent : 1, messagePriorityPresent : 1, unused : 2;
1125 #endif
1126  uint8_t messageType;
1127  uint16_t messageLength;
1128  };
1129 #pragma pack(pop)
1130 
1131  TLVRecordReader<GtpV2InformationElement> m_IEReader;
1132 
1133  gtpv2_basic_header* getHeader() const
1134  {
1135  return reinterpret_cast<gtpv2_basic_header*>(m_Data);
1136  }
1137 
1138  uint8_t* getIEBasePtr() const;
1139 
1140  GtpV2InformationElement addInformationElementAt(const GtpV2InformationElementBuilder& infoElementBuilder,
1141  int offset);
1142  };
1143 } // namespace pcpp
Definition: GtpLayer.h:227
uint8_t getNextExtensionHeaderType() const
GtpExtension & operator=(const GtpExtension &other)
uint8_t getExtensionType() const
GtpExtension(const GtpExtension &other)
GtpExtension()
An empty c'tor that creates an empty object, meaning one that isNull() returns "true")
uint8_t * getContent() const
GtpExtension getNextExtension() const
Definition: GtpLayer.h:209
bool setSequenceNumber(uint16_t seqNumber)
bool isGTPCMessage() const
std::string toString() const override
bool getSequenceNumber(uint16_t &seqNumber) const
bool isGTPUMessage() const
GtpV1Layer(GtpV1MessageType messageType, uint32_t teid)
void computeCalculateFields() override
bool setNpduNumber(uint8_t npduNum)
OsiModelLayer getOsiModelLayer() const override
Definition: GtpLayer.h:408
GtpV1MessageType getMessageType() const
GtpExtension addExtension(uint8_t extensionType, uint16_t extensionContent)
GtpV1Layer(GtpV1MessageType messageType, uint32_t teid, bool setSeqNum, uint16_t seqNum, bool setNpduNum, uint8_t npduNum)
GtpExtension getNextExtension() const
void parseNextLayer() override
Identifies the following next layers for GTP-U packets: IPv4Layer, IPv6Layer. Otherwise sets PayloadL...
gtpv1_header * getHeader() const
Definition: GtpLayer.h:321
bool getNextExtensionHeaderType(uint8_t &nextExtType) const
static bool isGTPv1Port(uint16_t port)
Definition: GtpLayer.h:386
static bool isGTPv1(const uint8_t *data, size_t dataSize)
GtpV1Layer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GtpLayer.h:290
std::string getMessageTypeAsString() const
size_t getHeaderLen() const override
bool getNpduNumber(uint8_t &npduNum) const
Definition: GtpLayer.h:947
GtpV2InformationElement build() const
GtpV2InformationElementBuilder(GtpV2InformationElement::Type infoElementType, const std::bitset< 4 > &crFlag, const std::bitset< 4 > &instance, const std::vector< uint8_t > &infoElementValue)
Definition: GtpLayer.h:624
GtpV2InformationElement::Type getIEType()
GtpV2InformationElement(uint8_t *infoElementRawData)
Definition: GtpLayer.h:917
Type
GTPv2 Information Element (IE) types as defined in 3GPP TS 29.274.
Definition: GtpLayer.h:628
@ UpFunctionSelectionIndicationFlags
UP Function Selection Indication Flags.
@ PresenceReportingAreaAction
Presence Reporting Area Action.
@ PresenceReportingAreaInformation
Presence Reporting Area Information.
@ Pc5QosParameters
PC5 QoS Parameters.
@ CompleteRequestMessage
Complete Request Message.
@ CnOperatorSelectionEntity
CN Operator Selection Entity.
@ RatType
Radio Access Technology Type.
@ ServiceIndicator
Service Indicator.
@ SgiPtpTunnelAddress
SGi PtP Tunnel Address.
@ ExtendedTraceInformation
Extended Trace Information.
@ Indication
Indication flags for various features and capabilities.
@ Fqdn
Fully Qualified Domain Name.
@ TraceInformation
Trace Information.
@ CiotOptimizationsSupportIndication
CIoT Optimizations Support Indication.
@ MillisecondTimeStamp
Millisecond Time Stamp.
@ FlowQos
Flow Level Quality of Service.
@ Paa
PDN Address Allocation.
@ TwanIdentifierTimestamp
TWAN Identifier Timestamp.
@ MmContext6
MM Context (UMTS Key, Quadruplets and Quintuplets)
@ ApnRateControlStatus
APN Rate Control Status.
@ MaximumPacketLossRate
Maximum Packet Loss Rate.
@ WlanOffloadabilityIndication
WLAN Offloadability Indication.
@ AbsoluteTimeOfMbmsDataTransfer
Absolute Time of MBMS Data Transfer.
@ SignallingPriorityIndication
Signalling Priority Indication.
@ Pco
Protocol Configuration Options.
@ Ipv4ConfigurationParameters
IPv4 Configuration Parameters.
@ Tmgi
Temporary Mobile Group Identity.
@ MbmsDistributionAcknowledge
MBMS Distribution Acknowledge.
@ AdditionalMmContextForSrvcc
Additional MM Context For SRVCC.
@ Cause
Indicates the result of a procedure.
@ ActionIndication
Action Indication.
@ MmContext2
MM Context (UMTS Key, Used Cipher and Quintuplets)
@ Ti
Transaction Identifier.
@ Tmsi
Temporary Mobile Subscriber Identity.
@ MappedUeUsageType
Mapped UE Usage Type.
@ MbmsTimeToDataTransfer
MBMS Time To Data Transfer.
@ AdditionalRrmPolicyIndex
Additional RRM Policy Index.
@ MbmsIpMulticastDistribution
MBMS IP Multicast Distribution.
@ Ldn
Local Distinguished Name.
@ StnSr
Session Transfer Number for SRVCC.
@ ChargingCharacteristics
Charging Characteristics.
@ Guti
Globally Unique Temporary Identity.
@ S103PdnDataForwardingInfo
S103 PDN Data Forwarding Info.
@ ScefPdnConnection
SCEF PDN Connection.
@ DelayValue
Delay Value in integer multiples of 50 milliseconds.
@ ChangeReportingAction
Change Reporting Action.
@ MmContext1
MM Context (GSM Key and Triplets)
@ SourceRncPdcpContextInfo
Source RNC PDCP Context Info.
@ Arp
Allocation Retention Priority.
@ MbmsSessionDuration
MBMS Session Duration.
@ FqCsid
Fully Qualified PDN Connection Set Identifier.
@ BearerTft
Bearer Traffic Flow Template.
@ PdnType
PDN Type (IPv4, IPv6, IPv4v6)
@ ServingNetwork
Current PLMN and MME identifier.
@ ServingPlmnRateControl
Serving PLMN Rate Control.
@ RemoteUeIpInformation
Remote UE IP Information.
@ AdditionalFlagsForSrvcc
Additional Flags For SRVCC.
@ Tad
Traffic Aggregation Description.
@ Unknown
Unknown or reserved value.
@ ChangeToReportFlags
Change To Report Flags.
@ OverloadControlInformation
Overload Control Information.
@ ChargingId
Charging ID for this PDP context.
@ Uli
User Location Information.
@ RemoteUeContext
Remote UE Context.
@ HenbInformationReporting
H(e)NB Information Reporting.
@ CsgInformationReportingAction
CSG Information Reporting Action.
@ BearerQos
Bearer Level Quality of Service.
@ HeaderCompressionConfiguration
Header Compression Configuration.
@ ApnAndRelativeCapacity
APN and Relative Capacity.
@ Cmi
CSG Membership Indication.
@ Pti
Procedure Transaction ID.
@ FTeid
Fully Qualified TEID.
@ MmContext3
MM Context (GSM Key, Used Cipher and Quintuplets)
@ Imsi
International Mobile Subscriber Identity.
@ PagingAndServiceInformation
Paging and Service Information.
@ MonitoringEventExtensionInformation
Monitoring Event Extension Information.
@ MbmsServiceArea
MBMS Service Area.
@ SourceIdentification
Source Identification.
@ RfspIndex
RF Selection Priority Index.
@ ExtendedPco
Extended Protocol Configuration Options.
@ MdtConfiguration
MDT Configuration.
@ GlobalCnId
Global Core Network ID.
@ MmContext4
MM Context (UMTS Key and Quintuplets)
@ S1UDataForwardingInfo
S1-U Data Forwarding Info.
@ ServicesAuthorized
Services Authorized.
@ Twmi
Trusted WLAN Mode Indication.
@ Recovery
Recovery counter for GTP path management.
@ Apco
Additional Protocol Configuration Options.
@ LoadControlInformation
Load Control Information.
@ MbmsFlowIdentifier
MBMS Flow Identifier.
@ SecondaryRatUsageDataReport
Secondary RAT Usage Data Report.
@ Msisdn
Mobile Station International Subscriber Directory Number.
@ MmContext5
MM Context (EPS Security Context, Quadruplets and Quintuplets)
@ Mei
Mobile Equipment Identity (IMEI or IMEISV)
@ TargetIdentification
Target Identification.
@ MonitoringEventInformation
Monitoring Event Information.
@ MbmsSessionIdentifier
MBMS Session Identifier.
@ Ambr
Aggregate Maximum Bit Rate.
size_t getDataSize() const override
size_t getTotalSize() const override
Definition: GtpLayer.h:970
OsiModelLayer getOsiModelLayer() const override
Definition: GtpLayer.h:1112
void setSequenceNumber(uint32_t sequenceNumber)
uint16_t getMessageLength() const
void unsetMessagePriority()
Unset Message Priority if exists in the layer (otherwise does nothing)
GtpV2Layer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: GtpLayer.h:979
static bool isDataValid(const uint8_t *data, size_t dataSize)
void setMessageType(const GtpV2MessageType &type)
void setTeid(uint32_t teid)
GtpV2InformationElement getFirstInformationElement() const
std::string toString() const override
GtpV2InformationElement addInformationElementAfter(const GtpV2InformationElementBuilder &infoElementBuilder, GtpV2InformationElement::Type infoElementType)
void parseNextLayer() override
Identifies if the next layer is GTPv2 piggyback. Otherwise sets PayloadLayer.
size_t getHeaderLen() const override
size_t getInformationElementCount() const
void unsetTeid()
Unset Tunnel Endpoint Identifier (TEID) if exists in the layer (otherwise does nothing)
std::pair< bool, uint8_t > getMessagePriority() const
void computeCalculateFields() override
Computes the piggybacking flag by checking if the next layer is also a GTPv2 message.
GtpV2MessageType getMessageType() const
bool isPiggybacking() const
GtpV2InformationElement getInformationElement(GtpV2InformationElement::Type infoElementType) const
uint32_t getSequenceNumber() const
static bool isGTPv2Port(uint16_t port)
Definition: GtpLayer.h:996
bool removeAllInformationElements()
GtpV2Layer(GtpV2MessageType messageType, uint32_t sequenceNumber, bool setTeid=false, uint32_t teid=0, bool setMessagePriority=false, std::bitset< 4 > messagePriority=0)
GtpV2InformationElement getNextInformationElement(GtpV2InformationElement infoElement) const
bool removeInformationElement(GtpV2InformationElement::Type infoElementType)
std::pair< bool, uint32_t > getTeid() const
void setMessagePriority(const std::bitset< 4 > &messagePriority)
GtpV2InformationElement addInformationElement(const GtpV2InformationElementBuilder &infoElementBuilder)
Definition: GtpLayer.h:417
Value
Define enum types and the corresponding int values.
Definition: GtpLayer.h:421
@ EchoResponse
Echo Response message.
Definition: GtpLayer.h:427
@ CreateForwardingRequest
Create Forwarding Request message.
Definition: GtpLayer.h:537
@ DeleteBearerFailure
Delete Bearer Failure message.
Definition: GtpLayer.h:457
@ MMBSSessionUpdateRequest
MMBS Session Update Request message.
Definition: GtpLayer.h:581
@ ContextAcknowledge
Context Acknowledge message.
Definition: GtpLayer.h:499
@ PGWDownlinkNotification
PGW Downlink Notification message.
Definition: GtpLayer.h:487
@ SuspendAcknowledge
Suspend Acknowledge message.
Definition: GtpLayer.h:543
@ RemoteUEReportAcknowledge
Remote UE Report Acknowledge message.
Definition: GtpLayer.h:449
@ CreateBearerRequest
Create Bearer Request message.
Definition: GtpLayer.h:471
@ MMBSSessionStartRequest
MMBS Session Start Request message.
Definition: GtpLayer.h:577
@ CreateIndirectDataTunnelRequest
Create Indirect Data Tunnel Request message.
Definition: GtpLayer.h:549
@ ForwardRelocationRequest
Forward Relocation Request message.
Definition: GtpLayer.h:501
@ CreateForwardingResponse
Create Forwarding Response message.
Definition: GtpLayer.h:539
@ DownlinkDataNotification
Downlink Data Notification message.
Definition: GtpLayer.h:561
@ CreateSessionResponse
Create Session Response message.
Definition: GtpLayer.h:433
@ UpdatePDNConnectionRequest
Update PDN Connection Request message.
Definition: GtpLayer.h:569
@ UpdateBearerRequest
Update Bearer Request message.
Definition: GtpLayer.h:475
@ DeleteBearerResponse
Delete Bearer Response message.
Definition: GtpLayer.h:481
@ DeleteBearerCommand
Delete Bearer Command message.
Definition: GtpLayer.h:455
@ ForwardAccessNotification
Forward Access Notification message.
Definition: GtpLayer.h:509
@ PGWRestartNotification
PGW Restart Notification message.
Definition: GtpLayer.h:565
@ PGWDownlinkAcknowledge
PGW Downlink Acknowledge message.
Definition: GtpLayer.h:489
@ IdentificationRequest
Identification Request message.
Definition: GtpLayer.h:491
@ DetachNotification
Detach Notification message.
Definition: GtpLayer.h:519
@ ChangeNotificationRequest
Change Notification Request message.
Definition: GtpLayer.h:443
@ DeleteSessionResponse
Delete Session Response message.
Definition: GtpLayer.h:441
@ TraceSessionActivation
Trace Session Activation message.
Definition: GtpLayer.h:465
@ ModifyAccessBearersResponse
Modify Access Bearers Response message.
Definition: GtpLayer.h:575
@ ReleaseAccessBearersResponse
Release Access Bearers Response message.
Definition: GtpLayer.h:559
@ BearerResourceCommand
Bearer Resource Command message.
Definition: GtpLayer.h:459
@ ContextRequest
Context Request message.
Definition: GtpLayer.h:495
@ BearerResourceFailure
Bearer Resource Failure message.
Definition: GtpLayer.h:461
@ Unknown
Unknown message.
Definition: GtpLayer.h:423
@ UpdatePDNConnectionResponse
Update PDN Connection Response message.
Definition: GtpLayer.h:571
@ RANInformationRelay
RAN Information Relay message.
Definition: GtpLayer.h:525
@ ReleaseAccessBearersRequest
Release Access Bearers Request message.
Definition: GtpLayer.h:557
@ IdentificationResponse
Identification Response message.
Definition: GtpLayer.h:493
@ RemoteUEReportNotifications
Remote UE Report Notifications message.
Definition: GtpLayer.h:447
@ TraceSessionDeactivation
Trace Session Deactivation message.
Definition: GtpLayer.h:467
@ DeleteIndirectDataTunnelRequest
Delete Indirect Data Tunnel Request message.
Definition: GtpLayer.h:553
@ RelocationCancelRequest
Relocation Cancel Request message.
Definition: GtpLayer.h:513
@ DownlinkDataAcknowledge
Downlink Data Acknowledge message.
Definition: GtpLayer.h:563
@ ModifyBearerFailure
Modify Bearer Failure message.
Definition: GtpLayer.h:453
@ DeletePDNRequest
Delete PDN Request message.
Definition: GtpLayer.h:483
@ VersionNotSupported
Version Not Supported message.
Definition: GtpLayer.h:429
@ ForwardRelocationNotification
Forward Relocation Notification message.
Definition: GtpLayer.h:505
@ CreateBearerResponse
Create Bearer Response message.
Definition: GtpLayer.h:473
@ StopPagingIndication
Stop Paging Indication message.
Definition: GtpLayer.h:469
@ DeleteSessionRequest
Delete Session Request message.
Definition: GtpLayer.h:439
@ SuspendNotification
Suspend Notification message.
Definition: GtpLayer.h:541
@ ForwardRelocationResponse
Forward Relocation Response message.
Definition: GtpLayer.h:503
@ DeletePDNResponse
Delete PDN Response message.
Definition: GtpLayer.h:485
@ ModifyBearerResponse
Modify Bearer Response message.
Definition: GtpLayer.h:437
@ RelocationCancelResponse
Relocation Cancel Response message.
Definition: GtpLayer.h:515
@ MMBSSessionStopResponse
MMBS Session Stop Response message.
Definition: GtpLayer.h:587
@ PGWRestartAcknowledge
PGW Restart Acknowledge message.
Definition: GtpLayer.h:567
@ ContextResponse
Context Response message.
Definition: GtpLayer.h:497
@ MMBSSessionStartResponse
MMBS Session Start Response message.
Definition: GtpLayer.h:579
@ ResumeAcknowledge
Resume Acknowledge message.
Definition: GtpLayer.h:547
@ ModifyBearerRequest
Modify Bearer Request message.
Definition: GtpLayer.h:435
@ AlertMMENotification
Alert MME Notification message.
Definition: GtpLayer.h:527
@ ModifyAccessBearersRequest
Modify Access Bearers Request message.
Definition: GtpLayer.h:573
@ MMBSSessionStopRequest
MMBS Session Stop Request message.
Definition: GtpLayer.h:585
@ ForwardRelocationAcknowledge
Forward Relocation Acknowledge message.
Definition: GtpLayer.h:507
@ EchoRequest
Echo Request message.
Definition: GtpLayer.h:425
@ MMBSSessionUpdateResponse
MMBS Session Update Response message.
Definition: GtpLayer.h:583
@ UEActivityAcknowledge
UE Activity Acknowledge message.
Definition: GtpLayer.h:533
@ ConfigurationTransferTunnel
Configuration Transfer Tunnel message.
Definition: GtpLayer.h:517
@ DetachAcknowledge
Detach Acknowledge message.
Definition: GtpLayer.h:521
@ ChangeNotificationResponse
Change Notification Response message.
Definition: GtpLayer.h:445
@ UEActivityNotification
UE Activity Notification message.
Definition: GtpLayer.h:531
@ DownlinkDataNotificationFailure
Downlink Data Notification Failure message.
Definition: GtpLayer.h:463
@ ModifyBearerCommand
Modify Bearer Command message.
Definition: GtpLayer.h:451
@ CreateIndirectDataTunnelResponse
Create Indirect Data Tunnel Response message.
Definition: GtpLayer.h:551
@ ISRStatus
ISR Status message.
Definition: GtpLayer.h:535
@ UpdateBearerResponse
Update Bearer Response message.
Definition: GtpLayer.h:477
@ ResumeNotification
Resume Notification message.
Definition: GtpLayer.h:545
@ CSPaging
CS Paging message.
Definition: GtpLayer.h:523
@ DeleteBearerRequest
Delete Bearer Request message.
Definition: GtpLayer.h:479
@ ForwardAccessAcknowledge
Forward Access Acknowledge message.
Definition: GtpLayer.h:511
@ DeleteIndirectDataTunnelResponse
Delete Indirect Data Tunnel Response message.
Definition: GtpLayer.h:555
@ CreateSessionRequest
Create Session Request message.
Definition: GtpLayer.h:431
@ AlertMMEAcknowledge
Alert MME Acknowledge message.
Definition: GtpLayer.h:529
std::string toString() const
constexpr GtpV2MessageType(Value value)
Definition: GtpLayer.h:595
static GtpV2MessageType fromUintValue(uint8_t value)
Definition: Layer.h:60
Definition: Packet.h:22
Definition: TLVData.h:357
Definition: TLVData.h:19
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:225
@ OsiModelTransportLayer
Transport layer (layer 4)
Definition: ProtocolType.h:233
const ProtocolType GTPv1
GTPv1 protocol.
Definition: ProtocolType.h:134
const ProtocolType GTPv2
GTPv2 protocol.
Definition: ProtocolType.h:218
GtpV1MessageType
Definition: GtpLayer.h:65
@ GtpV1_MessageTypeUnknown
GTPv1 Message Type Unknown.
Definition: GtpLayer.h:67
@ GtpV1_MBMSNotificationResponse
MBMS Notification Response.
Definition: GtpLayer.h:155
@ GtpV1_DeletePDPContextResponse
Delete PDP Context Response.
Definition: GtpLayer.h:91
@ GtpV1_InitiatePDPContextActivationResponse
Initiate PDP Context Activation Response.
Definition: GtpLayer.h:95
@ GtpV1_RANInformationRelay
RAN Information Relay.
Definition: GtpLayer.h:151
@ GtpV1_MBMSSessionStopRequest
MBMS Session Stop Request.
Definition: GtpLayer.h:185
@ GtpV1_MBMSSessionUpdateRequest
MBMS Session Update Request.
Definition: GtpLayer.h:189
@ GtpV1_SupportedExtensionsHeaderNotification
Supported Extensions Header Notification.
Definition: GtpLayer.h:107
@ GtpV1_PDUNotificationRejectRequest
PDU Notification Reject Request.
Definition: GtpLayer.h:103
@ GtpV1_GPDU
G-PDU.
Definition: GtpLayer.h:203
@ GtpV1_MBMSSessionUpdateResponse
MBMS Session Update Response.
Definition: GtpLayer.h:191
@ GtpV1_DeletePDPContextRequest
Delete PDP Context Request.
Definition: GtpLayer.h:89
@ GtpV1_InitiatePDPContextActivationRequest
Initiate PDP Context Activation Request.
Definition: GtpLayer.h:93
@ GtpV1_PDUNotificationRequest
PDU Notification Request.
Definition: GtpLayer.h:99
@ GtpV1_EchoRequest
Echo Request.
Definition: GtpLayer.h:69
@ GtpV1_ForwardRelocationComplete
Forward Relocation Complete.
Definition: GtpLayer.h:135
@ GtpV1_MBMSRegistrationRequest
MBMS Registration Request.
Definition: GtpLayer.h:173
@ GtpV1_MBMSNotificationRejectRequest
MBMS Notification Reject Request.
Definition: GtpLayer.h:157
@ GtpV1_SGSNContextAcknowledge
SGSN Context Acknowledge.
Definition: GtpLayer.h:129
@ GtpV1_MBMSSessionStartRequest
MBMS Session Start Request.
Definition: GtpLayer.h:181
@ GtpV1_DeleteMBMSNotificationRequest
Delete MBMS Notification Request.
Definition: GtpLayer.h:169
@ GtpV1_ForwardRelocationResponse
Forward Relocation Response.
Definition: GtpLayer.h:133
@ GtpV1_NodeAliveResponse
Node Alive Response.
Definition: GtpLayer.h:77
@ GtpV1_UERegistrationRequest
UE Registration Request.
Definition: GtpLayer.h:147
@ GtpV1_ForwardSRNSContextAcknowledge
Forward SRNS Context Acknowledge.
Definition: GtpLayer.h:145
@ GtpV1_MBMSNotificationRejectResponse
MBMS Notification Reject Response.
Definition: GtpLayer.h:159
@ GtpV1_UERegistrationResponse
UE Registration Response.
Definition: GtpLayer.h:149
@ GtpV1_CreatePDPContextResponse
Create PDP Context Response.
Definition: GtpLayer.h:83
@ GtpV1_FailureReportResponse
Failure Report Response.
Definition: GtpLayer.h:115
@ GtpV1_NoteMSPresentResponse
Note MS Present Response.
Definition: GtpLayer.h:119
@ GtpV1_IdentificationRequest
Identification Request.
Definition: GtpLayer.h:121
@ GtpV1_MBMSDeRegistrationResponse
MBMS De-Registration Response.
Definition: GtpLayer.h:179
@ GtpV1_MSInfoChangeResponse
MS Info Change Response.
Definition: GtpLayer.h:195
@ GtpV1_ForwardRelocationCompleteAcknowledge
Forward Relocation Complete Acknowledge.
Definition: GtpLayer.h:143
@ GtpV1_UpdatePDPContextRequest
Update PDP Context Request.
Definition: GtpLayer.h:85
@ GtpV1_SendRoutingforGPRSRequest
Send Routing for GPRS Request.
Definition: GtpLayer.h:109
@ GtpV1_PDUNotificationRejectResponse
PDU Notification Reject Response.
Definition: GtpLayer.h:105
@ GtpV1_UpdatePDPContextResponse
Update PDP Context Response.
Definition: GtpLayer.h:87
@ GtpV1_SendRoutingforGPRSResponse
Send Routing for GPRS Response.
Definition: GtpLayer.h:111
@ GtpV1_VersionNotSupported
Version Not Supported.
Definition: GtpLayer.h:73
@ GtpV1_MSInfoChangeRequest
MS Info Change Request.
Definition: GtpLayer.h:193
@ GtpV1_ErrorIndication
Error Indication.
Definition: GtpLayer.h:97
@ GtpV1_UpdateMBMSNotificationResponse
Update MBMS Notification Response.
Definition: GtpLayer.h:167
@ GtpV1_RelocationCancelResponse
Relocation Cancel Response.
Definition: GtpLayer.h:139
@ GtpV1_DataRecordTransferRequest
Data Record Transfer Request.
Definition: GtpLayer.h:197
@ GtpV1_MBMSNotificationRequest
MBMS Notification Request.
Definition: GtpLayer.h:153
@ GtpV1_MBMSSessionStartResponse
MBMS Session Start Response.
Definition: GtpLayer.h:183
@ GtpV1_FailureReportRequest
Failure Report Request.
Definition: GtpLayer.h:113
@ GtpV1_CreateMBMSNotificationResponse
Create MBMS Notification Response.
Definition: GtpLayer.h:163
@ GtpV1_MBMSDeRegistrationRequest
MBMS De-Registration Request.
Definition: GtpLayer.h:177
@ GtpV1_CreateMBMSNotificationRequest
Create MBMS Notification Request.
Definition: GtpLayer.h:161
@ GtpV1_DataRecordTransferResponse
Data Record Transfer Response.
Definition: GtpLayer.h:199
@ GtpV1_MBMSSessionStopResponse
MBMS Session Stop Response.
Definition: GtpLayer.h:187
@ GtpV1_UpdateMBMSNotificationRequest
Update MBMS Notification Request.
Definition: GtpLayer.h:165
@ GtpV1_SGSNContextRequest
SGSN Context Request.
Definition: GtpLayer.h:125
@ GtpV1_RedirectionRequest
Redirection Request.
Definition: GtpLayer.h:79
@ GtpV1_EndMarker
End Marker.
Definition: GtpLayer.h:201
@ GtpV1_IdentificationResponse
Identification Response.
Definition: GtpLayer.h:123
@ GtpV1_EchoResponse
Echo Response.
Definition: GtpLayer.h:71
@ GtpV1_RelocationCancelRequest
Relocation Cancel Request.
Definition: GtpLayer.h:137
@ GtpV1_NodeAliveRequest
Node Alive Request.
Definition: GtpLayer.h:75
@ GtpV1_SGSNContextResponse
SGSN Context Response.
Definition: GtpLayer.h:127
@ GtpV1_ForwardRelocationRequest
Forward Relocation Request.
Definition: GtpLayer.h:131
@ GtpV1_NoteMSPresentRequest
Note MS Present Request.
Definition: GtpLayer.h:117
@ GtpV1_MBMSRegistrationResponse
MBMS Registration Response.
Definition: GtpLayer.h:175
@ GtpV1_DeleteMBMSNotificationResponse
Delete MBMS Notification Response.
Definition: GtpLayer.h:171
@ GtpV1_CreatePDPContextRequest
Create PDP Context Request.
Definition: GtpLayer.h:81
@ GtpV1_ForwardSRNSContext
Forward SRNS Context.
Definition: GtpLayer.h:141
@ GtpV1_PDUNotificationResponse
PDU Notification Response.
Definition: GtpLayer.h:101
Definition: GtpLayer.h:19
uint8_t version
GTP version.
Definition: GtpLayer.h:32
uint8_t messageType
An 8-bit field that indicates the type of GTP message.
Definition: GtpLayer.h:48
uint16_t messageLength
Definition: GtpLayer.h:52
uint8_t reserved
Reserved bit.
Definition: GtpLayer.h:28
uint8_t npduNumberFlag
A 1-bit value that states whether there is a N-PDU number optional field.
Definition: GtpLayer.h:22
uint32_t teid
Definition: GtpLayer.h:56
uint8_t sequenceNumberFlag
A 1-bit value that states whether there is a Sequence Number optional field.
Definition: GtpLayer.h:24
uint8_t extensionHeaderFlag
A 1-bit value that states whether there is an extension header optional field.
Definition: GtpLayer.h:26
uint8_t protocolType
A 1-bit value that differentiates GTP (value 1) from GTP' (value 0)
Definition: GtpLayer.h:30