1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
// Copyright (C) 2010-2024 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef DNS_RDATACLASS_H
#define DNS_RDATACLASS_H

#include <dns/master_loader.h>
#include <dns/name.h>
#include <dns/rdata.h>
#include <dns/rrttl.h>
#include <dns/rrtype.h>
#include <dns/serial.h>
#include <util/buffer.h>

#include <boost/shared_ptr.hpp><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <memory><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <stdint.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <string><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <vector><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.

namespace isc {
namespace dns {

class Name;
class MasterLexer;
class MasterLoaderCallbacks;
class AbstractMessageRenderer;

namespace rdata {
namespace any {

struct TSIGImpl;

/// \brief \c rdata::TSIG class represents the TSIG RDATA as defined %in
/// RFC2845.
///
/// This class implements the basic interfaces inherited from the abstract
/// \c rdata::Rdata class, and provides trivial accessors specific to the
/// TSIG RDATA.
class TSIG : public Rdata {
public:
    explicit TSIG(const std::string& type_str);
    TSIG(isc::util::InputBuffer& buffer, size_t rdata_len);
    TSIG(const TSIG& other);
    TSIG(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    /// \brief Constructor from RDATA field parameters.
    ///
    /// The parameters are a straightforward mapping of %TSIG RDATA
    /// fields as defined %in RFC2845, but there are some implementation
    /// specific notes as follows.
    ///
    /// \c algorithm is a \c Name object that specifies the algorithm.
    /// For example, if the algorithm is HMAC-SHA256, \c algorithm would be
    /// \c Name("hmac-sha256").
    ///
    /// \c time_signed corresponds to the Time Signed field, which is of
    /// 48-bit unsigned integer type, and therefore cannot exceed 2^48-1;
    /// otherwise, an exception of type \c OutOfRange will be thrown.
    ///
    /// \c mac_size and \c mac correspond to the MAC Size and MAC fields,
    /// respectively.  When the MAC field is empty, \c mac must be null.
    /// \c mac_size and \c mac must be consistent %in that \c mac_size is 0 if
    /// and only if \c mac is null; otherwise an exception of type
    /// InvalidParameter will be thrown.
    ///
    /// The same restriction applies to \c other_len and \c other_data,
    /// which correspond to the Other Len and Other Data fields, respectively.
    ///
    /// This constructor internally involves resource allocation, and if
    /// it fails, a corresponding standard exception will be thrown.
    TSIG(const Name& algorithm, uint64_t time_signed, uint16_t fudge,
         uint16_t mac_size, const void* mac, uint16_t original_id,
         uint16_t error, uint16_t other_len, const void* other_data);

    /// \brief Assignment operator.
    ///
    /// It internally allocates a resource, and if it fails a corresponding
    /// standard exception will be thrown.
    /// This operator never throws an exception otherwise.
    ///
    /// This operator provides the strong exception guarantee: When an
    /// exception is thrown the content of the assignment target will be
    /// intact.
    TSIG& operator=(const TSIG& source);

    /// \brief The destructor.
    ~TSIG();

    /// \brief Return the algorithm name.
    ///
    /// This method never throws an exception.
    const Name& getAlgorithm() const;

    /// \brief Return the value of the Time Signed field.
    ///
    /// The returned value does not exceed 2^48-1.
    ///
    /// This method never throws an exception.
    uint64_t getTimeSigned() const;

    /// \brief Return the value of the Fudge field.
    ///
    /// This method never throws an exception.
    uint16_t getFudge() const;

    /// \brief Return the value of the MAC Size field.
    ///
    /// This method never throws an exception.
    uint16_t getMACSize() const;

    /// \brief Return the value of the MAC field.
    ///
    /// If the MAC field is empty, it returns null.
    /// Otherwise, the memory region beginning at the address returned by
    /// this method is valid up to the bytes specified by the return value
    /// of \c getMACSize().
    /// The memory region is only valid while the corresponding \c TSIG
    /// object is valid.  The caller must hold the \c TSIG object while
    /// it needs to refer to the region or it must make a local copy of the
    /// region.
    ///
    /// This method never throws an exception.
    const void* getMAC() const;

    /// \brief Return the value of the Original ID field.
    ///
    /// This method never throws an exception.
    uint16_t getOriginalID() const;

    /// \brief Return the value of the Error field.
    ///
    /// This method never throws an exception.
    uint16_t getError() const;

    /// \brief Return the value of the Other Len field.
    ///
    /// This method never throws an exception.
    uint16_t getOtherLen() const;

    /// \brief Return the value of the Other Data field.
    ///
    /// The same note as \c getMAC() applies.
    ///
    /// This method never throws an exception.
    const void* getOtherData() const;
private:
    std::unique_ptr<TSIGImpl> constructFromLexer(MasterLexer& lexer, const Name* origin);

    std::unique_ptr<TSIGImpl> impl_;
};

} // end of namespace "any"

namespace ch {

class A : public Rdata {
public:
    explicit A(const std::string& type_str);
    A(isc::util::InputBuffer& buffer, size_t rdata_len);
    A(const A& other);
    A(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class
};

} // end of namespace "ch"

namespace generic {
namespace detail {

/// \brief Construct a Name object using a master lexer and optional origin.
///
/// This is a convenient shortcut of commonly used code pattern that would
/// be used to build RDATA that contain a domain name field.
///
/// Note that this function throws an exception against invalid input.
/// The (direct or indirect) caller's responsibility needs to expect and
/// handle exceptions appropriately.
///
/// \throw MasterLexer::LexerError The next token from lexer is not string.
/// \throw Other Exceptions from the \c Name class constructor if the next
/// string token from the lexer does not represent a valid name.
///
/// \param lexer A \c MasterLexer object.  Its next token is expected to be
/// a string that represent a domain name.
/// \param origin If non null, specifies the origin of the name to be
/// constructed.
///
/// \return A new Name object that corresponds to the next string token of
/// the \c lexer.
inline Name
createNameFromLexer(MasterLexer& lexer, const Name* origin) {
    const MasterToken::StringRegion& str_region =
        lexer.getNextToken(MasterToken::STRING).getStringRegion();
    return (Name(str_region.beg, str_region.len, origin));
}

template<class Type, uint16_t typeCode>
class TXTLikeImpl;

} // namespace detail

class NS : public Rdata {
public:
    explicit NS(const std::string& type_str);
    NS(isc::util::InputBuffer& buffer, size_t rdata_len);
    NS(const NS& other);
    NS(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    /// Specialized constructor
    ///
    explicit NS(const Name& nsname) : nsname_(nsname) {
    }
    ///
    /// Specialized methods
    ///
    const Name& getNSName() const;
private:
    Name nsname_;
};

struct OPTImpl;

class OPT : public Rdata {
public:
    explicit OPT(const std::string& type_str);
    OPT(isc::util::InputBuffer& buffer, size_t rdata_len);
    OPT(const OPT& other);
    OPT(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    // The default constructor makes sense for OPT as it can be empty.
    OPT();
    OPT& operator=(const OPT& source);
    ~OPT();

    /// \brief A class representing a pseudo RR (or option) within an
    /// OPT RR (see RFC 6891).
    class PseudoRR {
    public:
        /// \brief Constructor.
        /// \param code The OPTION-CODE field of the pseudo RR.
        /// \param data The OPTION-DATA field of the pseudo
        /// RR. OPTION-LENGTH is set to the length of this vector.
        PseudoRR(uint16_t code,
                 boost::shared_ptr<std::vector<uint8_t> >& data);

        /// \brief Return the option code of this pseudo RR.
        uint16_t getCode() const;

        /// \brief Return the option data of this pseudo RR.
        const uint8_t* getData() const;

        /// \brief Return the length of the option data of this
        /// pseudo RR.
        uint16_t getLength() const;

    private:
        uint16_t code_;
        boost::shared_ptr<std::vector<uint8_t>> data_;
    };

    /// \brief Append a pseudo RR (option) in this OPT RR.
    ///
    /// \param code The OPTION-CODE field of the pseudo RR.
    /// \param data The OPTION-DATA field of the pseudo RR.
    /// \param length The size of the \c data argument. OPTION-LENGTH is
    /// set to this size.
    /// \throw isc::InvalidParameter if this pseudo RR would cause
    /// the OPT RDATA to overflow its RDLENGTH.
    void appendPseudoRR(uint16_t code, const uint8_t* data, uint16_t length);

    /// \brief Return a vector of the pseudo RRs (options) in this
    /// OPT RR.
    ///
    /// Note: The returned reference is only valid during the lifetime
    /// of this \c generic::OPT object. It should not be used
    /// afterwards.
    const std::vector<PseudoRR>& getPseudoRRs() const;

private:
    std::unique_ptr<OPTImpl> impl_;
};

class PTR : public Rdata {
public:
    explicit PTR(const std::string& type_str);
    PTR(isc::util::InputBuffer& buffer, size_t rdata_len);
    PTR(const PTR& other);
    PTR(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    ///
    /// Specialized constructor
    ///
    explicit PTR(const Name& ptr_name) : ptr_name_(ptr_name) {
    }
    ///
    /// Specialized methods
    ///
    const Name& getPTRName() const;
private:
    Name ptr_name_;
};

struct RRSIGImpl;

/// \brief \c rdata::RRSIG class represents the RRSIG RDATA as defined %in
/// RFC4034.
///
/// This class implements the basic interfaces inherited from the abstract
/// \c rdata::Rdata class, and provides trivial accessors specific to the
/// RRSIG RDATA.
class RRSIG : public Rdata {
public:
    explicit RRSIG(const std::string& type_str);
    RRSIG(isc::util::InputBuffer& buffer, size_t rdata_len);
    RRSIG(const RRSIG& other);
    RRSIG(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    RRSIG& operator=(const RRSIG& source);
    ~RRSIG();

    // specialized methods
    const RRType& typeCovered() const;
private:
    // helper function for string and lexer constructors
    std::unique_ptr<RRSIGImpl> constructFromLexer(MasterLexer& lexer, const Name* origin);

    std::unique_ptr<RRSIGImpl> impl_;
};

class SOA : public Rdata {
public:
    explicit SOA(const std::string& type_str);
    SOA(isc::util::InputBuffer& buffer, size_t rdata_len);
    SOA(const SOA& other);
    SOA(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    SOA(const Name& mname, const Name& rname, uint32_t serial,
        uint32_t refresh, uint32_t retry, uint32_t expire,
        uint32_t minimum);

    /// \brief Returns the serial stored in the SOA.
    Serial getSerial() const;

    /// brief Returns the minimum TTL field value of the SOA.
    uint32_t getMinimum() const;
private:
    /// Note: this is a prototype version; we may reconsider
    /// this representation later.
    Name mname_;
    Name rname_;
    /// serial, refresh, retry, expire, minimum, stored in network byte order
    uint8_t numdata_[20];
};

struct TKEYImpl;

/// \brief \c rdata::TKEY class represents the TKEY RDATA as defined %in
/// RFC2930.
///
/// This class implements the basic interfaces inherited from the abstract
/// \c rdata::Rdata class, and provides trivial accessors specific to the
/// TKEY RDATA.
class TKEY : public Rdata {
public:
    explicit TKEY(const std::string& type_str);
    TKEY(isc::util::InputBuffer& buffer, size_t rdata_len);
    TKEY(const TKEY& other);
    TKEY(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    /// \brief Constructor from RDATA field parameters.
    ///
    /// The parameters are a straightforward mapping of %TKEY RDATA
    /// fields as defined %in RFC2930.
    ///
    /// This RR is pretty close to the TSIG RR with 32 bit timestamps,
    /// or the RRSIG RR with a second "other" data field.
    ///
    /// This constructor internally involves resource allocation, and if
    /// it fails, a corresponding standard exception will be thrown.
    ///
    /// \param algorithm The DNS name of the algorithm e.g. gss-tsig.
    /// \param inception The inception time (in seconds since 1970).
    /// \param expire The expire time (in seconds since 1970).
    /// \param mode The mode e.g. Diffie-Hellman (2) or GSS-API (3).
    /// \param error The error code (extended error space shared with TSIG).
    /// \param key_len The key length (0 means no key).
    /// \param key The key (can be 0).
    /// \param other_len The other data length (0 means no other data).
    /// \param other_data The other data (can be and usually is 0).
    TKEY(const Name& algorithm, uint32_t inception, uint32_t expire,
         uint16_t mode, uint16_t error, uint16_t key_len,
         const void* key, uint16_t other_len, const void* other_data);

    /// \brief Assignment operator.
    ///
    /// It internally allocates a resource, and if it fails a corresponding
    /// standard exception will be thrown.
    /// This operator never throws an exception otherwise.
    ///
    /// This operator provides the strong exception guarantee: When an
    /// exception is thrown the content of the assignment target will be
    /// intact.
    TKEY& operator=(const TKEY& source);

    /// \brief The destructor.
    ~TKEY();

    /// \brief Return the algorithm name.
    ///
    /// This method never throws an exception.
    const Name& getAlgorithm() const;

    /// \brief Return the value of the Inception field as a number.
    ///
    /// This method never throws an exception.
    uint32_t getInception() const;

    /// \brief Return the value of the Inception field as a string.
    std::string getInceptionDate() const;

    /// \brief Return the value of the Expire field as a number.
    ///
    /// This method never throws an exception.
    uint32_t getExpire() const;

    /// \brief Return the value of the Expire field as a string.
    std::string getExpireDate() const;

    /// \brief Return the value of the Mode field.
    ///
    /// This method never throws an exception.
    uint16_t getMode() const;

    /// \brief Return the value of the Error field.
    ///
    /// This method never throws an exception.
    uint16_t getError() const;

    /// \brief Return the value of the Key Len field.
    ///
    /// This method never throws an exception.
    uint16_t getKeyLen() const;

    /// \brief Return the value of the Key field.
    ///
    /// This method never throws an exception.
    const void* getKey() const;

    /// \brief Return the value of the Other Len field.
    ///
    /// This method never throws an exception.
    uint16_t getOtherLen() const;

    /// \brief Return the value of the Other Data field.
    ///
    /// The same note as \c getMAC() applies.
    ///
    /// This method never throws an exception.
    const void* getOtherData() const;

    /// \brief The GSS_API constant for the Mode field.
    static const uint16_t GSS_API_MODE;

private:
    std::unique_ptr<TKEYImpl> constructFromLexer(MasterLexer& lexer, const Name* origin);

    std::unique_ptr<TKEYImpl> impl_;
};

class TXT : public Rdata {
public:
    explicit TXT(const std::string& type_str);
    TXT(isc::util::InputBuffer& buffer, size_t rdata_len);
    TXT(const TXT& other);
    TXT(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    TXT& operator=(const TXT& source);
    ~TXT();

private:
    typedef isc::dns::rdata::generic::detail::TXTLikeImpl<TXT, 16> TXTImpl;
    std::unique_ptr<TXTImpl> impl_;
};
} // namespace generic


namespace in {

class A : public Rdata {
public:
    explicit A(const std::string& type_str);
    A(isc::util::InputBuffer& buffer, size_t rdata_len);
    A(const A& other);
    A(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class
private:
    uint32_t addr_;             // raw IPv4 address (network byte order)
};

class AAAA : public Rdata {
public:
    explicit AAAA(const std::string& type_str);
    AAAA(isc::util::InputBuffer& buffer, size_t rdata_len);
    AAAA(const AAAA& other);
    AAAA(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class
private:
    uint8_t addr_[16];        // raw IPv6 address (network byte order)
};

/// \brief \c rdata::DHCID class represents the DHCID RDATA as defined %in
/// RFC4701.
///
/// This class implements the basic interfaces inherited from the abstract
/// \c rdata::Rdata class, and provides trivial accessors specific to the
/// DHCID RDATA.
class DHCID : public Rdata {
public:
    explicit DHCID(const std::string& type_str);
    DHCID(isc::util::InputBuffer& buffer, size_t rdata_len);
    DHCID(const DHCID& other);
    DHCID(
        MasterLexer& lexer, const Name* name,
        MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
    virtual std::string toText() const;<--- Function in derived class
    virtual void toWire(isc::util::OutputBuffer& buffer) const;<--- Function in derived class
    virtual void toWire(AbstractMessageRenderer& renderer) const;<--- Function in derived class
    virtual int compare(const Rdata& other) const;<--- Function in derived class

    /// \brief Return the digest.
    ///
    /// This method never throws an exception.
    const std::vector<uint8_t>& getDigest() const;

private:
    // helper for string and lexer constructors
    void constructFromLexer(MasterLexer& lexer);

    /// \brief Private data representation
    ///
    /// Opaque data at least 3 octets long as per RFC4701.
    ///
    std::vector<uint8_t> digest_;
};

} // end of namespace "in"
} // end of namespace "rdata"
} // end of namespace "dns"
} // end of namespace "isc"
#endif // DNS_RDATACLASS_H