|
@@ -197,7 +197,7 @@ public:
|
|
/// Returns option type (0-255 for DHCPv4, 0-65535 for DHCPv6)
|
|
/// Returns option type (0-255 for DHCPv4, 0-65535 for DHCPv6)
|
|
///
|
|
///
|
|
/// @return option type
|
|
/// @return option type
|
|
- uint16_t getType() { return (type_); }
|
|
|
|
|
|
+ uint16_t getType() const { return (type_); }
|
|
|
|
|
|
/// Returns length of the complete option (data length + DHCPv4/DHCPv6
|
|
/// Returns length of the complete option (data length + DHCPv4/DHCPv6
|
|
/// option header)
|
|
/// option header)
|
|
@@ -219,7 +219,7 @@ public:
|
|
///
|
|
///
|
|
/// @return pointer to actual data (or reference to an empty vector
|
|
/// @return pointer to actual data (or reference to an empty vector
|
|
/// if there is no data)
|
|
/// if there is no data)
|
|
- virtual const OptionBuffer& getData() { return (data_); }
|
|
|
|
|
|
+ virtual const OptionBuffer& getData() const { return (data_); }
|
|
|
|
|
|
/// Adds a sub-option.
|
|
/// Adds a sub-option.
|
|
///
|
|
///
|
|
@@ -303,6 +303,19 @@ public:
|
|
/// just to force that every option has virtual dtor
|
|
/// just to force that every option has virtual dtor
|
|
virtual ~Option();
|
|
virtual ~Option();
|
|
|
|
|
|
|
|
+ /// @brief Checks if two options are equal
|
|
|
|
+ ///
|
|
|
|
+ /// Equality verifies option type and option content. Care should
|
|
|
|
+ /// be taken when using this method. Implementation for derived
|
|
|
|
+ /// classes should be provided when this method is expected to be
|
|
|
|
+ /// used. It is safe in general, as the first check (different types)
|
|
|
|
+ /// will detect differences between base Option and derived
|
|
|
|
+ /// objects.
|
|
|
|
+ ///
|
|
|
|
+ /// @param other the other option
|
|
|
|
+ /// @return true if both options are equal
|
|
|
|
+ virtual bool equal(const OptionPtr& other) const;
|
|
|
|
+
|
|
protected:
|
|
protected:
|
|
/// Builds raw (over-wire) buffer of this option, including all
|
|
/// Builds raw (over-wire) buffer of this option, including all
|
|
/// defined suboptions. Version for building DHCPv4 options.
|
|
/// defined suboptions. Version for building DHCPv4 options.
|