aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.h
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2012-03-28 11:12:19 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2012-03-28 11:12:19 +0000
commitba5736672201f5c3a97c7e8b46f716077b416d6c (patch)
treeef89bb093c40efc3d69c7cfcb2f6d1c0d1d17010 /src/gns/gnunet-service-gns_resolver.h
parente7526f97264417497e9d7d89d53a7dac4d832083 (diff)
downloadgnunet-ba5736672201f5c3a97c7e8b46f716077b416d6c.tar.gz
gnunet-ba5736672201f5c3a97c7e8b46f716077b416d6c.zip
-fixes, cleanup
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.h')
-rw-r--r--src/gns/gnunet-service-gns_resolver.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h
index f8c662bc2..17d0a7221 100644
--- a/src/gns/gnunet-service-gns_resolver.h
+++ b/src/gns/gnunet-service-gns_resolver.h
@@ -41,11 +41,11 @@ struct ResolverHandle;
41typedef void (*ResolverCleanupContinuation) (void); 41typedef void (*ResolverCleanupContinuation) (void);
42 42
43/** 43/**
44 * processor for a resultion result 44 * processor for a record lookup result
45 * 45 *
46 * @param cls the closure 46 * @param cls the closure
47 * @param rd_count number of results 47 * @param rd_count number of results
48 * @param rd resukt data 48 * @param rd result data
49 */ 49 */
50typedef void (*RecordLookupProcessor) (void *cls, 50typedef void (*RecordLookupProcessor) (void *cls,
51 uint32_t rd_count, 51 uint32_t rd_count,
@@ -70,7 +70,7 @@ typedef void (*ShortenResultProcessor) (void *cls, const char* name);
70typedef void (*GetAuthorityResultProcessor) (void *cls, const char* name); 70typedef void (*GetAuthorityResultProcessor) (void *cls, const char* name);
71 71
72/** 72/**
73 * processor for a resultion result 73 * processor for a resolution result
74 * 74 *
75 * @param cls the closure 75 * @param cls the closure
76 * @param rh the resolution handle 76 * @param rh the resolution handle
@@ -84,19 +84,27 @@ typedef void (*ResolutionResultProcessor) (void *cls,
84 84
85 85
86/** 86/**
87 * Resoltion status indicator 87 * Resolution status indicator
88 * EXISTS: the name to lookup exists 88 * RSL_RECORD_EXISTS: the name to lookup exists
89 * EXPIRED: the name in the record expired 89 * RSL_RECORD_EXPIRED: the name in the record expired
90 * RSL_TIMED_OUT: resolution timed out
90 */ 91 */
91enum ResolutionStatus 92enum ResolutionStatus
92{ 93{
93 EXISTS = 1, 94 RSL_RECORD_EXISTS = 1,
94 EXPIRED = 2, 95 RSL_RECORD_EXPIRED = 2,
95 TIMED_OUT = 4 96 RSL_TIMED_OUT = 4
96}; 97};
97 98
98/** 99/**
99 * Handle to a currenty pending resolution 100 * Handle to a currenty pending resolution
101 * a ResolverHandle is passed to, for example
102 * resolve_record_ns to resolve a record in the namestore.
103 * On result (positive or negative) the ResolutionResultProcessor
104 * is called.
105 * If a timeout is set timeout_cont will be called.
106 * If no timeout is set (ie timeout forever) then background resolutions
107 * might be triggered.
100 */ 108 */
101struct ResolverHandle 109struct ResolverHandle
102{ 110{
@@ -112,12 +120,6 @@ struct ResolverHandle
112 /* the name of the authoritative zone to query */ 120 /* the name of the authoritative zone to query */
113 char authority_name[MAX_DNS_LABEL_LENGTH]; 121 char authority_name[MAX_DNS_LABEL_LENGTH];
114 122
115 /**
116 * we have an authority in namestore that
117 * may be able to resolve
118 */
119 int authority_found;
120
121 /* a handle for dht lookups. should be NULL if no lookups are in progress */ 123 /* a handle for dht lookups. should be NULL if no lookups are in progress */
122 struct GNUNET_DHT_GetHandle *get_handle; 124 struct GNUNET_DHT_GetHandle *get_handle;
123 125
@@ -193,14 +195,11 @@ struct RecordLookupHandle
193 */ 195 */
194struct NameShortenHandle 196struct NameShortenHandle
195{ 197{
196
197
198 /* Method to call on shorten result */ 198 /* Method to call on shorten result */
199 ShortenResultProcessor proc; 199 ShortenResultProcessor proc;
200 200
201 /* closure to pass to proc */ 201 /* closure to pass to proc */
202 void* proc_cls; 202 void* proc_cls;
203
204}; 203};
205 204
206/** 205/**
@@ -208,7 +207,6 @@ struct NameShortenHandle
208 */ 207 */
209struct GetNameAuthorityHandle 208struct GetNameAuthorityHandle
210{ 209{
211
212 /* the name to look up authority for */ 210 /* the name to look up authority for */
213 char name[MAX_DNS_NAME_LENGTH]; 211 char name[MAX_DNS_NAME_LENGTH];
214 212
@@ -217,7 +215,6 @@ struct GetNameAuthorityHandle
217 215
218 /* closure to pass to proc */ 216 /* closure to pass to proc */
219 void* proc_cls; 217 void* proc_cls;
220
221}; 218};
222 219
223/** 220/**
@@ -276,7 +273,7 @@ gns_resolver_cleanup(ResolverCleanupContinuation cont);
276 273
277/** 274/**
278 * Lookup of a record in a specific zone 275 * Lookup of a record in a specific zone
279 * calls lookup result processor on result 276 * calls RecordLookupProcessor on result or timeout
280 * 277 *
281 * @param zone the root zone 278 * @param zone the root zone
282 * @param record_type the record type to look up 279 * @param record_type the record type to look up