From b9ced3f2ee0534ce0d57f93b5dd3cbf52ca1d56b Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Sat, 19 Dec 2009 02:31:33 +0000 Subject: [PATCH] defined some compression related constants to avoid hardcoding magic numbers as much as possible. git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jinmei-dnsmessageapi@389 e5f2f494-b856-4b98-b285-d166d9295462 --- src/lib/dns/cpp/name.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/dns/cpp/name.h b/src/lib/dns/cpp/name.h index 0347b091cf..02c5d53f10 100644 --- a/src/lib/dns/cpp/name.h +++ b/src/lib/dns/cpp/name.h @@ -457,6 +457,17 @@ public: /// \brief Max allowable length of labels of a domain name. static const size_t MAX_LABELLEN = 63; + + /// \brief Max possible pointer value for name compression. + /// + /// This is the highest number of 14-bit unsigned integer. Name compression + /// pointers are identified as a 2-byte value starting with the upper two + /// bit being 11. + static const uint16_t MAX_COMPRESS_POINTER = 0x3fff; + /// \brief A 8-bit masked value indicating a start of compression pointer. + static const uint16_t COMPRESS_POINTER_MARK8 = 0xc0; + /// \brief A 16-bit masked value indicating a start of compression pointer. + static const uint16_t COMPRESS_POINTER_MARK16 = 0xc000; //@} private: