]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
solving compliation issues after merge: add const to procedures
authorAndrei Pavel <andrei.pavel@qualitance.com>
Mon, 11 Jul 2016 14:01:55 +0000 (17:01 +0300)
committerAndrei Pavel <andrei.pavel@qualitance.com>
Mon, 11 Jul 2016 14:01:55 +0000 (17:01 +0300)
src/lib/dhcp/option6_pdexclude.cc
src/lib/dhcp/option6_pdexclude.h

index 5805f677fd9ad4d8fecb3326aae2cf42b259d641..6e90e8e4c03da605b67b27f39bab7a487257f00b 100644 (file)
@@ -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<uint8_t> 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<uint8_t> tmp = bits >> 120;
+        const boost::dynamic_bitset<uint8_t> tmp = bits >> 120;
 
         uint8_t val = static_cast<uint8_t>(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;
index b736da3cd8985e4f25cd8eccefcce81c8749cc1d..b83a9450e7ae52ecc1a8513d67d4bd84f86a31ce 100644 (file)
@@ -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.