PcapPlusPlus  Next
pcpp::SSLSupportedVersionsExtension Class Reference

#include <SSLHandshake.h>

Inheritance diagram for pcpp::SSLSupportedVersionsExtension:
pcpp::SSLExtension

Public Member Functions

std::vector< SSLVersiongetSupportedVersions () const
 
 SSLExtension (uint8_t *data)
 
 SSLExtension (uint8_t *data, size_t dataLen)
 Constructs an SSLExtension that interprets the provided data as the raw bytes of the extension. More...
 
- Public Member Functions inherited from pcpp::SSLExtension
 SSLExtension (uint8_t *data)
 
 SSLExtension (uint8_t *data, size_t dataLen)
 Constructs an SSLExtension that interprets the provided data as the raw bytes of the extension. More...
 
SSLExtensionType getType () const
 
uint16_t getTypeAsInt () const
 
uint16_t getLength () const
 
uint16_t getTotalLength () const
 
uint8_t * getData () const
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::SSLExtension
template<typename T , typename std::enable_if_t< std::is_base_of< SSLExtension, T >::value, bool > = true>
static std::unique_ptr< T > tryCreateExtension (uint8_t *data, size_t dataLen)
 A static method that tries to create an instance of a specific extension type. More...
 

Detailed Description

Represents TLS Supported Versions extension. Inherits from SSLExtension and adds parsing of the list of supported versions mentioned in the extension data

Member Function Documentation

◆ getSupportedVersions()

std::vector<SSLVersion> pcpp::SSLSupportedVersionsExtension::getSupportedVersions ( ) const
Returns
The list of supported versions mentioned in the extension data

◆ SSLExtension() [1/2]

pcpp::SSLExtension::SSLExtension
explicit

C'tor for this class

Parameters
[in]dataThe raw data for the extension
Deprecated:
This constructor is deprecated because it uses an unbound memory span. Use the constructor with bounded span.

◆ SSLExtension() [2/2]

pcpp::SSLExtension::SSLExtension

Constructs an SSLExtension that interprets the provided data as the raw bytes of the extension.

The memory span defined by data and dataLen can be larger than the actual extension data. If so, only the bytes corresponding to the extension header (type and length fields) + [length] bytes of extension data will be parsed. The rest of the span will be ignored.

The above behaviour allows variable length extensions to be parsed, as SSL extensions are laid out sequentially in memory on a payload.

Parameters
[in]dataThe raw data for the extension.
[in]dataLenThe length of the data in bytes.
Exceptions
std::invalid_argumentif data is nullptr or if dataLen is smaller than the size of the extension header (type and length fields).