PcapPlusPlus
22.11
|
#include <SSLLayer.h>
Public Member Functions | |
ssl_tls_record_layer * | getRecordLayer () const |
SSLVersion | getRecordVersion () const |
SSLRecordType | getRecordType () const |
size_t | getHeaderLen () const |
void | parseNextLayer () |
OsiModelLayer | getOsiModelLayer () const |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () 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 |
virtual void | computeCalculateFields ()=0 |
virtual std::string | toString () const =0 |
Static Public Member Functions | |
static bool | isSSLPort (uint16_t port) |
static bool | IsSSLMessage (uint16_t srcPort, uint16_t dstPort, uint8_t *data, size_t dataLen, bool ignorePorts=false) |
static SSLLayer * | createSSLMessage (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) |
The base class for the 4 record type classes. Each record type is represented as a layer. See SSLLayer.h for detailed explanation of the TLS/SSL protocol support in PcapPlusPlus. This class provides the common functionality used by all record types and also contains static methods for identifying an creating SSL/TLS record type layers
|
static |
A static method that creates SSL/TLS layers by raw data. This method parses the raw data, finds if and which SSL/TLS record it is and creates the corresponding record layer. It's the responsibility of the user to free the created object when done using it
[in] | data | A pointer to the raw data |
[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 |
|
virtual |
Implements pcpp::Layer.
|
inlinevirtual |
Implements pcpp::Layer.
|
inline |
Get a pointer to the record header. Notice this points directly to the data, so every change will change the actual packet data
SSLRecordType pcpp::SSLLayer::getRecordType | ( | ) | const |
SSLVersion pcpp::SSLLayer::getRecordVersion | ( | ) | const |
|
static |
A static methods that gets raw data of a layer and checks whether this data is a SSL/TLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The list of ports identified as SSL/TLS is hard-coded and includes the following ports:
[in] | srcPort | The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify SSL/TLS packets |
[in] | dstPort | The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify SSL/TLS packets |
[in] | data | The data to check |
[in] | dataLen | Length (in bytes) of the data |
[in] | ignorePorts | SSL/TLS ports are only relevant for parsing the first SSL/TLS message, but are not relevant for parsing subsequent messages. This parameter can be set to "true" to skip SSL/TLS ports check. This is an optional parameter and its default is "false" |
|
inlinestatic |
A static method that checks whether the port is considered as SSL/TLS
[in] | port | The port number to be checked |
|
virtual |
Several SSL/TLS records can reside in a single packets. So this method checks the remaining data and if it's identified as SSL/TLS it creates another SSL/TLS record layer as the next layer
Implements pcpp::Layer.