aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_gns_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-13 17:10:07 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-13 17:10:07 +0000
commitbfbbb1e8700093783da55c84221fc688eee4c9a0 (patch)
tree83693440965fff521bc21af1debf963b95d77471 /src/include/gnunet_gns_service.h
parentee32003b7e606767f9b89715cb956d863fe067d9 (diff)
downloadgnunet-bfbbb1e8700093783da55c84221fc688eee4c9a0.tar.gz
gnunet-bfbbb1e8700093783da55c84221fc688eee4c9a0.zip
-getting rid of duplication of record type values / enum GNUNET_GNS_RecordType
Diffstat (limited to 'src/include/gnunet_gns_service.h')
-rw-r--r--src/include/gnunet_gns_service.h147
1 files changed, 5 insertions, 142 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 47d02ac7c..d9aad6d77 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2012 Christian Grothoff (and other contributing authors) 3 (C) 2012-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 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 6 it under the terms of the GNU General Public License as published
@@ -55,100 +55,6 @@ struct GNUNET_GNS_Handle;
55 */ 55 */
56struct GNUNET_GNS_LookupRequest; 56struct GNUNET_GNS_LookupRequest;
57 57
58/**
59 * Handle to control a shorten operation.
60 */
61struct GNUNET_GNS_ShortenRequest;
62
63/**
64 * Handle to control a get authority operation
65 */
66struct GNUNET_GNS_GetAuthRequest;
67
68/**
69 * Record types
70 * Based on GNUNET_DNSPARSER_TYPEs (standard DNS)
71 */
72enum GNUNET_GNS_RecordType
73{
74 /**
75 * A 'struct in_addr'
76 */
77 GNUNET_GNS_RECORD_A = GNUNET_DNSPARSER_TYPE_A,
78
79 /**
80 * A 'char *'
81 */
82 GNUNET_GNS_RECORD_NS = GNUNET_DNSPARSER_TYPE_NS,
83
84 /**
85 * A 'char *'
86 */
87 GNUNET_GNS_RECORD_CNAME = GNUNET_DNSPARSER_TYPE_CNAME,
88
89 /**
90 * A 'struct soa_data'
91 */
92 GNUNET_GNS_RECORD_SOA = GNUNET_DNSPARSER_TYPE_SOA,
93
94 /**
95 * A 'struct srv_data'
96 */
97 GNUNET_GNS_RECORD_SRV = GNUNET_DNSPARSER_TYPE_SRV,
98
99 /**
100 * A 'char *'
101 */
102 GNUNET_GNS_RECORD_PTR = GNUNET_DNSPARSER_TYPE_PTR,
103
104 /**
105 * A 'uint16_t' and a 'char *'
106 */
107 GNUNET_GNS_RECORD_MX = GNUNET_DNSPARSER_TYPE_MX,
108
109 /**
110 * A 'char *'
111 */
112 GNUNET_GNS_RECORD_TXT = GNUNET_DNSPARSER_TYPE_TXT,
113
114 /**
115 * A 'struct in6_addr'
116 */
117 GNUNET_GNS_RECORD_AAAA = GNUNET_DNSPARSER_TYPE_AAAA,
118
119 /* GNS specific */
120 /**
121 * A 'struct GNUNET_CRYPTO_ShortHashCode'
122 */
123 GNUNET_GNS_RECORD_PKEY = GNUNET_NAMESTORE_TYPE_PKEY,
124
125 /**
126 * A 'char *'
127 */
128 GNUNET_GNS_RECORD_PSEU = GNUNET_NAMESTORE_TYPE_PSEU,
129 GNUNET_GNS_RECORD_ANY = GNUNET_NAMESTORE_TYPE_ANY,
130
131 /**
132 * A 'char *'
133 */
134 GNUNET_GNS_RECORD_LEHO = GNUNET_NAMESTORE_TYPE_LEHO,
135
136 /**
137 * A 'struct vpn_data'
138 */
139 GNUNET_GNS_RECORD_VPN = GNUNET_NAMESTORE_TYPE_VPN,
140
141 /**
142 * Revocation, no data.
143 */
144 GNUNET_GNS_RECORD_REV = GNUNET_NAMESTORE_TYPE_REV,
145
146 /**
147 * Social place.
148 */
149 GNUNET_GNS_RECORD_PLACE = GNUNET_NAMESTORE_TYPE_PLACE
150};
151
152 58
153/** 59/**
154 * Initialize the connection with the GNS service. 60 * Initialize the connection with the GNS service.
@@ -169,14 +75,11 @@ void
169GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle); 75GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle);
170 76
171 77
172/* *************** Standard API: lookup ******************* */
173
174/** 78/**
175 * Iterator called on obtained result for a GNS 79 * Iterator called on obtained result for a GNS lookup.
176 * lookup
177 * 80 *
178 * @param cls closure 81 * @param cls closure
179 * @param rd_count number of records 82 * @param rd_count number of records in @a rd
180 * @param rd the records in reply 83 * @param rd the records in reply
181 */ 84 */
182typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls, 85typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
@@ -184,14 +87,13 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
184 const struct GNUNET_NAMESTORE_RecordData *rd); 87 const struct GNUNET_NAMESTORE_RecordData *rd);
185 88
186 89
187
188/** 90/**
189 * Perform an asynchronous lookup operation on the GNS. 91 * Perform an asynchronous lookup operation on the GNS.
190 * 92 *
191 * @param handle handle to the GNS service 93 * @param handle handle to the GNS service
192 * @param name the name to look up 94 * @param name the name to look up
193 * @param zone zone to look in 95 * @param zone zone to look in
194 * @param type the record type to look for 96 * @param type the GNS record type to look for
195 * @param only_cached #GNUNET_NO to only check locally (not in the DHT) 97 * @param only_cached #GNUNET_NO to only check locally (not in the DHT)
196 * @param shorten_zone_key the private key of the shorten zone (can be NULL); 98 * @param shorten_zone_key the private key of the shorten zone (can be NULL);
197 * specify to enable automatic shortening (given a PSEU 99 * specify to enable automatic shortening (given a PSEU
@@ -206,7 +108,7 @@ struct GNUNET_GNS_LookupRequest*
206GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, 108GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
207 const char *name, 109 const char *name,
208 const struct GNUNET_CRYPTO_EccPublicKey *zone, 110 const struct GNUNET_CRYPTO_EccPublicKey *zone,
209 enum GNUNET_GNS_RecordType type, 111 int type,
210 int only_cached, 112 int only_cached,
211 struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, 113 struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key,
212 GNUNET_GNS_LookupResultProcessor proc, 114 GNUNET_GNS_LookupResultProcessor proc,
@@ -222,45 +124,6 @@ void
222GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr); 124GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr);
223 125
224 126
225
226/* *************** Standard API: get authority ******************* */
227
228
229/**
230 * Processor called on for a name shortening result
231 * called only once
232 *
233 * @param cls closure
234 * @param auth_name the name of the auhtority or NULL
235 */
236typedef void (*GNUNET_GNS_GetAuthResultProcessor) (void *cls,
237 const char* short_name);
238
239
240/**
241 * Perform an authority lookup for a given name.
242 *
243 * @param handle handle to the GNS service
244 * @param name the name to look up authority for
245 * @param proc function to call on result
246 * @param proc_cls closure for processor
247 * @return handle to the operation
248 */
249struct GNUNET_GNS_GetAuthRequest*
250GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle,
251 const char *name,
252 GNUNET_GNS_GetAuthResultProcessor proc,
253 void *proc_cls);
254
255
256/**
257 * Cancel pending get auth request
258 *
259 * @param gar the lookup request to cancel
260 */
261void
262GNUNET_GNS_cancel_get_auth_request (struct GNUNET_GNS_GetAuthRequest *gar);
263
264#if 0 /* keep Emacsens' auto-indent happy */ 127#if 0 /* keep Emacsens' auto-indent happy */
265{ 128{
266#endif 129#endif