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);
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());
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;
/// @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.
///
/// 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.
///
/// @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.