PcapPlusPlus
pcpp::PPP_PPTPLayer Class Reference

#include <GreLayer.h>

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

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 ()
 
void parseNextLayer ()
 
size_t getHeaderLen ()
 
void computeCalculateFields ()
 
std::string toString ()
 
OsiModelLayer getOsiModelLayer ()
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
LayergetNextLayer ()
 
LayergetPrevLayer ()
 
ProtocolType getProtocol ()
 
uint8_t * getData ()
 
size_t getDataLen ()
 
uint8_t * getLayerPayload ()
 
size_t getLayerPayloadSize ()
 
bool isAllocatedToPacket ()
 
void copyData (uint8_t *toArr)
 

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

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
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

void pcpp::PPP_PPTPLayer::computeCalculateFields ( )
virtual

Calculate the following fields:

Implements pcpp::Layer.

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

Implements pcpp::Layer.

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

Implements pcpp::Layer.

ppp_pptp_header* pcpp::PPP_PPTPLayer::getPPP_PPTPHeader ( )
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
void pcpp::PPP_PPTPLayer::parseNextLayer ( )
virtual

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

Implements pcpp::Layer.

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

Implements pcpp::Layer.