PcapPlusPlus  22.11
pcpp::PPP_PPTPLayer Class Reference

#include <GreLayer.h>

Inheritance diagram for pcpp::PPP_PPTPLayer:
pcpp::Layer pcpp::IDataContainer

Public Member Functions

 PPP_PPTPLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 PPP_PPTPLayer (uint8_t address, uint8_t control)
 
ppp_pptp_headergetPPP_PPTPHeader () const
 
void parseNextLayer ()
 
size_t getHeaderLen () const
 
void computeCalculateFields ()
 
std::string toString () const
 
OsiModelLayer getOsiModelLayer () const
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
LayergetNextLayer () const
 
LayergetPrevLayer () 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
 

Detailed Description

Represent a PPP (point-to-point) protocol header that comes after GREv1 header, as part of PPTP - Point-to-Point Tunneling Protocol

Constructor & Destructor Documentation

◆ PPP_PPTPLayer() [1/2]

pcpp::PPP_PPTPLayer::PPP_PPTPLayer ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)
inline

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data (will be casted to ppp_pptp_header)
[in]dataLenSize of the data in bytes
[in]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in

◆ PPP_PPTPLayer() [2/2]

pcpp::PPP_PPTPLayer::PPP_PPTPLayer ( uint8_t  address,
uint8_t  control 
)

A constructor that allocates a new PPP-PPTP header

Parameters
[in]addressAddress field
[in]controlControl field

Member Function Documentation

◆ computeCalculateFields()

void pcpp::PPP_PPTPLayer::computeCalculateFields ( )
virtual

Calculate the following fields:

Implements pcpp::Layer.

◆ getHeaderLen()

size_t pcpp::PPP_PPTPLayer::getHeaderLen ( ) const
inlinevirtual
Returns
The size of ppp_pptp_header

Implements pcpp::Layer.

◆ getOsiModelLayer()

OsiModelLayer pcpp::PPP_PPTPLayer::getOsiModelLayer ( ) const
inlinevirtual
Returns
The OSI Model layer this protocol belongs to

Implements pcpp::Layer.

◆ getPPP_PPTPHeader()

ppp_pptp_header* pcpp::PPP_PPTPLayer::getPPP_PPTPHeader ( ) const
inline

Get a pointer to the PPP-PPTP header. Notice this points directly to the data, so every change will change the actual packet data

Returns
A pointer to the ppp_pptp_header

◆ parseNextLayer()

void pcpp::PPP_PPTPLayer::parseNextLayer ( )
virtual

Currently identifies the following next layers: IPv4Layer, IPv6Layer. Otherwise sets PayloadLayer

Implements pcpp::Layer.

◆ toString()

std::string pcpp::PPP_PPTPLayer::toString ( ) const
inlinevirtual
Returns
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.