diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-05 21:49:42 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-05 21:49:42 +0000 |
commit | 9b187e018ab2565f4ce119eda94f916ec053cc7e (patch) | |
tree | dc212a097dc9f6a9e2c0dd4f2b10bd577b834bff /src/include/gnunet_gns_service.h | |
parent | 3ed2943313b62b41fa92b90eb92d5bd9bbce7843 (diff) | |
download | gnunet-9b187e018ab2565f4ce119eda94f916ec053cc7e.tar.gz gnunet-9b187e018ab2565f4ce119eda94f916ec053cc7e.zip |
-started some gns service api
Diffstat (limited to 'src/include/gnunet_gns_service.h')
-rw-r--r-- | src/include/gnunet_gns_service.h | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index ee63c05cb..ba634df1d 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h | |||
@@ -57,6 +57,10 @@ struct GNUNET_GNS_Handle; | |||
57 | struct GNUNET_GNS_LookupHandle; | 57 | struct GNUNET_GNS_LookupHandle; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * Handle to control a shorten operation | ||
61 | */ | ||
62 | |||
63 | /** | ||
60 | * Record types | 64 | * Record types |
61 | * Based on GNUNET_DNSPARSER_TYPEs (standard DNS) | 65 | * Based on GNUNET_DNSPARSER_TYPEs (standard DNS) |
62 | */ | 66 | */ |
@@ -107,13 +111,13 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle); | |||
107 | * | 111 | * |
108 | * @param cls closure | 112 | * @param cls closure |
109 | * @param name "name" of the original lookup | 113 | * @param name "name" of the original lookup |
110 | * @param record the records in reply | 114 | * @param rd_count number of records |
111 | * @param num_records the number of records in reply | 115 | * @param rd the records in reply |
112 | */ | 116 | */ |
113 | typedef void (*GNUNET_GNS_LookupIterator) (void *cls, | 117 | typedef void (*GNUNET_GNS_LookupIterator) (void *cls, |
114 | const char * name, | 118 | const char * name, |
115 | const struct GNUNET_NAMESTORE_RecordData *record, | 119 | uint32_t rd_count, |
116 | unsigned int num_records); | 120 | const struct GNUNET_NAMESTORE_RecordData *rd); |
117 | 121 | ||
118 | 122 | ||
119 | 123 | ||
@@ -121,8 +125,6 @@ typedef void (*GNUNET_GNS_LookupIterator) (void *cls, | |||
121 | * Perform an asynchronous lookup operation on the GNS. | 125 | * Perform an asynchronous lookup operation on the GNS. |
122 | * | 126 | * |
123 | * @param handle handle to the GNS service | 127 | * @param handle handle to the GNS service |
124 | * @param timeout how long to wait for transmission of this request to the service | ||
125 | * // FIXME: what happens afterwards? | ||
126 | * @param name the name to look up | 128 | * @param name the name to look up |
127 | * @param type the GNUNET_GNS_RecordType to look for | 129 | * @param type the GNUNET_GNS_RecordType to look for |
128 | * @param iter function to call on each result | 130 | * @param iter function to call on each result |
@@ -132,7 +134,6 @@ typedef void (*GNUNET_GNS_LookupIterator) (void *cls, | |||
132 | */ | 134 | */ |
133 | struct GNUNET_GNS_LookupHandle * | 135 | struct GNUNET_GNS_LookupHandle * |
134 | GNUNET_GNS_lookup_start (struct GNUNET_GNS_Handle *handle, | 136 | GNUNET_GNS_lookup_start (struct GNUNET_GNS_Handle *handle, |
135 | struct GNUNET_TIME_Relative timeout, | ||
136 | const char * name, | 137 | const char * name, |
137 | enum GNUNET_GNS_RecordType type, | 138 | enum GNUNET_GNS_RecordType type, |
138 | GNUNET_GNS_LookupIterator iter, | 139 | GNUNET_GNS_LookupIterator iter, |
@@ -150,7 +151,37 @@ GNUNET_GNS_lookup_start (struct GNUNET_GNS_Handle *handle, | |||
150 | void | 151 | void |
151 | GNUNET_GNS_lookup_stop (struct GNUNET_GNS_LookupHandle *lookup_handle); | 152 | GNUNET_GNS_lookup_stop (struct GNUNET_GNS_LookupHandle *lookup_handle); |
152 | 153 | ||
154 | /* *************** Standard API: shorten ******************* */ | ||
153 | 155 | ||
156 | |||
157 | /** | ||
158 | * Processor called on for a name shortening result | ||
159 | * called only once | ||
160 | * | ||
161 | * @param cls closure | ||
162 | * @param name "name" of the original lookup | ||
163 | * @param short_name the shortened name or NULL if no result | ||
164 | */ | ||
165 | typedef void (*GNUNET_GNS_ShortenResultProcessor) (void *cls, | ||
166 | const char * name, | ||
167 | const char* short_name); | ||
168 | |||
169 | |||
170 | /** | ||
171 | * Perform a shorten operation on name using the GNS. | ||
172 | * | ||
173 | * @param handle handle to the GNS service | ||
174 | * @param name the name to shorten | ||
175 | * @param proc processor to call on result | ||
176 | * @param iter_cls closure for processor | ||
177 | * | ||
178 | * @return handle to the shorten operation | ||
179 | */ | ||
180 | struct GNUNET_GNS_ShortenHandle * | ||
181 | GNUNET_GNS_shorten (struct GNUNET_GNS_Handle *handle, | ||
182 | const char * name, | ||
183 | GNUNET_GNS_ShortenResultProcessor proc, | ||
184 | void *iter_cls); | ||
154 | #if 0 /* keep Emacsens' auto-indent happy */ | 185 | #if 0 /* keep Emacsens' auto-indent happy */ |
155 | { | 186 | { |
156 | #endif | 187 | #endif |