diff options
author | Mukund Sivaraman <muks@isc.org> | 2014-01-27 09:16:19 +0100 |
---|---|---|
committer | Mukund Sivaraman <muks@isc.org> | 2014-01-27 09:31:47 +0100 |
commit | 0408d1e6472105cb9c762ac3ef7082d47dc6a720 (patch) | |
tree | 21f81e7d75637a89516f2425560df1d405a6dbe5 /src/lib/dns/rdata | |
parent | [2000] Add appendPseudoRR() unittests (diff) | |
download | kea-0408d1e6472105cb9c762ac3ef7082d47dc6a720.tar.xz kea-0408d1e6472105cb9c762ac3ef7082d47dc6a720.zip |
[2000] Add OPT::toWire() implementations
Diffstat (limited to 'src/lib/dns/rdata')
-rw-r--r-- | src/lib/dns/rdata/generic/opt_41.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/dns/rdata/generic/opt_41.cc b/src/lib/dns/rdata/generic/opt_41.cc index 176fa3929b..6b292e9fa1 100644 --- a/src/lib/dns/rdata/generic/opt_41.cc +++ b/src/lib/dns/rdata/generic/opt_41.cc @@ -164,13 +164,27 @@ OPT::toText() const { } void -OPT::toWire(OutputBuffer&) const { - // nothing to do, as this simple version doesn't support any options. +OPT::toWire(OutputBuffer& buffer) const { + BOOST_FOREACH(const PseudoRR& pseudo_rr, impl_->pseudo_rrs_) { + buffer.writeUint16(pseudo_rr.getCode()); + const uint16_t length = pseudo_rr.getLength(); + buffer.writeUint16(length); + if (length > 0) { + buffer.writeData(pseudo_rr.getData(), length); + } + } } void -OPT::toWire(AbstractMessageRenderer&) const { - // nothing to do, as this simple version doesn't support any options. +OPT::toWire(AbstractMessageRenderer& renderer) const { + BOOST_FOREACH(const PseudoRR& pseudo_rr, impl_->pseudo_rrs_) { + renderer.writeUint16(pseudo_rr.getCode()); + const uint16_t length = pseudo_rr.getLength(); + renderer.writeUint16(length); + if (length > 0) { + renderer.writeData(pseudo_rr.getData(), length); + } + } } int |