PcapPlusPlus  Next
pcpp::LdapBindRequestLayer Class Reference

#include <LdapLayer.h>

Inheritance diagram for pcpp::LdapBindRequestLayer:
pcpp::LdapLayer pcpp::Layer pcpp::IDataContainer

Classes

struct  SaslAuthentication
 

Public Types

enum class  AuthenticationType : uint8_t { Simple = 0 , Sasl = 3 , NotApplicable = 255 }
 

Public Member Functions

 LdapBindRequestLayer (uint16_t messageId, uint8_t version, const std::string &name, const std::string &simpleAuthentication, const std::vector< LdapControl > &controls=std::vector< LdapControl >())
 
 LdapBindRequestLayer (uint16_t messageId, uint8_t version, const std::string &name, const SaslAuthentication &saslAuthentication, const std::vector< LdapControl > &controls=std::vector< LdapControl >())
 
uint32_t getVersion () const
 
std::string getName () const
 
AuthenticationType getAuthenticationType () const
 
std::string getSimpleAuthentication () const
 
SaslAuthentication getSaslAuthentication () const
 
- Public Member Functions inherited from pcpp::LdapLayer
 LdapLayer (uint16_t messageId, LdapOperationType operationType, const std::vector< Asn1Record * > &messageRecords, const std::vector< LdapControl > &controls=std::vector< LdapControl >())
 
Asn1SequenceRecordgetRootAsn1Record () const
 
Asn1ConstructedRecordgetLdapOperationAsn1Record () const
 
uint16_t getMessageID () const
 
std::vector< LdapControlgetControls () const
 
virtual LdapOperationType getLdapOperationType () const
 
template<typename Method , typename ResultType >
bool tryGet (Method method, ResultType &result)
 
void parseNextLayer () override
 
size_t getHeaderLen () const override
 
void computeCalculateFields () override
 
OsiModelLayer getOsiModelLayer () const override
 
std::string toString () const override
 
- Public Member Functions inherited from pcpp::Layer
 ~Layer () override
 
LayergetNextLayer () const
 
LayergetPrevLayer () 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 override
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::LdapLayer
static bool isLdapPort (uint16_t port)
 
static LdapLayerparseLdapMessage (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 

Detailed Description

Represents LDAP bind request operation

Member Enumeration Documentation

◆ AuthenticationType

An enum to represent the bind request authentication type

Enumerator
Simple 

Simple authentication.

Sasl 

SASL authentication.

NotApplicable 

Unknown / not application authentication type.

Constructor & Destructor Documentation

◆ LdapBindRequestLayer() [1/2]

pcpp::LdapBindRequestLayer::LdapBindRequestLayer ( uint16_t  messageId,
uint8_t  version,
const std::string &  name,
const std::string &  simpleAuthentication,
const std::vector< LdapControl > &  controls = std::vector< LdapControl >() 
)

A constructor to create a new LDAP bind request message with simple authentication

Parameters
[in]messageIdThe LDAP message ID
[in]versionThe LDAP protocol version that the client wants to use
[in]nameThe DN of the user to authenticate
[in]simpleAuthenticationSimple authentication to use in this message
[in]controlsA vector of LDAP controls. This is an optional parameter, if not provided the message will be created without LDAP controls

◆ LdapBindRequestLayer() [2/2]

pcpp::LdapBindRequestLayer::LdapBindRequestLayer ( uint16_t  messageId,
uint8_t  version,
const std::string &  name,
const SaslAuthentication saslAuthentication,
const std::vector< LdapControl > &  controls = std::vector< LdapControl >() 
)

A constructor to create a new LDAP bind request message with SASL authentication

Parameters
[in]messageIdThe LDAP message ID
[in]versionThe LDAP protocol version that the client wants to use
[in]nameThe DN of the user to authenticate
[in]saslAuthenticationSASL authentication to use in this message
[in]controlsA vector of LDAP controls. This is an optional parameter, if not provided the message will be created without LDAP controls

Member Function Documentation

◆ getAuthenticationType()

AuthenticationType pcpp::LdapBindRequestLayer::getAuthenticationType ( ) const
Returns
The authentication type included in this message

◆ getName()

std::string pcpp::LdapBindRequestLayer::getName ( ) const
Returns
The DN of the user to authenticate

◆ getSaslAuthentication()

SaslAuthentication pcpp::LdapBindRequestLayer::getSaslAuthentication ( ) const
Returns
The SASL authentication included in this message
Exceptions
std::invalid_argumentif the message doesn't include SASL authentication

◆ getSimpleAuthentication()

std::string pcpp::LdapBindRequestLayer::getSimpleAuthentication ( ) const
Returns
The simple authentication included in this message
Exceptions
std::invalid_argumentif the message doesn't include simple authentication

◆ getVersion()

uint32_t pcpp::LdapBindRequestLayer::getVersion ( ) const
Returns
The LDAP protocol version that the client wants to use