]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2827] 2 methods in Pkt6 are now const.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 3 Apr 2013 11:46:25 +0000 (13:46 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 3 Apr 2013 11:46:25 +0000 (13:46 +0200)
src/lib/dhcp/pkt6.cc
src/lib/dhcp/pkt6.h

index 944b0d4b25f6b1450f207798c1510c550a5693d2..c97281e9ce9f3858edaebee16dbb35c17d85162e 100644 (file)
@@ -88,7 +88,7 @@ OptionPtr Pkt6::getRelayOption(uint16_t opt_type, uint8_t relay_level) {
     return (OptionPtr());
 }
 
-uint16_t Pkt6::getRelayOverhead(const RelayInfo& relay) {
+uint16_t Pkt6::getRelayOverhead(const RelayInfo& relay) const {
     uint16_t len = DHCPV6_RELAY_HDR_LEN // fixed header
         + Option::OPTION6_HDR_LEN; // header of the relay-msg option
 
@@ -112,10 +112,10 @@ uint16_t Pkt6::calculateRelaySizes() {
     return (len);
 }
 
-uint16_t Pkt6::directLen() {
+uint16_t Pkt6::directLen() const {
     uint16_t length = DHCPV6_PKT_HDR_LEN; // DHCPv6 header
 
-    for (Option::OptionCollection::iterator it = options_.begin();
+    for (Option::OptionCollection::const_iterator it = options_.begin();
          it != options_.end();
          ++it) {
         length += (*it).second->len();
index d24dc030b8062cb7efc68cf11ba340e894b9ede4..7a58ae33163466e8eb92bdf0a4ba91f2beedf9f4 100644 (file)
@@ -426,7 +426,7 @@ protected:
     /// It is used when calculating message size and packing message
     /// @param relay RelayInfo structure that holds information about relay
     /// @return number of bytes needed to store relay information
-    uint16_t getRelayOverhead(const RelayInfo& relay);
+    uint16_t getRelayOverhead(const RelayInfo& relay) const;
 
     /// @brief calculates overhead for all relays defined for this message
     /// @return number of bytes needed to store all relay information
@@ -436,7 +436,7 @@ protected:
     ///
     /// This is equal to len() if the message was not relayed.
     /// @return number of bytes required to store the message
-    uint16_t directLen();
+    uint16_t directLen() const;
 
     /// UDP (usually) or TCP (bulk leasequery or failover)
     DHCPv6Proto proto_;