[svn] commit: r3124 - /branches/trac358/src/lib/dns/message.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Oct 6 13:39:51 UTC 2010


Author: jinmei
Date: Wed Oct  6 13:39:51 2010
New Revision: 3124

Log:
added more comments

Modified:
    branches/trac358/src/lib/dns/message.cc

Modified: branches/trac358/src/lib/dns/message.cc
==============================================================================
--- branches/trac358/src/lib/dns/message.cc (original)
+++ branches/trac358/src/lib/dns/message.cc Wed Oct  6 13:39:51 2010
@@ -57,15 +57,27 @@
 const unsigned int OPCODE_SHIFT = 11;
 const unsigned int RCODE_MASK = 0x000f;
 
-//      1  0  0  0  0  1  1  1  1  0  1  1  0  0  0  0
+// This diagram shows the wire-format representation of the 2nd 16 bits of
+// the DNS header section, which contain all defined flag bits.
+//
 //    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 //    |QR|   Opcode  |AA|TC|RD|RA|  |AD|CD|   RCODE   |
 //    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 //      1  0  0  0| 0  1  1  1| 1  0  1  1| 0  0  0  0|
 //         0x8         0x7         0xb         0x0
-// (should be extendable?)
+//
+// This mask covers all the flag bits, and those bits only.
+// Note: we reject a "flag" the is not covered by this mask in some of the
+// public methods.  This means our current definition is not fully extendable;
+// applications cannot introduce a new flag bit temporarily without modifying
+// the source code.
 const unsigned int HEADERFLAG_MASK = 0x87b0;
 
+// This is a set of flag bits that should be preserved when building a reply
+// from a request.
+// Note: we assume the specific definition of HEADERFLAG_xx.  We may change
+// the definition in future, in which case we need to adjust this definition,
+// too (see also the description about the Message::HeaderFlag type).
 const uint16_t MESSAGE_REPLYPRESERVE = (Message::HEADERFLAG_RD |
                                         Message::HEADERFLAG_CD);
 




More information about the bind10-changes mailing list