2 This file is part of GNUnet
3 (C) 2012, 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file include/gnunet_gnsrecord_lib.h
23 * @brief API that can be used to manipulate GNS record data
24 * @author Christian Grothoff
26 #ifndef GNUNET_GNSRECORD_LIB_H
27 #define GNUNET_GNSRECORD_LIB_H
32 #if 0 /* keep Emacsens' auto-indent happy */
39 * Record type indicating any record/'*'
41 #define GNUNET_GNSRECORD_TYPE_ANY 0
44 * Record type for GNS zone transfer ("PKEY").
46 #define GNUNET_GNSRECORD_TYPE_PKEY 65536
49 * Record type for GNS zone transfer ("PSEU").
51 #define GNUNET_GNSRECORD_TYPE_PSEU 65537
54 * Record type for GNS legacy hostnames ("LEHO").
56 #define GNUNET_GNSRECORD_TYPE_LEHO 65538
59 * Record type for VPN resolution
61 #define GNUNET_GNSRECORD_TYPE_VPN 65539
64 * Record type for delegation to DNS.
66 #define GNUNET_GNSRECORD_TYPE_GNS2DNS 65540
69 * Record type for a social place.
71 #define GNUNET_GNSRECORD_TYPE_PLACE 65541
74 * Record type for a phone (of CONVERSATION).
76 #define GNUNET_GNSRECORD_TYPE_PHONE 65542
81 * Convert the binary value @a data of a record of
82 * type @a type to a human-readable string.
84 * @param type type of the record
85 * @param data value in binary encoding
86 * @param data_size number of bytes in @a data
87 * @return NULL on error, otherwise human-readable representation of the value
90 GNUNET_GNSRECORD_value_to_string (uint32_t type,
96 * Convert human-readable version of the value @a s of a record
97 * of type @a type to the respective binary representation.
99 * @param type type of the record
100 * @param s human-readable string
101 * @param data set to value in binary encoding (will be allocated)
102 * @param data_size set to number of bytes in @a data
103 * @return #GNUNET_OK on success
106 GNUNET_GNSRECORD_string_to_value (uint32_t type,
113 * Convert a type name (i.e. "AAAA") to the corresponding number.
115 * @param dns_typename name to convert
116 * @return corresponding number, UINT32_MAX on error
119 GNUNET_GNSRECORD_typename_to_number (const char *dns_typename);
123 * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A")
125 * @param type number of a type to convert
126 * @return corresponding typestring, NULL on error
129 GNUNET_GNSRECORD_number_to_typename (uint32_t type);
132 #if 0 /* keep Emacsens' auto-indent happy */