PcapPlusPlus  Next
pcpp::GeneveOption Class Reference

#include <GeneveLayer.h>

Public Member Functions

 GeneveOption ()
 Construct a null option view.
 
bool isNull () const
 
uint16_t getOptionClass () const
 
uint8_t getType () const
 
bool isCritical () const
 
size_t getDataSize () const
 
size_t getTotalSize () const
 
uint8_t * getData () const
 
bool operator== (const GeneveOption &other) const
 
bool operator!= (const GeneveOption &other) const
 

Detailed Description

A non-owning view of a GENEVE option. The view is invalidated when its underlying data is destroyed or moved, including when options are added to or removed from the containing GeneveLayer

Member Function Documentation

◆ getData()

uint8_t* pcpp::GeneveOption::getData ( ) const
Returns
A pointer to the option data, or nullptr if this option is null

◆ getDataSize()

size_t pcpp::GeneveOption::getDataSize ( ) const
Returns
Option data length in bytes, or zero if this option is null

◆ getOptionClass()

uint16_t pcpp::GeneveOption::getOptionClass ( ) const
Returns
Option class in host byte order, or zero if this option is null

◆ getTotalSize()

size_t pcpp::GeneveOption::getTotalSize ( ) const
Returns
Total option size including its 4-byte header, or zero if this option is null

◆ getType()

uint8_t pcpp::GeneveOption::getType ( ) const
Returns
The 7-bit option type without the critical bit, or zero if this option is null

◆ isCritical()

bool pcpp::GeneveOption::isCritical ( ) const
Returns
True if the option is critical, or false if this option is null

◆ isNull()

bool pcpp::GeneveOption::isNull ( ) const
inline
Returns
True if this option view does not refer to a complete option

◆ operator!=()

bool pcpp::GeneveOption::operator!= ( const GeneveOption &  other) const
inline
Returns
True if the options are not equal according to operator==

◆ operator==()

bool pcpp::GeneveOption::operator== ( const GeneveOption &  other) const
Returns
True if both options are null or have the same class, type, critical flag, and data