aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_gns_service.h
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2012-02-16 14:21:22 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2012-02-16 14:21:22 +0000
commitbd742f26f08fed45b48eeb1567447acd7a77d350 (patch)
tree4f526d6824b91946d3ec52b8e2d95292b75adea0 /src/include/gnunet_gns_service.h
parent758f38a2171dadd20328c7db93164bbcd46b72dc (diff)
downloadgnunet-bd742f26f08fed45b48eeb1567447acd7a77d350.tar.gz
gnunet-bd742f26f08fed45b48eeb1567447acd7a77d350.zip
- added makefile, borrowed lots of code from dht for client handling
Diffstat (limited to 'src/include/gnunet_gns_service.h')
-rw-r--r--src/include/gnunet_gns_service.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 405fcd2fc..235785116 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -49,13 +49,31 @@ struct GNUNET_GNS_Handle;
49struct GNUNET_GNS_LookupHandle; 49struct GNUNET_GNS_LookupHandle;
50 50
51/** 51/**
52 * A single GNS record.
53 */
54struct GNUNET_GNS_Record;
55
56/**
57 * Records types
58 */
59enum GNUNET_GNS_RecordType
60{
61 GNUNET_GNS_RECORD_A,
62 GNUNET_GNS_RECORD_AAAA,
63 GNUNET_GNS_RECORD_MX,
64 GNUNET_GNS_RECORD_PKEY
65};
66
67/**
52 * Initialize the connection with the GNS service. 68 * Initialize the connection with the GNS service.
53 * 69 *
54 * @param cfg configuration to use 70 * @param cfg configuration to use
71 * @param ht_len size of the internal hash table to use for parallel lookups
55 * @return NULL on error 72 * @return NULL on error
56 */ 73 */
57struct GNUNET_GNS_Handle * 74struct GNUNET_GNS_Handle *
58GNUNET_GNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); 75GNUNET_GNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg
76 unsigned int ht_len);
59 77
60 78
61/** 79/**
@@ -86,13 +104,12 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle);
86 * @param cont_cls closure for cont 104 * @param cont_cls closure for cont
87 */ 105 */
88void 106void
89GNUNET_GNS_add (struct GNUNET_GNS_Handle *handle, const GNUNET_HashCode * key, 107GNUNET_GNS_add_record (struct GNUNET_GNS_Handle *handle,
90 uint32_t desired_replication_level, 108 const char* name,
91 enum GNUNET_DHT_RouteOption options, 109 enum GNUNET_GNS_RecordType type,
92 enum GNUNET_BLOCK_Type type, size_t size, const char *data, 110 size_t size, const char *data,
93 struct GNUNET_TIME_Absolute exp, 111 struct GNUNET_TIME_Absolute exp,
94 struct GNUNET_TIME_Relative timeout, GNUNET_SCHEDULER_Task cont, 112 struct GNUNET_TIME_Relative timeout);
95 void *cont_cls);
96 113
97 114
98/** 115/**
@@ -102,23 +119,14 @@ GNUNET_GNS_add (struct GNUNET_GNS_Handle *handle, const GNUNET_HashCode * key,
102 * @param cls closure 119 * @param cls closure
103 * @param exp when will this value expire 120 * @param exp when will this value expire
104 * @param key key of the result 121 * @param key key of the result
105 * @param get_path peers on reply path (or NULL if not recorded) 122 * @param records the records in reply
106 * @param get_path_length number of entries in get_path 123 * @param num_records the number of records in reply
107 * @param put_path peers on the PUT path (or NULL if not recorded)
108 * @param put_path_length number of entries in get_path
109 * @param type type of the result 124 * @param type type of the result
110 * @param size number of bytes in data
111 * @param data pointer to the result data
112 */ 125 */
113typedef void (*GNUNET_GNS_LookupIterator) (void *cls, 126typedef void (*GNUNET_GNS_LookupIterator) (void *cls,
114 struct GNUNET_TIME_Absolute exp,
115 const GNUNET_HashCode * key, 127 const GNUNET_HashCode * key,
116 const struct GNUNET_PeerIdentity * 128 const struct GNUNET_GNS_Record *record,
117 get_path, unsigned int get_path_length, 129 unsigned int num_records);
118 const struct GNUNET_PeerIdentity *
119 put_path, unsigned int put_path_length,
120 enum GNUNET_BLOCK_Type type,
121 size_t size, const void *data);
122 130
123 131
124 132
@@ -142,10 +150,9 @@ typedef void (*GNUNET_GNS_LookupIterator) (void *cls,
142struct GNUNET_GNS_LookupHandle * 150struct GNUNET_GNS_LookupHandle *
143GNUNET_GNS_lookup_start (struct GNUNET_GNS_Handle *handle, 151GNUNET_GNS_lookup_start (struct GNUNET_GNS_Handle *handle,
144 struct GNUNET_TIME_Relative timeout, 152 struct GNUNET_TIME_Relative timeout,
145 enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key, 153 const char * name,
146 uint32_t desired_replication_level, 154 enum GNUNET_GNS_RecordType type,
147 enum GNUNET_DHT_RouteOption options, const void *xquery, 155 GNUNET_GNS_LookupIterator iter,
148 size_t xquery_size, GNUNET_GNS_LookupIterator iter,
149 void *iter_cls); 156 void *iter_cls);
150 157
151 158