PcapPlusPlus
24.09
|
#include <PPPoELayer.h>
Classes | |
class | PPPoETag |
class | PPPoETagBuilder |
Public Types | |
enum | PPPoETagTypes { PPPOE_TAG_EOL = 0x0000 , PPPOE_TAG_SVC_NAME = 0x0101 , PPPOE_TAG_AC_NAME = 0x0102 , PPPOE_TAG_HOST_UNIQ = 0x0103 , PPPOE_TAG_AC_COOKIE = 0x0104 , PPPOE_TAG_VENDOR = 0x0105 , PPPOE_TAG_CREDITS = 0x0106 , PPPOE_TAG_METRICS = 0x0107 , PPPOE_TAG_SEQ_NUM = 0x0108 , PPPOE_TAG_CRED_SCALE = 0x0109 , PPPOE_TAG_RELAY_ID = 0x0110 , PPPOE_TAG_HURL = 0x0111 , PPPOE_TAG_MOTM = 0x0112 , PPPOE_TAG_MAX_PAYLD = 0x0120 , PPPOE_TAG_IP_RT_ADD = 0x0121 , PPPOE_TAG_SVC_ERR = 0x0201 , PPPOE_TAG_AC_ERR = 0x0202 , PPPOE_TAG_GENERIC_ERR = 0x0203 } |
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 } |
Public Member Functions | |
PPPoEDiscoveryLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
PPPoEDiscoveryLayer (uint8_t version, uint8_t type, PPPoELayer::PPPoECode code, uint16_t sessionId) | |
PPPoETag | getTag (PPPoEDiscoveryLayer::PPPoETagTypes tagType) const |
PPPoETag | getFirstTag () const |
PPPoETag | getNextTag (const PPPoETag &tag) const |
int | getTagCount () const |
PPPoETag | addTag (const PPPoETagBuilder &tagBuilder) |
PPPoETag | addTagAfter (const PPPoETagBuilder &tagBuilder, PPPoETagTypes prevTagType) |
bool | removeTag (PPPoEDiscoveryLayer::PPPoETagTypes tagType) |
bool | removeAllTags () |
virtual void | parseNextLayer () |
virtual size_t | getHeaderLen () const |
virtual std::string | toString () const |
Public Member Functions inherited from pcpp::PPPoELayer | |
pppoe_header * | getPPPoEHeader () const |
virtual void | computeCalculateFields () |
OsiModelLayer | getOsiModelLayer () const |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () 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 |
Static Public Member Functions | |
static bool | isDataValid (const uint8_t *data, size_t dataLen) |
Describes the PPPoE discovery protocol
PPPoE tag types
|
inline |
A constructor that creates the layer from an existing packet raw data
[in] | data | A pointer to the raw data (will be casted to pppoe_header) |
[in] | dataLen | Size of the data in bytes |
[in] | prevLayer | A pointer to the previous layer |
[in] | packet | A pointer to the Packet instance where layer will be stored in |
|
inline |
A constructor that allocates a new PPPoE Discovery header with version, type, PPPoE code and session ID
[in] | version | PPPoE version |
[in] | type | PPPoE type |
[in] | code | PPPoE code enum |
[in] | sessionId | PPPoE session ID |
PPPoETag pcpp::PPPoEDiscoveryLayer::addTag | ( | const PPPoETagBuilder & | tagBuilder | ) |
Add a new PPPoE Tag at the end of the layer
[in] | tagBuilder | A PPPoETagBuilder object that contains the requested tag data to add |
PPPoETag pcpp::PPPoEDiscoveryLayer::addTagAfter | ( | const PPPoETagBuilder & | tagBuilder, |
PPPoETagTypes | prevTagType | ||
) |
Add a new PPPoE Tag after an existing one
[in] | tagBuilder | A PPPoETagBuilder object that contains the requested tag data to add |
[in] | prevTagType | The PPPoE Tag which the newly added tag will come after |
PPPoETag pcpp::PPPoEDiscoveryLayer::getFirstTag | ( | ) | const |
|
virtual |
Implements pcpp::Layer.
Get the tag that comes right after the "tag" parameter. If the given tag is the last one, the returned value will contain a logical null (PPPoETag::isNull() == true)
[in] | tag | A given tag |
PPPoETag pcpp::PPPoEDiscoveryLayer::getTag | ( | PPPoEDiscoveryLayer::PPPoETagTypes | tagType | ) | const |
Get a PPPoE Tag by tag type.
[in] | tagType | The type of the tag to search |
int pcpp::PPPoEDiscoveryLayer::getTagCount | ( | ) | const |
|
inlinestatic |
A static method that validates the input data
[in] | data | The pointer to the beginning of byte stream of a packet |
[in] | dataLen | The length of the byte stream |
|
inlinevirtual |
Does nothing for this layer (PPPoE discovery is always the last layer)
Implements pcpp::Layer.
bool pcpp::PPPoEDiscoveryLayer::removeAllTags | ( | ) |
Remove all tags in this layer
bool pcpp::PPPoEDiscoveryLayer::removeTag | ( | PPPoEDiscoveryLayer::PPPoETagTypes | tagType | ) |
Remove an existing tag. Tag will be found by the tag type
[in] | tagType | The tag type to remove |
|
inlinevirtual |
Implements pcpp::Layer.