mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Add ICMP extensions to ICMP PDU
The length field is still not being set
This commit is contained in:
@@ -353,10 +353,21 @@ namespace Tins {
|
||||
* \brief Returns the header size.
|
||||
*
|
||||
* This metod overrides PDU::header_size. This size includes the
|
||||
* payload and options size. \sa PDU::header_size
|
||||
* payload and options size.
|
||||
*
|
||||
* \sa PDU::header_size
|
||||
*/
|
||||
uint32_t header_size() const;
|
||||
|
||||
/**
|
||||
* \brief Returns the trailer size.
|
||||
*
|
||||
* This metod overrides PDU::trailer_size. This size will hold the extensions size
|
||||
*
|
||||
* \sa PDU::header_size
|
||||
*/
|
||||
uint32_t trailer_size() const;
|
||||
|
||||
/**
|
||||
* \brief Check wether ptr points to a valid response for this PDU.
|
||||
*
|
||||
@@ -366,7 +377,24 @@ namespace Tins {
|
||||
*/
|
||||
bool matches_response(const uint8_t *ptr, uint32_t total_sz) const;
|
||||
|
||||
const ICMPExtensionsStructure& extensions() { return extensions_; }
|
||||
/**
|
||||
* \brief Getter for the extensions field.
|
||||
*
|
||||
* \return The extensions field
|
||||
*/
|
||||
const ICMPExtensionsStructure& extensions() const { return extensions_; }
|
||||
|
||||
/**
|
||||
* \brief Getter for the extensions field.
|
||||
*
|
||||
* \return The extensions field
|
||||
*/
|
||||
ICMPExtensionsStructure& extensions() { return extensions_; }
|
||||
|
||||
/**
|
||||
* \brief Indicates whether this object contains ICMP extensions
|
||||
*/
|
||||
bool has_extensions() const { return !extensions_.extensions().empty(); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the PDU's type.
|
||||
|
||||
@@ -189,6 +189,13 @@ public:
|
||||
*/
|
||||
const extensions_type& extensions() const { return extensions_; }
|
||||
|
||||
/**
|
||||
* \brief Adds an extension to this structure
|
||||
*
|
||||
* \param extension The extension to be added;
|
||||
*/
|
||||
void add_extension(const ICMPExtension& extension);
|
||||
|
||||
/**
|
||||
* \brief Gets the size of this ICMP extensions structure
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user