diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-06-20 11:58:33 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-06-20 11:58:33 +0000 |
commit | 06cab49a558c4df862f6a4277e68f083c18d670f (patch) | |
tree | 966a29500f511bea4f6c655913de0d6da8ca345d /src/namestore | |
parent | e0d8d7ff0b129f9d8110e810856399971406773d (diff) | |
download | gnunet-06cab49a558c4df862f6a4277e68f083c18d670f.tar.gz gnunet-06cab49a558c4df862f6a4277e68f083c18d670f.zip |
- docu
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 250e2b812..a6be01af0 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -38,16 +38,46 @@ | |||
38 | */ | 38 | */ |
39 | struct GNUNET_NAMESTORE_ZoneIteration | 39 | struct GNUNET_NAMESTORE_ZoneIteration |
40 | { | 40 | { |
41 | /** | ||
42 | * Next element in the DLL | ||
43 | */ | ||
41 | struct GNUNET_NAMESTORE_ZoneIteration *next; | 44 | struct GNUNET_NAMESTORE_ZoneIteration *next; |
45 | |||
46 | /** | ||
47 | * Previous element in the DLL | ||
48 | */ | ||
42 | struct GNUNET_NAMESTORE_ZoneIteration *prev; | 49 | struct GNUNET_NAMESTORE_ZoneIteration *prev; |
43 | 50 | ||
51 | /** | ||
52 | * Namestore client which intiated this zone iteration | ||
53 | */ | ||
44 | struct GNUNET_NAMESTORE_Client * client; | 54 | struct GNUNET_NAMESTORE_Client * client; |
45 | 55 | ||
56 | /** | ||
57 | * GNUNET_YES if we iterate over a specific zone | ||
58 | * GNUNET_NO if we iterate over all zones | ||
59 | */ | ||
46 | int has_zone; | 60 | int has_zone; |
47 | 61 | ||
62 | /** | ||
63 | * Hash of the specific zone if 'has_zone' is GNUNET_YES, | ||
64 | * othwerwise set to '\0' | ||
65 | */ | ||
48 | struct GNUNET_CRYPTO_ShortHashCode zone; | 66 | struct GNUNET_CRYPTO_ShortHashCode zone; |
49 | 67 | ||
68 | /** | ||
69 | * The operation id fot the zone iteration in the response for the client | ||
70 | */ | ||
50 | uint64_t request_id; | 71 | uint64_t request_id; |
72 | |||
73 | /** | ||
74 | * Offset of the zone iteration used to address next result of the zone | ||
75 | * iteration in the store | ||
76 | * | ||
77 | * Initialy set to 0 in handle_iteration_start | ||
78 | * Incremented with by every call to handle_iteration_next | ||
79 | * | ||
80 | */ | ||
51 | uint32_t offset; | 81 | uint32_t offset; |
52 | 82 | ||
53 | /** | 83 | /** |
@@ -67,21 +97,58 @@ struct GNUNET_NAMESTORE_ZoneIteration | |||
67 | */ | 97 | */ |
68 | struct GNUNET_NAMESTORE_Client | 98 | struct GNUNET_NAMESTORE_Client |
69 | { | 99 | { |
100 | /** | ||
101 | * Next element in the DLL | ||
102 | */ | ||
70 | struct GNUNET_NAMESTORE_Client *next; | 103 | struct GNUNET_NAMESTORE_Client *next; |
104 | |||
105 | /** | ||
106 | * Previous element in the DLL | ||
107 | */ | ||
71 | struct GNUNET_NAMESTORE_Client *prev; | 108 | struct GNUNET_NAMESTORE_Client *prev; |
72 | 109 | ||
110 | /** | ||
111 | * The client | ||
112 | */ | ||
73 | struct GNUNET_SERVER_Client * client; | 113 | struct GNUNET_SERVER_Client * client; |
74 | 114 | ||
115 | /** | ||
116 | * Head of the DLL of | ||
117 | * Zone iteration operations in progress initiated by this client | ||
118 | */ | ||
75 | struct GNUNET_NAMESTORE_ZoneIteration *op_head; | 119 | struct GNUNET_NAMESTORE_ZoneIteration *op_head; |
120 | |||
121 | /** | ||
122 | * Tail of the DLL of | ||
123 | * Zone iteration operations in progress initiated by this client | ||
124 | */ | ||
76 | struct GNUNET_NAMESTORE_ZoneIteration *op_tail; | 125 | struct GNUNET_NAMESTORE_ZoneIteration *op_tail; |
77 | }; | 126 | }; |
78 | 127 | ||
128 | |||
129 | /** | ||
130 | * A container struct to store information belonging to a zone crypto key pair | ||
131 | */ | ||
79 | struct GNUNET_NAMESTORE_CryptoContainer | 132 | struct GNUNET_NAMESTORE_CryptoContainer |
80 | { | 133 | { |
134 | /** | ||
135 | * Filename where to store the container | ||
136 | */ | ||
81 | char * filename; | 137 | char * filename; |
82 | 138 | ||
139 | /** | ||
140 | * Short hash of the zone's public key | ||
141 | */ | ||
83 | struct GNUNET_CRYPTO_ShortHashCode zone; | 142 | struct GNUNET_CRYPTO_ShortHashCode zone; |
143 | |||
144 | /** | ||
145 | * Zone's private key | ||
146 | */ | ||
84 | struct GNUNET_CRYPTO_RsaPrivateKey *privkey; | 147 | struct GNUNET_CRYPTO_RsaPrivateKey *privkey; |
148 | |||
149 | /** | ||
150 | * Zone's public key | ||
151 | */ | ||
85 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pubkey; | 152 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pubkey; |
86 | }; | 153 | }; |
87 | 154 | ||
@@ -101,6 +168,9 @@ struct GNUNET_NAMESTORE_PluginFunctions *GSN_database; | |||
101 | */ | 168 | */ |
102 | static char *zonefile_directory; | 169 | static char *zonefile_directory; |
103 | 170 | ||
171 | /** | ||
172 | * Name of the database plugin | ||
173 | */ | ||
104 | static char *db_lib_name; | 174 | static char *db_lib_name; |
105 | 175 | ||
106 | 176 | ||
@@ -109,9 +179,22 @@ static char *db_lib_name; | |||
109 | */ | 179 | */ |
110 | static struct GNUNET_SERVER_NotificationContext *snc; | 180 | static struct GNUNET_SERVER_NotificationContext *snc; |
111 | 181 | ||
182 | /** | ||
183 | * Head of the Client DLL | ||
184 | */ | ||
112 | static struct GNUNET_NAMESTORE_Client *client_head; | 185 | static struct GNUNET_NAMESTORE_Client *client_head; |
186 | |||
187 | /** | ||
188 | * Tail of the Client DLL | ||
189 | */ | ||
113 | static struct GNUNET_NAMESTORE_Client *client_tail; | 190 | static struct GNUNET_NAMESTORE_Client *client_tail; |
114 | 191 | ||
192 | /** | ||
193 | * Hashmap containing the zone keys this namestore has is authoritative for | ||
194 | * | ||
195 | * Keys are the GNUNET_CRYPTO_HashCode of the GNUNET_CRYPTO_ShortHashCode | ||
196 | * The values are 'struct GNUNET_NAMESTORE_CryptoContainer *' | ||
197 | */ | ||
115 | struct GNUNET_CONTAINER_MultiHashMap *zonekeys; | 198 | struct GNUNET_CONTAINER_MultiHashMap *zonekeys; |
116 | 199 | ||
117 | 200 | ||