 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef MESSAGERENDERER_H
8 #define MESSAGERENDERER_H 1
12 #include <boost/noncopyable.hpp>
140 return (buffer_->getData());
145 return (buffer_->getLength());
234 void skip(
size_t len) {
263 virtual void clear();
269 buffer_->writeUint8(data);
277 buffer_->writeUint16(data);
292 buffer_->writeUint16At(data, pos);
300 buffer_->writeUint32(data);
311 buffer_->writeData(data, len);
357 public boost::noncopyable {
381 virtual void clear();
382 virtual void writeName(
const Name& name,
bool compress =
true);
391 #endif // MESSAGERENDERER_H
virtual CompressMode getCompressMode() const =0
Return the compression mode of the renderer class object.
size_t getLength() const
Return the length of data written in the internal buffer.
virtual bool isTruncated() const =0
Return whether truncation has occurred while rendering.
virtual void setLengthLimit(size_t len)=0
Set the maximum length of rendered data that can fit in the corresponding DNS message without truncat...
CompressMode
Compression mode constants.
isc::util::OutputBuffer & getBuffer()
AbstractMessageRenderer()
The default constructor.
virtual ~MessageRenderer()
const isc::util::OutputBuffer & getBuffer() const
Return the output buffer we render into.
virtual void setCompressMode(CompressMode mode)
This implementation does not allow this call in the middle of rendering (i.e.
virtual void writeName(const Name &name, bool compress=true)=0
Write a Name object into the internal buffer in wire format, with or without name compression.
virtual void setTruncated()
Mark the renderer to indicate truncation has occurred while rendering.
virtual bool isTruncated() const
Return whether truncation has occurred while rendering.
void writeUint8(const uint8_t data)
Write an unsigned 8-bit integer into the internal buffer.
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
void writeUint32(uint32_t data)
Write an unsigned 32-bit integer in host byte order into the internal buffer in network byte order.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual void writeName(const Name &name, bool compress=true)
Write a Name object into the internal buffer in wire format, with or without name compression.
virtual ~AbstractMessageRenderer()
The destructor.
The Name class encapsulates DNS names.
@ CASE_INSENSITIVE
Compress names case-insensitive manner (default)
void setBuffer(isc::util::OutputBuffer *buffer)
Set or reset a temporary output buffer.
virtual void setTruncated()=0
Mark the renderer to indicate truncation has occurred while rendering.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void writeUint16(uint16_t data)
Write an unsigned 16-bit integer in host byte order into the internal buffer in network byte order.
void skip(size_t len)
Insert a specified length of gap at the end of the buffer.
void trim(size_t len)
Trim the specified length of data from the end of the internal buffer.
void writeData(const void *data, size_t len)
Copy an arbitrary length of data into the internal buffer of the renderer object.
virtual CompressMode getCompressMode() const
Return the compression mode of the renderer class object.
virtual void setLengthLimit(size_t len)
Set the maximum length of rendered data that can fit in the corresponding DNS message without truncat...
void writeUint16At(uint16_t data, size_t pos)
Write an unsigned 16-bit integer in host byte order at the specified position of the internal buffer ...
The MessageRendererImpl class is the actual implementation of MessageRenderer.
const void * getData() const
Return a pointer to the head of the data stored in the internal buffer.
The MessageRenderer is a concrete derived class of AbstractMessageRenderer as a general purpose imple...
virtual void writeName(const LabelSequence &ls, bool compress=true)=0
Write a LabelSequence object into the internal buffer in wire format, with or without name compressio...
virtual size_t getLengthLimit() const =0
Return the maximum length of rendered data that can fit in the corresponding DNS message without trun...
@ CASE_SENSITIVE
Compress names case-sensitive manner.
virtual void clear()
Clear the internal buffer and other internal resources.
virtual size_t getLengthLimit() const
Return the maximum length of rendered data that can fit in the corresponding DNS message without trun...
virtual void setCompressMode(CompressMode mode)=0
Set the compression mode of the renderer class object.
virtual void clear()
Clear the internal buffer and other internal resources.
Light-weight Accessor to Name data.