Encapsulates an NSEC bitmap. See section 4.1.2 of RFC4034. More...
#include <DwmDnsNSECBitmap.hh>
Public Member Functions | |
| NSECBitmap () | |
| Construct an empty bitmap. | |
| NSECBitmap (uint8_t window, const std::vector< uint8_t > &bits) | |
Construct a bitmap with window number window and bitmap bits. | |
| bool | operator== (const NSECBitmap &bitmap) const |
| Equal-to operator, for unit testing. | |
| uint8_t | Window () const |
| Returns the window number of the bitmap. | |
| uint8_t | Window (uint8_t window) |
| Sets and returns the window number of the bitmap. | |
| const std::vector< uint8_t > & | Bits () const |
| Returns the bits in the bitmap. | |
| const std::vector< uint8_t > & | Bits (const std::vector< uint8_t > &bits) |
| Sets and returns the bits in the bitmap. | |
| uint8_t * | Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen) const |
Encodes the bitmap into buffer @ pkt of length pktlen, starting at ptr. More... | |
| const uint8_t * | Decode (const uint8_t *pkt, const uint8_t *ptr, uint16_t pktlen, uint16_t rdlen) |
Decodes the bitmap from buffer pkt of length pktlen, starting at ptr. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const NSECBitmap &bitmap) |
| Prints the bitmap to an ostream in human-readable form. | |
Encapsulates an NSEC bitmap. See section 4.1.2 of RFC4034.
| const uint8_t* Dwm::Dns::NSECBitmap::Decode | ( | const uint8_t * | pkt, |
| const uint8_t * | ptr, | ||
| uint16_t | pktlen, | ||
| uint16_t | rdlen | ||
| ) |
Decodes the bitmap from buffer pkt of length pktlen, starting at ptr.
Returns the address immediately following the encoded bitmap in pkt on success. Throws std::out_of_range if pkt was too short to contain an encoded bitmap.
| uint8_t* Dwm::Dns::NSECBitmap::Encode | ( | uint8_t * | pkt, |
| uint8_t * | ptr, | ||
| uint16_t | pktlen | ||
| ) | const |
Encodes the bitmap into buffer @ pkt of length pktlen, starting at ptr.
Returns the address immediately following the encoded bitmap in pkt on success. Throws std::out_of_range if pkt is too short to contain the encoded bitmap.