gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: GNS: Do not autogenerate flags


From: gnunet
Subject: [gnunet] branch master updated: GNS: Do not autogenerate flags
Date: Sat, 10 Dec 2022 08:01:02 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 52d0d0914 GNS: Do not autogenerate flags
52d0d0914 is described below

commit 52d0d09146c1d13bded8195cb91845acac1b355d
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sat Dec 10 16:00:56 2022 +0900

    GNS: Do not autogenerate flags
---
 bootstrap                               |  5 +--
 src/include/Makefile.am                 |  1 -
 src/include/gnunet_gnsrecord_json_lib.h |  6 ++++
 src/include/gnunet_gnsrecord_lib.h      | 58 ++++++++++++++++++++++++++++++---
 4 files changed, 60 insertions(+), 10 deletions(-)

diff --git a/bootstrap b/bootstrap
index d452be168..fbe03c6f7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -132,13 +132,10 @@ gana_update()
       cwd=$PWD
       cd contrib/gana || exit 1
       # GNS
-      echo "Updating GNS record types/flags"
+      echo "Updating GNS record types"
       cd gnu-name-system-record-types && \
          make >/dev/null && \
          cp gnu_name_system_record_types.h ../../../src/include/ || exit 1
-      cd ../gnu-name-system-record-flags && \
-         make >/dev/null && \
-         cp gnu_name_system_record_flags.h ../../../src/include/ || exit 1
       echo "Creating default TLDs"
       cd ../gnu-name-system-default-tlds && \
          make >/dev/null && \
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 82a81077e..8519883c9 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -59,7 +59,6 @@ gnunetinclude_HEADERS = \
   gnunet_gnsrecord_lib.h \
   gnunet_gnsrecord_json_lib.h \
   gnunet_gnsrecord_plugin.h \
-  gnu_name_system_record_flags.h \
   gnu_name_system_record_types.h \
   gnunet_hello_lib.h \
   gnunet_hello_uri_lib.h \
diff --git a/src/include/gnunet_gnsrecord_json_lib.h 
b/src/include/gnunet_gnsrecord_json_lib.h
index 1216f1f5e..5bc48034b 100644
--- a/src/include/gnunet_gnsrecord_json_lib.h
+++ b/src/include/gnunet_gnsrecord_json_lib.h
@@ -73,6 +73,12 @@ GNUNET_GNSRECORD_JSON_from_gnsrecord (const char*rname,
                             const struct GNUNET_GNSRECORD_Data *rd,
                             unsigned int rd_count);
 
+#if 0 /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
 
 #endif
 
diff --git a/src/include/gnunet_gnsrecord_lib.h 
b/src/include/gnunet_gnsrecord_lib.h
index 6fc2a05c5..3aee30117 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -69,11 +69,6 @@ extern "C" {
  */
 #include "gnu_name_system_record_types.h"
 
-/**
- * Include the record flags generated from GANA
- */
-#include "gnu_name_system_record_flags.h"
-
 /**
  * When comparing flags for record equality for removal,
  * which flags should must match (in addition to the type,
@@ -87,6 +82,59 @@ extern "C" {
  */
 #define GNUNET_GNSRECORD_RF_RCMP_FLAGS 
(GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)
 
+
+/**
+ * Flags that can be set for a record.
+ * The numbers in the registry correspond to the bit index as specified in
+ * LSD0001 Chapter "Resource Records".
+ * Each enum member represents the 16-bit integer value of the flags field if
+ * only that particular flag was set.
+ * The value can be used to efficiently compare the bitmask setting for the
+ * record flag in C.
+ * WARNING: The values are in host byte order! In order to correctly check
+ * against the flags field a record, the respective fields must
+ * also be converted to HBO (or the enum value to NBO).
+ */
+enum GNUNET_GNSRECORD_Flags
+{
+  /**
+   * Entry for no flags / cleared flags.
+   */
+  GNUNET_GNSRECORD_RF_NONE = 0,
+
+
+  /**
+   * This record is critical. If it cannot be processed (for example because 
the record type is unknown) resolution MUST fail
+   */
+  GNUNET_GNSRECORD_RF_CRITICAL = 1 << (15 - 15),
+
+
+  /**
+   * This record should not be used unless all (other) records in the set with 
an absolute expiration time have expired.
+   */
+  GNUNET_GNSRECORD_RF_SHADOW = 1 << (15 - 14),
+
+
+  /**
+   * This is a supplemental record.
+   */
+  GNUNET_GNSRECORD_RF_SUPPLEMENTAL = 1 << (15 - 13),
+
+
+  /**
+   * This expiration time of the record is a relative time (not an absolute 
time). Used in GNUnet implementation.
+   */
+  GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION = 1 << (15 - 1),
+
+
+  /**
+   * This is a private record of this peer and it should thus not be published.
+   */
+  GNUNET_GNSRECORD_RF_PRIVATE = 1 << (15 - 0),
+
+};
+
+
 /**
  * Filter for GNUNET_GNSRECORD_normalize_record_set().
  */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]