PcapPlusPlus  Next
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 () override
 
size_t getHeaderLen () const override
 
void computeCalculateFields () override
 
std::string toString () const override
 
OsiModelLayer getOsiModelLayer () const override
 
- Public Member Functions inherited from pcpp::Layer
 ~Layer () override
 
LayergetNextLayer () const
 
LayergetPrevLayer () 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
 

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 ( )
overridevirtual

Calculate the following fields:

Implements pcpp::Layer.

◆ getHeaderLen()

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

Implements pcpp::Layer.

◆ getOsiModelLayer()

OsiModelLayer pcpp::PPP_PPTPLayer::getOsiModelLayer ( ) const
inlineoverridevirtual
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 ( )
overridevirtual

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

Implements pcpp::Layer.

◆ toString()

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

Implements pcpp::Layer.