PcapPlusPlus
24.09
|
#include <LdapLayer.h>
Public Member Functions | |
LdapLayer (uint16_t messageId, LdapOperationType operationType, const std::vector< Asn1Record * > &messageRecords, const std::vector< LdapControl > &controls=std::vector< LdapControl >()) | |
Asn1SequenceRecord * | getRootAsn1Record () const |
Asn1ConstructedRecord * | getLdapOperationAsn1Record () const |
uint16_t | getMessageID () const |
std::vector< LdapControl > | getControls () 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 | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () 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 |
Static Public Member Functions | |
static bool | isLdapPort (uint16_t port) |
static LdapLayer * | parseLdapMessage (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) |
Represents an LDAP message
pcpp::LdapLayer::LdapLayer | ( | uint16_t | messageId, |
LdapOperationType | operationType, | ||
const std::vector< Asn1Record * > & | messageRecords, | ||
const std::vector< LdapControl > & | controls = std::vector< LdapControl >() |
||
) |
A constructor to create a new LDAP message
[in] | messageId | The LDAP message ID |
[in] | operationType | The LDAP operation type |
[in] | messageRecords | A vector of ASN.1 records that comprise the LDAP message |
[in] | controls | A vector of LDAP controls. This is an optional parameter, if not provided the message will be created without LDAP controls |
|
inlineoverridevirtual |
Each layer can compute field values automatically using this method. This is an abstract method
Implements pcpp::Layer.
std::vector<LdapControl> pcpp::LdapLayer::getControls | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
Asn1ConstructedRecord* pcpp::LdapLayer::getLdapOperationAsn1Record | ( | ) | const |
|
virtual |
Reimplemented in pcpp::LdapUnbindRequestLayer.
uint16_t pcpp::LdapLayer::getMessageID | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
Asn1SequenceRecord* pcpp::LdapLayer::getRootAsn1Record | ( | ) | const |
|
inlinestatic |
A static method that checks whether a source or dest port match those associated with the LDAP protocol
[in] | port | The port number to check |
|
static |
A static message to parse an LDAP message from raw data
[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 |
|
overridevirtual |
Tries to identify more LDAP messages in this packet if exist
Implements pcpp::Layer.
|
overridevirtual |
Implements pcpp::Layer.
|
inline |
Most getter methods in this class throw an exception if the corresponding ASN.1 record is invalid. This is a wrapper method that allows calling these getters without adding a try...catch
clause. It accepts the getter method and an out variable. It tries to call the getter and if no exception is thrown, the out variable will contain the result.
Here is an example:
We call getMessageID(), if no exception is thrown the variable messageId will hold the result
Method | The class method type |
ResultType | The expected result type (for example: uint8_t, std::string, etc.) |
[in] | method | The class method to call |
[out] | result | An outvariable to contain the result if no exception is thrown |