1
0
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:
Matias Fontanini
2013-03-24 16:08:09 -03:00
parent d7dd1e131f
commit 8be0c4c23c
16 changed files with 90 additions and 67 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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.

View File

@@ -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) {