PcapPlusPlus
pcpp::PPPoELayer Class Reference

#include <PPPoELayer.h>

Inheritance diagram for pcpp::PPPoELayer:
pcpp::Layer pcpp::IDataContainer pcpp::PPPoEDiscoveryLayer pcpp::PPPoESessionLayer

Public Types

enum  PPPoECode {
  PPPOE_CODE_SESSION = 0x00, PPPOE_CODE_PADO = 0x07, PPPOE_CODE_PADI = 0x09, PPPOE_CODE_PADG = 0x0a,
  PPPOE_CODE_PADC = 0x0b, PPPOE_CODE_PADQ = 0x0c, PPPOE_CODE_PADR = 0x19, PPPOE_CODE_PADS = 0x65,
  PPPOE_CODE_PADT = 0xa7, PPPOE_CODE_PADM = 0xd3, PPPOE_CODE_PADN = 0xd4
}
 

Public Member Functions

pppoe_headergetPPPoEHeader ()
 
virtual void computeCalculateFields ()
 
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)
 
uint8_t * getDataPtr (size_t offset=0)
 
virtual void parseNextLayer ()=0
 
virtual size_t getHeaderLen ()=0
 
virtual std::string toString ()=0
 

Detailed Description

An abstract class that describes the PPPoE protocol. Contains common data and logic of the two types of PPPoE packets: PPPoE session and PPPoE discovery

Member Enumeration Documentation

◆ PPPoECode

PPPoE possible codes

Enumerator
PPPOE_CODE_SESSION 

PPPoE session code

PPPOE_CODE_PADO 

PPPoE discovery PADO

PPPOE_CODE_PADI 

PPPoE discovery PADI

PPPOE_CODE_PADG 

PPPoE discovery PADG

PPPOE_CODE_PADC 

PPPoE discovery PADC

PPPOE_CODE_PADQ 

PPPoE discovery PADQ

PPPOE_CODE_PADR 

PPPoE discovery PADR

PPPOE_CODE_PADS 

PPPoE discovery PADS

PPPOE_CODE_PADT 

PPPoE discovery PADT

PPPOE_CODE_PADM 

PPPoE discovery PADM

PPPOE_CODE_PADN 

PPPoE discovery PADN

Member Function Documentation

◆ computeCalculateFields()

virtual void pcpp::PPPoELayer::computeCalculateFields ( )
virtual

Calculate pppoe_header::payloadLength field

Implements pcpp::Layer.

◆ getOsiModelLayer()

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

Implements pcpp::Layer.

◆ getPPPoEHeader()

pppoe_header* pcpp::PPPoELayer::getPPPoEHeader ( )
inline

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

Returns
A pointer to the pppoe_header