return ("");
}
+void
+Option6ClientFqdn::packDomainName(isc::util::OutputBuffer& buf) const {
+ // Domain name, encoded as a set of labels.
+ isc::dns::LabelSequence labels(*impl_->domain_name_);
+ if (labels.getDataLength() > 0) {
+ size_t read_len = 0;
+ const uint8_t* data = labels.getData(&read_len);
+ if (impl_->domain_name_type_ == PARTIAL) {
+ --read_len;
+ }
+ buf.writeData(data, read_len);
+ }
+}
+
void
Option6ClientFqdn::setDomainName(const std::string& domain_name,
const DomainNameType domain_name_type) {
packHeader(buf);
// Flags field.
buf.writeUint8(impl_->flags_);
- // Domain name, encoded as a set of labels.
- isc::dns::LabelSequence labels(*impl_->domain_name_);
- if (labels.getDataLength() > 0) {
- size_t read_len = 0;
- const uint8_t* data = labels.getData(&read_len);
- if (impl_->domain_name_type_ == PARTIAL) {
- --read_len;
- }
- buf.writeData(data, read_len);
- }
-
-
+ // Domain name.
+ packDomainName(buf);
}
void
/// @return domain-name in the text format.
std::string getDomainName() const;
+ /// @brief Writes domain-name in the wire format into a buffer.
+ ///
+ /// The data being written are appended at the end of the buffer.
+ ///
+ /// @param [out] buf buffer where domain-name will be written.
+ void packDomainName(isc::util::OutputBuffer& buf) const;
+
/// @brief Set new domain-name.
///
/// @param domain_name domain name field value in the text format.