-peer review
[oweals/gnunet.git] / src / include / gnunet_dnsparser_lib.h
index a369964323505f1e763324b7c80c2fd16f769a8e..328a2286a605d907321907a994268e91cb5b2b87 100644 (file)
@@ -42,6 +42,7 @@
 #define GNUNET_DNSPARSER_TYPE_TXT 16
 #define GNUNET_DNSPARSER_TYPE_AAAA 28
 #define GNUNET_DNSPARSER_TYPE_SRV 33
+#define GNUNET_DNSPARSER_TYPE_TLSA 52
 
 /**
  * A few common DNS classes (ok, only one is common, but I list a
@@ -79,6 +80,7 @@
  */
 struct GNUNET_DNSPARSER_Flags
 {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
   /**
    * Set to 1 if recursion is desired (client -> server)
    */
@@ -128,6 +130,61 @@ struct GNUNET_DNSPARSER_Flags
    * Set to 1 if recursion is available (server -> client)
    */
   unsigned int recursion_available  : 1 GNUNET_PACKED; 
+#elif __BYTE_ORDER == __BIG_ENDIAN
+  
+  /**
+   * query:0, response:1
+   */
+  unsigned int query_or_response    : 1 GNUNET_PACKED;  
+  
+  /**
+   * See GNUNET_DNSPARSER_OPCODE_ defines.
+   */
+  unsigned int opcode               : 4 GNUNET_PACKED;  
+  
+  /**
+   * Set to 1 if this is an authoritative answer
+   */
+  unsigned int authoritative_answer : 1 GNUNET_PACKED;
+  
+  /**
+   * Set to 1 if message is truncated
+   */
+  unsigned int message_truncated    : 1 GNUNET_PACKED; 
+  
+  /**
+   * Set to 1 if recursion is desired (client -> server)
+   */
+  unsigned int recursion_desired    : 1 GNUNET_PACKED;  
+
+  /**
+   * Set to 1 if recursion is available (server -> client)
+   */
+  unsigned int recursion_available  : 1 GNUNET_PACKED;
+  
+  /**
+   * Always zero.
+   */
+  unsigned int zero                 : 1 GNUNET_PACKED;
+  
+  /**
+   * Response has been cryptographically verified, RFC 4035.
+   */
+  unsigned int authenticated_data   : 1 GNUNET_PACKED;
+  
+  /**
+   * See RFC 4035.
+   */
+  unsigned int checking_disabled    : 1 GNUNET_PACKED; 
+  
+  /**
+   * See GNUNET_DNSPARSER_RETURN_CODE_ defines.
+   */  
+  unsigned int return_code          : 4 GNUNET_PACKED; 
+#else
+  #error byteorder undefined
+#endif
   
 } GNUNET_GCC_STRUCT_LAYOUT;