From: Andrei Pavel Date: Mon, 11 Jul 2016 14:01:55 +0000 (+0300) Subject: solving compliation issues after merge: add const to procedures X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d43b609bc5e4e9cf700aa86a6a9e868497dc6825;p=thirdparty%2Fkea.git solving compliation issues after merge: add const to procedures --- diff --git a/src/lib/dhcp/option6_pdexclude.cc b/src/lib/dhcp/option6_pdexclude.cc index 5805f677fd..6e90e8e4c0 100644 --- a/src/lib/dhcp/option6_pdexclude.cc +++ b/src/lib/dhcp/option6_pdexclude.cc @@ -40,7 +40,7 @@ Option6PDExclude::Option6PDExclude( excluded_prefix_length_(excluded_prefix_length) { } -void Option6PDExclude::pack(isc::util::OutputBuffer& buf) { +void Option6PDExclude::pack(isc::util::OutputBuffer& buf) const { // Header = option code and length. packHeader(buf); @@ -50,9 +50,9 @@ void Option6PDExclude::pack(isc::util::OutputBuffer& buf) { boost::dynamic_bitset bits(excluded_address_bytes.rbegin(), excluded_address_bytes.rend()); bits = bits << delegated_prefix_length_; - uint8_t subtractedPrefixesOctetLength = getSubtractedPrefixesOctetLength(); + const uint8_t subtractedPrefixesOctetLength = getSubtractedPrefixesOctetLength(); for (uint8_t i = 0U; i < subtractedPrefixesOctetLength; i++) { - boost::dynamic_bitset tmp = bits >> 120; + const boost::dynamic_bitset tmp = bits >> 120; uint8_t val = static_cast(tmp.to_ulong()); @@ -78,12 +78,12 @@ void Option6PDExclude::unpack(OptionBufferConstIter begin, begin = end; } -uint16_t Option6PDExclude::len() { +uint16_t Option6PDExclude::len() const { return getHeaderLen() + sizeof(excluded_prefix_length_) + getSubtractedPrefixesOctetLength(); } -uint8_t Option6PDExclude::getSubtractedPrefixesOctetLength() { +uint8_t Option6PDExclude::getSubtractedPrefixesOctetLength() const { // Promote what is less than 8 bits to 1 octet. uint8_t subtractedPrefixesBitLength = excluded_prefix_length_ - delegated_prefix_length_ - 1; diff --git a/src/lib/dhcp/option6_pdexclude.h b/src/lib/dhcp/option6_pdexclude.h index b736da3cd8..b83a9450e7 100644 --- a/src/lib/dhcp/option6_pdexclude.h +++ b/src/lib/dhcp/option6_pdexclude.h @@ -39,7 +39,7 @@ public: /// @param buf pointer to a buffer /// /// @throw BadValue Universe of the option is neither V4 nor V6. - virtual void pack(isc::util::OutputBuffer& buf); + virtual void pack(isc::util::OutputBuffer& buf) const; /// @brief Parses received buffer. /// @@ -51,7 +51,7 @@ public: /// option header) /// /// @return length of the option - virtual uint16_t len(); + virtual uint16_t len() const; /// @brief Returns the address of the delegated address space. /// @@ -85,7 +85,7 @@ protected: /// @brief Returns the prefix length of the excluded prefix. /// /// @return prefix length of excluded prefix - uint8_t getSubtractedPrefixesOctetLength(); + uint8_t getSubtractedPrefixesOctetLength() const; /// @brief The address and prefix length identifying the delegated IPV6 /// prefix.