PcapPlusPlus  21.11
pcpp::SSHIdentificationMessage Class Reference

#include <SSHLayer.h>

Inheritance diagram for pcpp::SSHIdentificationMessage:
pcpp::SSHLayer pcpp::Layer pcpp::IDataContainer

Public Member Functions

std::string getIdentificationMessage ()
size_t getHeaderLen () const
std::string toString () const
- Public Member Functions inherited from pcpp::SSHLayer
void parseNextLayer ()
void computeCalculateFields ()
OsiModelLayer getOsiModelLayer () const
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
LayergetNextLayer () const
LayergetPrevLayer () 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

Static Public Member Functions

static SSHIdentificationMessagetryParse (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
- Static Public Member Functions inherited from pcpp::SSHLayer
static SSHLayercreateSSHMessage (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
static bool isSSHPort (uint16_t portSrc, uint16_t portDst)

Detailed Description

A class that represnets SSH identification message as described in RFC 4253: https://tools.ietf.org/html/rfc4253#section-4.2

The message content is typically a string that contains the protocol version, software version and a few more details. This string can be retrieved using the getIdentificationMessage() method

Member Function Documentation

◆ getHeaderLen()

size_t pcpp::SSHIdentificationMessage::getHeaderLen ( ) const
The size of the identification message

Implements pcpp::Layer.

◆ getIdentificationMessage()

std::string pcpp::SSHIdentificationMessage::getIdentificationMessage ( )
The SSH identification message which is typically the content of this message

◆ toString()

std::string pcpp::SSHIdentificationMessage::toString ( ) const
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.

◆ tryParse()

static SSHIdentificationMessage* pcpp::SSHIdentificationMessage::tryParse ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 

A static method that takes raw data and tries to parse it as an SSH identification message using the heuristics described in the SSHLayer.h file description. It returns a SSHIdentificationMessage instance if such a message can be identified or NULL otherwise.

[in]dataA pointer to the raw data
[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
An instance of SSHIdentificationMessage or NULL if this is not an identification message