along with this program. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
/**
* @author Christian Grothoff
/**
* Record type for local ticket references
*/
-#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKETREF 65545
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET 65545
/**
* 65546 reserved
*/
/**
- * Record type for credential
+ * 65547 deleted, free to use
*/
-#define GNUNET_GNSRECORD_TYPE_CREDENTIAL 65547
/**
* Record type for policies
*/
-#define GNUNET_GNSRECORD_TYPE_POLICY 65548
+#define GNUNET_GNSRECORD_TYPE_DELEGATE 65548
/**
* Record type for reverse lookups
/**
* Flags that can be set for a record.
*/
-enum GNUNET_GNSRECORD_Flags {
-
+enum GNUNET_GNSRECORD_Flags
+{
/**
* No special options.
*/
/**
* A GNS record.
*/
-struct GNUNET_GNSRECORD_Data {
-
+struct GNUNET_GNSRECORD_Data
+{
/**
* Binary value stored in the DNS record. Note: "data" must never
* be individually 'malloc'ed, but instead always points into some
/**
* Data stored in a PLACE record.
*/
-struct GNUNET_GNSRECORD_PlaceData {
+struct GNUNET_GNSRECORD_PlaceData
+{
/**
* Public key of the place.
*/
/**
* Information we have in an encrypted block with record data (i.e. in the DHT).
*/
-struct GNUNET_GNSRECORD_Block {
-
+struct GNUNET_GNSRECORD_Block
+{
/**
* Signature of the block.
*/
* records do not require a separate network request, thus making TLSA
* records inseparable from the "main" A/AAAA/VPN/etc. records.
*/
-struct GNUNET_GNSRECORD_BoxRecord {
-
+struct GNUNET_GNSRECORD_BoxRecord
+{
/**
* Protocol of the boxed record (6 = TCP, 17 = UDP, etc.).
* Yes, in IP protocols are usually limited to 8 bits. In NBO.
* the namespace the record belongs to.
* It is exclusively found under the label ``+''.
*/
-struct GNUNET_GNSRECORD_ReverseRecord {
+struct GNUNET_GNSRECORD_ReverseRecord
+{
/**
* The public key of the namespace the is delegating to our namespace
*/
* @param rd array of records with data to store
*/
typedef void (*GNUNET_GNSRECORD_RecordCallback) (
- void *cls, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd);
+ void *cls, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd);
/* ***************** API related to GNSRECORD plugins ************** */
* @param data_size number of bytes in @a data
* @return NULL on error, otherwise human-readable representation of the value
*/
-char *GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data,
- size_t data_size);
+char *
+GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data,
+ size_t data_size);
/**
* @param data_size set to number of bytes in @a data
* @return #GNUNET_OK on success
*/
-int GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data,
- size_t *data_size);
+int
+GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data,
+ size_t *data_size);
/**
* @param dns_typename name to convert
* @return corresponding number, UINT32_MAX on error
*/
-uint32_t GNUNET_GNSRECORD_typename_to_number (const char *dns_typename);
+uint32_t
+GNUNET_GNSRECORD_typename_to_number (const char *dns_typename);
/**
* @param type number of a type to convert
* @return corresponding typestring, NULL on error
*/
-const char *GNUNET_GNSRECORD_number_to_typename (uint32_t type);
+const char *
+GNUNET_GNSRECORD_number_to_typename (uint32_t type);
/* convenience APIs for serializing / deserializing GNS records */
* @param dest where to put the data
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
-int GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src,
- unsigned int rd_count,
- struct GNUNET_GNSRECORD_Data *dest);
+int
+GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src,
+ unsigned int rd_count,
+ struct GNUNET_GNSRECORD_Data *dest);
/* ******* general APIs relating to blocks, records and labels ******** */
* @return #GNUNET_YES if the record is expired,
* #GNUNET_NO if not
*/
-int GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd);
+int
+GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd);
/**
* @param src source string
* @return converted result
*/
-char *GNUNET_GNSRECORD_string_to_lowercase (const char *src);
+char *
+GNUNET_GNSRECORD_string_to_lowercase (const char *src);
/**
* @return string form; will be overwritten by next call to
* #GNUNET_GNSRECORD_z2s.
*/
-const char *GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
+const char *
+GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
/**
* @param pkey set to a public key on the eliptic curve
* @return #GNUNET_SYSERR if @a zkey has the wrong syntax
*/
-int GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
- struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
+int
+GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
+ struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
/**
* @param label label of the record
* @param query hash to use for the query
*/
-void GNUNET_GNSRECORD_query_from_private_key (
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label,
- struct GNUNET_HashCode *query);
+void
+GNUNET_GNSRECORD_query_from_private_key (
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label,
+ struct GNUNET_HashCode *query);
/**
* @param label label of the record
* @param query hash to use for the query
*/
-void GNUNET_GNSRECORD_query_from_public_key (
- const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label,
- struct GNUNET_HashCode *query);
+void
+GNUNET_GNSRECORD_query_from_public_key (
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label,
+ struct GNUNET_HashCode *query);
/**
* @param rd record data
* @param rd_count number of records in @a rd
*/
-struct GNUNET_GNSRECORD_Block *GNUNET_GNSRECORD_block_create (
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
- struct GNUNET_TIME_Absolute expire, const char *label,
- const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count);
+struct GNUNET_GNSRECORD_Block *
+GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+ struct GNUNET_TIME_Absolute expire,
+ const char *label,
+ const struct GNUNET_GNSRECORD_Data *rd,
+ unsigned int rd_count);
/**
* @param rd record data
* @param rd_count number of records in @a rd
*/
-struct GNUNET_GNSRECORD_Block *GNUNET_GNSRECORD_block_create2 (
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
- struct GNUNET_TIME_Absolute expire, const char *label,
- const struct GNUNET_GNSRECORD_Data *rd, unsigned int rd_count);
+struct GNUNET_GNSRECORD_Block *
+GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+ struct GNUNET_TIME_Absolute expire,
+ const char *label,
+ const struct GNUNET_GNSRECORD_Data *rd,
+ unsigned int rd_count);
/**
* @param block block to verify
* @return #GNUNET_OK if the signature is valid
*/
-int GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block);
+int
+GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block);
/**
* @return #GNUNET_OK on success, #GNUNET_SYSERR if the block was
* not well-formed
*/
-int GNUNET_GNSRECORD_block_decrypt (
- const struct GNUNET_GNSRECORD_Block *block,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label,
- GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls);
+int
+GNUNET_GNSRECORD_block_decrypt (
+ const struct GNUNET_GNSRECORD_Block *block,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label,
+ GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls);
/**
* @param b another record
* @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not.
*/
-int GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
- const struct GNUNET_GNSRECORD_Data *b);
+int
+GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
+ const struct GNUNET_GNSRECORD_Data *b);
/**
* @param rd array of records
* @return absolute expiration time
*/
-struct GNUNET_TIME_Absolute GNUNET_GNSRECORD_record_get_expiration_time (
- unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd);
+struct GNUNET_TIME_Absolute
+GNUNET_GNSRECORD_record_get_expiration_time (
+ unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd);
#if 0 /* keep Emacsens' auto-indent happy */