1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Merge branch 'develop'

This commit is contained in:
Matias Fontanini
2017-01-31 21:37:41 -08:00
36 changed files with 90 additions and 72 deletions

View File

@@ -56,6 +56,8 @@ struct smart_ptr {
typedef std::auto_ptr<T> type;
#endif
};
template<class T> void unused(const T&) { }
}
}

View File

@@ -508,8 +508,8 @@ public:
*/
static Dot11* from_bytes(const uint8_t* buffer, uint32_t total_sz);
protected:
virtual void write_ext_header(Memory::OutputMemoryStream& stream) { }
virtual void write_fixed_parameters(Memory::OutputMemoryStream& stream) { }
virtual void write_ext_header(Memory::OutputMemoryStream& stream);
virtual void write_fixed_parameters(Memory::OutputMemoryStream& stream);
void parse_tagged_parameters(Memory::InputMemoryStream& stream);
void add_tagged_option(OptionTypes opt, uint8_t len, const uint8_t* val);
protected:

View File

@@ -269,7 +269,7 @@ public:
*
* This effectively returns the address_size constant.
*/
const size_t size() const {
size_t size() const {
return address_size;
}

View File

@@ -353,7 +353,7 @@ public:
*/
template<typename T>
const T* find_pdu(PDUType type = T::pdu_flag) const {
return const_cast<PDU*>(this)->find_pdu<T>();
return const_cast<PDU*>(this)->find_pdu<T>(type);
}
/**
@@ -381,7 +381,7 @@ public:
*/
template<typename T>
const T& rfind_pdu(PDUType type = T::pdu_flag) const {
return const_cast<PDU*>(this)->rfind_pdu<T>();
return const_cast<PDU*>(this)->rfind_pdu<T>(type);
}
/**
@@ -433,9 +433,7 @@ public:
* \param ptr The pointer to the buffer.
* \param total_sz The size of the buffer.
*/
virtual bool matches_response(const uint8_t* ptr, uint32_t total_sz) const {
return false;
}
virtual bool matches_response(const uint8_t* ptr, uint32_t total_sz) const;
/**
* \brief Check whether this PDU matches the specified flag.
@@ -485,7 +483,7 @@ protected:
*
* \param parent The parent PDU.
*/
virtual void prepare_for_serialize(const PDU* parent) { }
virtual void prepare_for_serialize(const PDU* parent);
/**
* \brief Serializes this PDU and propagates this action to child PDUs.