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