mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Added PDU::matches_pdu override on RC4EAPOL and RSNEAPOL.
This commit is contained in:
@@ -293,6 +293,21 @@ namespace Tins {
|
||||
*/
|
||||
uint32_t header_size() const;
|
||||
|
||||
/**
|
||||
* \brief Getter for the PDU's type.
|
||||
* \return Returns the PDUType corresponding to the PDU.
|
||||
*/
|
||||
PDUType pdu_type() const { return PDU::RC4EAPOL; }
|
||||
|
||||
/**
|
||||
* \brief Check wether this PDU matches the specified flag.
|
||||
* \param flag The flag to match
|
||||
* \sa PDU::matches_flag
|
||||
*/
|
||||
bool matches_flag(PDUType flag) {
|
||||
return flag == PDU::RC4EAPOL || EAPOL::matches_flag(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Clones this PDU.
|
||||
*
|
||||
@@ -491,6 +506,21 @@ namespace Tins {
|
||||
*/
|
||||
void rsn_information(const RSNInformation &rsn);
|
||||
|
||||
/**
|
||||
* \brief Getter for the PDU's type.
|
||||
* \return Returns the PDUType corresponding to the PDU.
|
||||
*/
|
||||
PDUType pdu_type() const { return PDU::RSNEAPOL; }
|
||||
|
||||
/**
|
||||
* \brief Check wether this PDU matches the specified flag.
|
||||
* \param flag The flag to match
|
||||
* \sa PDU::matches_flag
|
||||
*/
|
||||
bool matches_flag(PDUType flag) {
|
||||
return flag == PDU::RSNEAPOL || EAPOL::matches_flag(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Clones this PDU.
|
||||
*
|
||||
|
||||
@@ -81,7 +81,9 @@ namespace Tins {
|
||||
ICMP,
|
||||
BOOTP,
|
||||
DHCP,
|
||||
EAPOL
|
||||
EAPOL,
|
||||
RC4EAPOL,
|
||||
RSNEAPOL
|
||||
};
|
||||
|
||||
/** \brief PDU constructor
|
||||
|
||||
@@ -49,11 +49,11 @@ Tins::EAPOL *Tins::EAPOL::from_bytes(const uint8_t *buffer, uint32_t total_sz) {
|
||||
const eapolhdr *ptr = (const eapolhdr*)buffer;
|
||||
switch(ptr->type) {
|
||||
case RC4:
|
||||
return new RC4EAPOL(buffer, total_sz);
|
||||
return new Tins::RC4EAPOL(buffer, total_sz);
|
||||
break;
|
||||
case RSN:
|
||||
case EAPOL_WPA:
|
||||
return new RSNEAPOL(buffer, total_sz);
|
||||
return new Tins::RSNEAPOL(buffer, total_sz);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user