aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-10-06 15:54:30 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-10-06 15:54:30 +0000
commit810bc9ef12ddcc67cfc7cd762759ee13ecd14a8d (patch)
treee6950609e302c8cee5dd49cd75a890e660dde02a /src/include
parent16f524720ce08aadb35912731217eaeafc690dba (diff)
downloadgnunet-810bc9ef12ddcc67cfc7cd762759ee13ecd14a8d.tar.gz
gnunet-810bc9ef12ddcc67cfc7cd762759ee13ecd14a8d.zip
- Add reverse resolution with limited functionality
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_gns_service.h27
-rw-r--r--src/include/gnunet_gnsrecord_lib.h25
-rw-r--r--src/include/gnunet_protocols.h10
3 files changed, 62 insertions, 0 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 1d74408fc..8a1099444 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -94,6 +94,16 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
94 uint32_t rd_count, 94 uint32_t rd_count,
95 const struct GNUNET_GNSRECORD_Data *rd); 95 const struct GNUNET_GNSRECORD_Data *rd);
96 96
97/**
98 * Iterator called on obtained result for a GNS lookup.
99 *
100 * @param cls closure
101 * @param rd_count number of records in @a rd
102 * @param rd the records in reply
103 */
104typedef void (*GNUNET_GNS_ReverseLookupResultProcessor) (void *cls,
105 const char* name);
106
97 107
98/** 108/**
99 * Options for the GNS lookup. 109 * Options for the GNS lookup.
@@ -146,6 +156,23 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
146 GNUNET_GNS_LookupResultProcessor proc, 156 GNUNET_GNS_LookupResultProcessor proc,
147 void *proc_cls); 157 void *proc_cls);
148 158
159/**
160 * Perform an asynchronous reverse lookup operation on the GNS.
161 *
162 * @param handle handle to the GNS service
163 * @param zone_key zone to find a name for
164 * @param root_key our zone
165 * @param proc processor to call on result
166 * @param proc_cls closure for @a proc
167 * @return handle to the request
168 */
169struct GNUNET_GNS_ReverseLookupRequest*
170GNUNET_GNS_reverse_lookup (struct GNUNET_GNS_Handle *handle,
171 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key,
172 const struct GNUNET_CRYPTO_EcdsaPublicKey *root_key,
173 GNUNET_GNS_ReverseLookupResultProcessor proc,
174 void *proc_cls);
175
149 176
150/** 177/**
151 * Cancel pending lookup request 178 * Cancel pending lookup request
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index b7920cbb8..985ae1f7a 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -108,6 +108,10 @@ extern "C"
108 */ 108 */
109#define GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA 65546 109#define GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA 65546
110 110
111/**
112 * Record type for reverse lookups
113 */
114#define GNUNET_GNSRECORD_TYPE_REVERSE 65548
111 115
112/** 116/**
113 * Flags that can be set for a record. 117 * Flags that can be set for a record.
@@ -286,6 +290,27 @@ struct GNUNET_GNSRECORD_BoxRecord
286 290
287}; 291};
288 292
293/**
294 * Record type used internally to keep track of reverse mappings into a
295 * namespace.
296 * The record contains data related to PKEY delegations from other namespaces to
297 * the namespace the record belongs to.
298 * It is exclusively found under the label ``+''.
299 */
300struct GNUNET_GNSRECORD_ReverseRecord
301{
302 /**
303 * The public key of the namespace the is delegating to our namespace
304 */
305 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
306
307 /**
308 * The expiration time of the delegation
309 */
310 struct GNUNET_TIME_Absolute expiration;
311
312 /* followed by the name the delegator uses to refer to our namespace */
313};
289 314
290GNUNET_NETWORK_STRUCT_END 315GNUNET_NETWORK_STRUCT_END
291 316
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index f9f6cbd9c..0da6780cb 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -1529,6 +1529,16 @@ extern "C"
1529 */ 1529 */
1530#define GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT 501 1530#define GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT 501
1531 1531
1532/**
1533 * Reverse lookup
1534 */
1535#define GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP 503
1536
1537/**
1538 * Response to reverse lookup
1539 */
1540#define GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP_RESULT 504
1541
1532 1542
1533/******************************************************************************* 1543/*******************************************************************************
1534 * CONSENSUS message types 1544 * CONSENSUS message types