PcapPlusPlus
pcpp::PPPoESessionLayer Class Reference

#include <PPPoELayer.h>

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

Public Member Functions

 PPPoESessionLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 PPPoESessionLayer (uint8_t version, uint8_t type, uint16_t sessionId, uint16_t pppNextProtocol)
 
uint16_t getPPPNextProtocol ()
 
void setPPPNextProtocol (uint16_t nextProtocol)
 
virtual void parseNextLayer ()
 
virtual size_t getHeaderLen ()
 
virtual std::string toString ()
 
- Public Member Functions inherited from pcpp::PPPoELayer
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)
 

Additional Inherited Members

- Public Types inherited from pcpp::PPPoELayer
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
}
 

Detailed Description

Describes the PPPoE session protocol

Constructor & Destructor Documentation

pcpp::PPPoESessionLayer::PPPoESessionLayer ( 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 pppoe_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::PPPoESessionLayer::PPPoESessionLayer ( uint8_t  version,
uint8_t  type,
uint16_t  sessionId,
uint16_t  pppNextProtocol 
)
inline

A constructor that allocates a new PPPoE Session header with version, type and session ID

Parameters
[in]versionPPPoE version
[in]typePPPoE type
[in]sessionIdPPPoE session ID
[in]pppNextProtocolThe next protocol to come after the PPPoE session header. Should be one of the PPP_* macros listed below

Member Function Documentation

virtual size_t pcpp::PPPoESessionLayer::getHeaderLen ( )
inlinevirtual
Returns
Size of pppoe_header

Implements pcpp::Layer.

uint16_t pcpp::PPPoESessionLayer::getPPPNextProtocol ( )
Returns
The protocol after the PPPoE session header. The return value is one of the PPP_* macros listed below. This method is also used when parsing a packet (this way we know which layer comes after the PPPoE session)
virtual void pcpp::PPPoESessionLayer::parseNextLayer ( )
virtual

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

Implements pcpp::Layer.

void pcpp::PPPoESessionLayer::setPPPNextProtocol ( uint16_t  nextProtocol)

Set the field that describes which header comes after the PPPoE session header

Parameters
[in]nextProtocolThe protocol value. Should be one of the PPP_* macros listed below
virtual std::string pcpp::PPPoESessionLayer::toString ( )
virtual
Returns
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.