diff options
-rw-r--r-- | src/include/gnunet_transport_plugin.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index dff95b80a..d367779e1 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h | |||
@@ -52,11 +52,11 @@ | |||
52 | * | 52 | * |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define GNUNET_ATS_ARRAY_TERMINATOR 0 | 55 | #define GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR 0 |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Enum defining all known property types for ATS | 58 | * Enum defining all known property types for ATS |
59 | * Enum values are used in the GNUNET_ATS_Information struct as (key,value)-pair | 59 | * Enum values are used in the GNUNET_TRANSPORT_ATS_Information struct as (key,value)-pair |
60 | * | 60 | * |
61 | * Cost are always stored in uint32_t, so all units used to define costs | 61 | * Cost are always stored in uint32_t, so all units used to define costs |
62 | * have to be normalized to fit in uint32_t [0 .. 4.294.967.295] | 62 | * have to be normalized to fit in uint32_t [0 .. 4.294.967.295] |
@@ -67,7 +67,7 @@ | |||
67 | * 2049..3072 : Values with a relation to availability | 67 | * 2049..3072 : Values with a relation to availability |
68 | * | 68 | * |
69 | */ | 69 | */ |
70 | enum GNUNET_ATS_Property | 70 | enum GNUNET_TRANSPORT_ATS_Property |
71 | { | 71 | { |
72 | 72 | ||
73 | /* Cost related values */ | 73 | /* Cost related values */ |
@@ -89,7 +89,7 @@ enum GNUNET_ATS_Property | |||
89 | * LAN: 0 [cent/MB] | 89 | * LAN: 0 [cent/MB] |
90 | * 2G : 10 [cent/MB] | 90 | * 2G : 10 [cent/MB] |
91 | */ | 91 | */ |
92 | GNUNET_ATS_COST_FINANCIAL_PER_VOLUME = 1, | 92 | GNUNET_TRANSPORT_ATS_COST_FINANCIAL_PER_VOLUME = 1, |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * Time based cost in financial units to transmit data | 95 | * Time based cost in financial units to transmit data |
@@ -107,7 +107,7 @@ enum GNUNET_ATS_Property | |||
107 | * LAN : 0 [cent/h] | 107 | * LAN : 0 [cent/h] |
108 | * Dialup: 10 [cent/h] | 108 | * Dialup: 10 [cent/h] |
109 | */ | 109 | */ |
110 | GNUNET_ATS_COST_FINANCIAL_PER_TIME = 2, | 110 | GNUNET_TRANSPORT_ATS_COST_FINANCIAL_PER_TIME = 2, |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * Computational costs | 113 | * Computational costs |
@@ -127,7 +127,7 @@ enum GNUNET_ATS_Property | |||
127 | * HTTPS with AES CBC-128: 5,279 | 127 | * HTTPS with AES CBC-128: 5,279 |
128 | * HTTPS with RC4-1024: 2,652 | 128 | * HTTPS with RC4-1024: 2,652 |
129 | */ | 129 | */ |
130 | GNUNET_ATS_COST_COMPUTATIONAL = 3, | 130 | GNUNET_TRANSPORT_ATS_COST_COMPUTATIONAL = 3, |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * Energy consumption | 133 | * Energy consumption |
@@ -156,7 +156,7 @@ enum GNUNET_ATS_Property | |||
156 | * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s) | 156 | * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s) |
157 | * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s) | 157 | * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s) |
158 | */ | 158 | */ |
159 | GNUNET_ATS_COST_ENERGY_CONSUMPTION = 4, | 159 | GNUNET_TRANSPORT_ATS_COST_ENERGY_CONSUMPTION = 4, |
160 | 160 | ||
161 | /** | 161 | /** |
162 | * Connect cost | 162 | * Connect cost |
@@ -179,7 +179,7 @@ enum GNUNET_ATS_Property | |||
179 | * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS | 179 | * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS |
180 | * | 180 | * |
181 | * */ | 181 | * */ |
182 | GNUNET_ATS_COST_CONNECT = 5, | 182 | GNUNET_TRANSPORT_ATS_COST_CONNECT = 5, |
183 | 183 | ||
184 | /** | 184 | /** |
185 | * Bandwidth cost | 185 | * Bandwidth cost |
@@ -197,7 +197,7 @@ enum GNUNET_ATS_Property | |||
197 | * Dial-up: 8 (64 Kbit/s) | 197 | * Dial-up: 8 (64 Kbit/s) |
198 | * | 198 | * |
199 | */ | 199 | */ |
200 | GNUNET_ATS_COST_BANDWITH_AVAILABLE = 6, | 200 | GNUNET_TRANSPORT_ATS_COST_BANDWITH_AVAILABLE = 6, |
201 | 201 | ||
202 | /** | 202 | /** |
203 | * Network overhead | 203 | * Network overhead |
@@ -218,7 +218,7 @@ enum GNUNET_ATS_Property | |||
218 | * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb] | 218 | * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb] |
219 | * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] | 219 | * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] |
220 | */ | 220 | */ |
221 | GNUNET_ATS_COST_NETWORK_OVERHEAD = 7, | 221 | GNUNET_TRANSPORT_ATS_COST_NETWORK_OVERHEAD = 7, |
222 | 222 | ||
223 | 223 | ||
224 | /* Quality related values */ | 224 | /* Quality related values */ |
@@ -231,21 +231,21 @@ enum GNUNET_ATS_Property | |||
231 | * | 231 | * |
232 | * Unit: [dBm] | 232 | * Unit: [dBm] |
233 | */ | 233 | */ |
234 | GNUNET_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025, | 234 | GNUNET_TRANSPORT_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025, |
235 | 235 | ||
236 | /** | 236 | /** |
237 | * Collision rate on physical layer | 237 | * Collision rate on physical layer |
238 | * | 238 | * |
239 | * Unit: [B/s] | 239 | * Unit: [B/s] |
240 | */ | 240 | */ |
241 | GNUNET_ATS_QUALITY_PHY_COLLISION_RATE = 1026, | 241 | GNUNET_TRANSPORT_ATS_QUALITY_PHY_COLLISION_RATE = 1026, |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * Error rate on physical layer | 244 | * Error rate on physical layer |
245 | * | 245 | * |
246 | * Unit: [B/s] | 246 | * Unit: [B/s] |
247 | */ | 247 | */ |
248 | GNUNET_ATS_QUALITY_PHY_ERROR_RATE = 1027, | 248 | GNUNET_TRANSPORT_ATS_QUALITY_PHY_ERROR_RATE = 1027, |
249 | 249 | ||
250 | /* Network layer quality properties */ | 250 | /* Network layer quality properties */ |
251 | 251 | ||
@@ -261,7 +261,7 @@ enum GNUNET_ATS_Property | |||
261 | * Dialup: 4000 | 261 | * Dialup: 4000 |
262 | * WLAN : 7000 | 262 | * WLAN : 7000 |
263 | */ | 263 | */ |
264 | GNUNET_ATS_QUALITY_NET_DELAY = 1028, | 264 | GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY = 1028, |
265 | 265 | ||
266 | /** | 266 | /** |
267 | * Jitter | 267 | * Jitter |
@@ -270,7 +270,7 @@ enum GNUNET_ATS_Property | |||
270 | * | 270 | * |
271 | * Unit: [μs] | 271 | * Unit: [μs] |
272 | */ | 272 | */ |
273 | GNUNET_ATS_QUALITY_NET_JITTER = 1029, | 273 | GNUNET_TRANSPORT_ATS_QUALITY_NET_JITTER = 1029, |
274 | 274 | ||
275 | /** | 275 | /** |
276 | * Error rate on network layer | 276 | * Error rate on network layer |
@@ -285,7 +285,7 @@ enum GNUNET_ATS_Property | |||
285 | * Note: This numbers are just assumptions as an example, not | 285 | * Note: This numbers are just assumptions as an example, not |
286 | * measured or somehow determined | 286 | * measured or somehow determined |
287 | */ | 287 | */ |
288 | GNUNET_ATS_QUALITY_NET_ERRORRATE = 1030, | 288 | GNUNET_TRANSPORT_ATS_QUALITY_NET_ERRORRATE = 1030, |
289 | 289 | ||
290 | /** | 290 | /** |
291 | * Drop rate on network layer | 291 | * Drop rate on network layer |
@@ -302,7 +302,7 @@ enum GNUNET_ATS_Property | |||
302 | * Note: This numbers are just assumptions as an example, not | 302 | * Note: This numbers are just assumptions as an example, not |
303 | * measured or somehow determined | 303 | * measured or somehow determined |
304 | */ | 304 | */ |
305 | GNUNET_ATS_QUALITY_NET_DROPRATE = 1031, | 305 | GNUNET_TRANSPORT_ATS_QUALITY_NET_DROPRATE = 1031, |
306 | 306 | ||
307 | /** | 307 | /** |
308 | * Loss rate on network layer | 308 | * Loss rate on network layer |
@@ -319,7 +319,7 @@ enum GNUNET_ATS_Property | |||
319 | * Note: This numbers are just assumptions as an example, not measured | 319 | * Note: This numbers are just assumptions as an example, not measured |
320 | * or somehow determined | 320 | * or somehow determined |
321 | */ | 321 | */ |
322 | GNUNET_ATS_QUALITY_NET_LOSSRATE = 1032, | 322 | GNUNET_TRANSPORT_ATS_QUALITY_NET_LOSSRATE = 1032, |
323 | 323 | ||
324 | /** | 324 | /** |
325 | * Throughput on network layer | 325 | * Throughput on network layer |
@@ -333,7 +333,7 @@ enum GNUNET_ATS_Property | |||
333 | * Dialup: 4 | 333 | * Dialup: 4 |
334 | * | 334 | * |
335 | */ | 335 | */ |
336 | GNUNET_ATS_QUALITY_NET_THROUGHPUT = 1033, | 336 | GNUNET_TRANSPORT_ATS_QUALITY_NET_THROUGHPUT = 1033, |
337 | 337 | ||
338 | /* Availability related values */ | 338 | /* Availability related values */ |
339 | /* =========================== */ | 339 | /* =========================== */ |
@@ -341,22 +341,22 @@ enum GNUNET_ATS_Property | |||
341 | /** | 341 | /** |
342 | * Is a peer reachable? | 342 | * Is a peer reachable? |
343 | */ | 343 | */ |
344 | GNUNET_ATS_AVAILABILITY_REACHABLE = 2048, | 344 | GNUNET_TRANSPORT_ATS_AVAILABILITY_REACHABLE = 2048, |
345 | 345 | ||
346 | /** | 346 | /** |
347 | * Is there a connection established to a peer using this transport | 347 | * Is there a connection established to a peer using this transport |
348 | */ | 348 | */ |
349 | GNUNET_ATS_AVAILABILITY_CONNECTED = 2049 | 349 | GNUNET_TRANSPORT_ATS_AVAILABILITY_CONNECTED = 2049 |
350 | }; | 350 | }; |
351 | 351 | ||
352 | /** | 352 | /** |
353 | * This structure will be used by plugins to communicate costs to ATS or by | 353 | * This structure will be used by plugins to communicate costs to ATS or by |
354 | * higher level components to tell ATS their constraints. | 354 | * higher level components to tell ATS their constraints. |
355 | * Always a pair of (GNUNET_ATS_Property, uint32_t value). | 355 | * Always a pair of (GNUNET_TRANSPORT_ATS_Property, uint32_t value). |
356 | * Value is always uint32_t, so all units used to define costs have to | 356 | * Value is always uint32_t, so all units used to define costs have to |
357 | * be normalized to fit uint32_t. | 357 | * be normalized to fit uint32_t. |
358 | */ | 358 | */ |
359 | struct GNUNET_ATS_Information | 359 | struct GNUNET_TRANSPORT_ATS_Information |
360 | { | 360 | { |
361 | /** | 361 | /** |
362 | * ATS property type | 362 | * ATS property type |
@@ -494,21 +494,21 @@ typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void *cls | |||
494 | /** | 494 | /** |
495 | * Function called whenever the plugin has to notify ATS about costs for using this transport | 495 | * Function called whenever the plugin has to notify ATS about costs for using this transport |
496 | * | 496 | * |
497 | * The cost will be passed as struct GNUNET_ATS_Cost_Information[] | 497 | * The cost will be passed as struct GNUNET_TRANSPORT_ATS_Cost_Information[] |
498 | * This array is 0-terminated, so the last element will be a pair: | 498 | * This array is 0-terminated, so the last element will be a pair: |
499 | * ((cost->cost_type==GNUNET_ATS_ARRAY_TERMINATOR) && cost->cost_value==0)) | 499 | * ((cost->cost_type==GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) && cost->cost_value==0)) |
500 | * | 500 | * |
501 | * @param cls closure | 501 | * @param cls closure |
502 | * @param peer peer | 502 | * @param peer peer |
503 | * @param addr peer address | 503 | * @param addr peer address |
504 | * @param addrlen address length | 504 | * @param addrlen address length |
505 | * @param cost pointer to the first element of struct GNUNET_ATS_Cost_Information[] | 505 | * @param cost pointer to the first element of struct GNUNET_TRANSPORT_ATS_Cost_Information[] |
506 | */ | 506 | */ |
507 | typedef void (*GNUNET_TRANSPORT_CostReport) (void *cls, | 507 | typedef void (*GNUNET_TRANSPORT_CostReport) (void *cls, |
508 | const struct GNUNET_PeerIdentity *peer, | 508 | const struct GNUNET_PeerIdentity *peer, |
509 | const void *addr, | 509 | const void *addr, |
510 | uint16_t addrlen, | 510 | uint16_t addrlen, |
511 | struct GNUNET_ATS_Information * cost); | 511 | struct GNUNET_TRANSPORT_ATS_Information * cost); |
512 | 512 | ||
513 | /** | 513 | /** |
514 | * The transport service will pass a pointer to a struct | 514 | * The transport service will pass a pointer to a struct |