mirror of
https://github.com/mfontanini/libtins
synced 2026-01-28 20:44:26 +01:00
Marked PDU::clone_packet as deprecated.
This commit is contained in:
@@ -269,15 +269,18 @@ namespace Tins {
|
||||
*/
|
||||
bool matches_response(uint8_t *ptr, uint32_t total_sz);
|
||||
|
||||
/** \brief Clones this pdu, filling the corresponding header with data
|
||||
/**
|
||||
* \brief Clones this pdu, filling the corresponding header with data
|
||||
* extracted from a buffer.
|
||||
*
|
||||
* \deprecated This method is obsolete.
|
||||
*
|
||||
* \param ptr The pointer to the from from which the data will be extracted.
|
||||
* \param total_sz The size of the buffer.
|
||||
* \return The cloned PDU.
|
||||
* \sa PDU::clone_packet
|
||||
*/
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz);
|
||||
TINS_DEPRECATED(PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz));
|
||||
|
||||
/**
|
||||
* \sa PDU::clone
|
||||
|
||||
@@ -183,15 +183,18 @@ namespace Tins {
|
||||
*/
|
||||
PDUType pdu_type() const { return PDU::ETHERNET_II; }
|
||||
|
||||
/** \brief Clones this pdu, filling the corresponding header with data
|
||||
/**
|
||||
* \brief Clones this pdu, filling the corresponding header with data
|
||||
* extracted from a buffer.
|
||||
*
|
||||
* \deprecated This method is obsolete.
|
||||
*
|
||||
* \param ptr The pointer to the from from which the data will be extracted.
|
||||
* \param total_sz The size of the buffer.
|
||||
* \return The cloned PDU.
|
||||
* \sa PDU::clone_packet
|
||||
*/
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz);
|
||||
TINS_DEPRECATED(PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz));
|
||||
|
||||
/**
|
||||
* \sa PDU::clone
|
||||
|
||||
@@ -287,12 +287,14 @@ namespace Tins {
|
||||
* \brief Clones this pdu, filling the corresponding header with data
|
||||
* extracted from a buffer.
|
||||
*
|
||||
* \deprecated This method is obsolete.
|
||||
*
|
||||
* \param ptr The pointer to the from from which the data will be extracted.
|
||||
* \param total_sz The size of the buffer.
|
||||
* \return The cloned PDU.
|
||||
* \sa PDU::clone_packet
|
||||
*/
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz);
|
||||
TINS_DEPRECATED(PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz));
|
||||
|
||||
/**
|
||||
* \sa PDU::clone
|
||||
|
||||
@@ -184,12 +184,14 @@ namespace Tins {
|
||||
* \brief Clones this pdu, filling the corresponding header with data
|
||||
* extracted from a buffer.
|
||||
*
|
||||
* \deprecated This method is obsolete.
|
||||
*
|
||||
* \param ptr The pointer to the from from which the data will be extracted.
|
||||
* \param total_sz The size of the buffer.
|
||||
* \return The cloned PDU.
|
||||
* \sa PDU::clone_packet
|
||||
*/
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz);
|
||||
TINS_DEPRECATED(PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz));
|
||||
|
||||
/**
|
||||
* \sa PDU::clone
|
||||
|
||||
@@ -57,6 +57,8 @@ namespace Internals {
|
||||
PDU *pdu_from_flag(Constants::Ethernet::e flag, const uint8_t *buffer,
|
||||
uint32_t size, bool rawpdu_on_no_match = true);
|
||||
|
||||
PDU *pdu_from_flag(PDU::PDUType type, const uint8_t *buffer, uint32_t size);
|
||||
|
||||
Constants::Ethernet::e pdu_flag_to_ether_type(PDU::PDUType flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,12 +595,14 @@ namespace Tins {
|
||||
* \brief Clones this pdu, filling the corresponding header with data
|
||||
* extracted from a buffer.
|
||||
*
|
||||
* \deprecated This method is obsolete.
|
||||
*
|
||||
* \param ptr The pointer to the from from which the data will be extracted.
|
||||
* \param total_sz The size of the buffer.
|
||||
* \return The cloned PDU.
|
||||
* \sa PDU::clone_packet
|
||||
*/
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz);
|
||||
TINS_DEPRECATED(PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz));
|
||||
|
||||
/**
|
||||
* \sa PDU::clone
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
#include "macros.h"
|
||||
|
||||
/** \brief The Tins namespace.
|
||||
*/
|
||||
@@ -272,11 +273,13 @@ namespace Tins {
|
||||
/** \brief Clones this pdu, filling the corresponding header with data
|
||||
* extracted from a buffer.
|
||||
*
|
||||
* \deprecated This method is obsolete.
|
||||
*
|
||||
* \param ptr The pointer to the from from which the data will be extracted.
|
||||
* \param total_sz The size of the buffer.
|
||||
* \return The cloned PDU.
|
||||
*/
|
||||
virtual PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz) { return 0; }
|
||||
TINS_DEPRECATED(virtual PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz));
|
||||
protected:
|
||||
/**
|
||||
* \brief Copy constructor.
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
/**
|
||||
@@ -129,9 +130,11 @@ public:
|
||||
/**
|
||||
* Forwards the call to the cached PDU. \sa PDU::clone_packet.
|
||||
*/
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz) {
|
||||
return cached.clone_packet(ptr, total_sz);
|
||||
}
|
||||
TINS_DEPRECATED(
|
||||
PDU *clone_packet(const uint8_t *ptr, uint32_t total_sz) {
|
||||
return 0;
|
||||
}
|
||||
)
|
||||
private:
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent) {
|
||||
if(cached_serialization.size() != total_sz) {
|
||||
|
||||
Reference in New Issue
Block a user