aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_transport_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_transport_service.h')
-rw-r--r--src/include/gnunet_transport_service.h147
1 files changed, 77 insertions, 70 deletions
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 0e17a0135..f4cc88e55 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -90,7 +90,7 @@ enum GNUNET_TRANSPORT_ATS_Property
90 * 2G : 10 [cent/MB] 90 * 2G : 10 [cent/MB]
91 */ 91 */
92 GNUNET_TRANSPORT_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
96 * 96 *
@@ -108,7 +108,7 @@ enum GNUNET_TRANSPORT_ATS_Property
108 * Dialup: 10 [cent/h] 108 * Dialup: 10 [cent/h]
109 */ 109 */
110 GNUNET_TRANSPORT_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
114 * 114 *
@@ -128,7 +128,7 @@ enum GNUNET_TRANSPORT_ATS_Property
128 * HTTPS with RC4-1024: 2,652 128 * HTTPS with RC4-1024: 2,652
129 */ 129 */
130 GNUNET_TRANSPORT_ATS_COST_COMPUTATIONAL = 3, 130 GNUNET_TRANSPORT_ATS_COST_COMPUTATIONAL = 3,
131 131
132 /** 132 /**
133 * Energy consumption 133 * Energy consumption
134 * 134 *
@@ -157,7 +157,7 @@ enum GNUNET_TRANSPORT_ATS_Property
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_TRANSPORT_ATS_COST_ENERGY_CONSUMPTION = 4, 159 GNUNET_TRANSPORT_ATS_COST_ENERGY_CONSUMPTION = 4,
160 160
161 /** 161 /**
162 * Connect cost 162 * Connect cost
163 * How many bytes are transmitted to initiate a new connection using 163 * How many bytes are transmitted to initiate a new connection using
@@ -180,7 +180,7 @@ enum GNUNET_TRANSPORT_ATS_Property
180 * 180 *
181 * */ 181 * */
182 GNUNET_TRANSPORT_ATS_COST_CONNECT = 5, 182 GNUNET_TRANSPORT_ATS_COST_CONNECT = 5,
183 183
184 /** 184 /**
185 * Bandwidth cost 185 * Bandwidth cost
186 * 186 *
@@ -198,7 +198,7 @@ enum GNUNET_TRANSPORT_ATS_Property
198 * 198 *
199 */ 199 */
200 GNUNET_TRANSPORT_ATS_COST_BANDWITH_AVAILABLE = 6, 200 GNUNET_TRANSPORT_ATS_COST_BANDWITH_AVAILABLE = 6,
201 201
202 /** 202 /**
203 * Network overhead 203 * Network overhead
204 * 204 *
@@ -219,36 +219,36 @@ enum GNUNET_TRANSPORT_ATS_Property
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_TRANSPORT_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 */
225 /* ====================== */ 225 /* ====================== */
226 226
227 /* Physical layer quality properties */ 227 /* Physical layer quality properties */
228 228
229 /** 229 /**
230 * Signal strength on physical layer 230 * Signal strength on physical layer
231 * 231 *
232 * Unit: [dBm] 232 * Unit: [dBm]
233 */ 233 */
234 GNUNET_TRANSPORT_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_TRANSPORT_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_TRANSPORT_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
252 /** 252 /**
253 * Delay 253 * Delay
254 * Time between when the time packet is sent and the packet arrives 254 * Time between when the time packet is sent and the packet arrives
@@ -262,7 +262,7 @@ enum GNUNET_TRANSPORT_ATS_Property
262 * Dialup: 500 262 * Dialup: 500
263 */ 263 */
264 GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY = 1028, 264 GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY = 1028,
265 265
266 /** 266 /**
267 * Jitter 267 * Jitter
268 * Time variations of the delay 268 * Time variations of the delay
@@ -271,7 +271,7 @@ enum GNUNET_TRANSPORT_ATS_Property
271 * Unit: [ms] 271 * Unit: [ms]
272 */ 272 */
273 GNUNET_TRANSPORT_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
277 * 277 *
@@ -286,7 +286,7 @@ enum GNUNET_TRANSPORT_ATS_Property
286 * measured or somehow determined 286 * measured or somehow determined
287 */ 287 */
288 GNUNET_TRANSPORT_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
292 * Bytes actively dismissed by a network component during transmission 292 * Bytes actively dismissed by a network component during transmission
@@ -303,7 +303,7 @@ enum GNUNET_TRANSPORT_ATS_Property
303 * measured or somehow determined 303 * measured or somehow determined
304 */ 304 */
305 GNUNET_TRANSPORT_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
309 * Bytes lost during transmission 309 * Bytes lost during transmission
@@ -320,7 +320,7 @@ enum GNUNET_TRANSPORT_ATS_Property
320 * or somehow determined 320 * or somehow determined
321 */ 321 */
322 GNUNET_TRANSPORT_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
326 * 326 *
@@ -334,7 +334,7 @@ enum GNUNET_TRANSPORT_ATS_Property
334 * 334 *
335 */ 335 */
336 GNUNET_TRANSPORT_ATS_QUALITY_NET_THROUGHPUT = 1033, 336 GNUNET_TRANSPORT_ATS_QUALITY_NET_THROUGHPUT = 1033,
337 337
338 /** 338 /**
339 * Distance on network layer 339 * Distance on network layer
340 * 340 *
@@ -345,17 +345,16 @@ enum GNUNET_TRANSPORT_ATS_Property
345 345
346 /* Availability related values */ 346 /* Availability related values */
347 /* =========================== */ 347 /* =========================== */
348 348
349 /** 349 /**
350 * Is a peer reachable? 350 * Is a peer reachable?
351 */ 351 */
352 GNUNET_TRANSPORT_ATS_AVAILABILITY_REACHABLE = 2048, 352 GNUNET_TRANSPORT_ATS_AVAILABILITY_REACHABLE = 2048,
353 353
354 /** 354 /**
355 * Is there a connection established to a peer using this transport 355 * Is there a connection established to a peer using this transport
356 */ 356 */
357 GNUNET_TRANSPORT_ATS_AVAILABILITY_CONNECTED = 2049 357 GNUNET_TRANSPORT_ATS_AVAILABILITY_CONNECTED = 2049
358
359}; 358};
360 359
361 360
@@ -383,7 +382,7 @@ struct GNUNET_TRANSPORT_ATS_Information
383 * ATS property type, in network byte order. 382 * ATS property type, in network byte order.
384 */ 383 */
385 uint32_t type; 384 uint32_t type;
386 385
387 /** 386 /**
388 * ATS property value, in network byte order. 387 * ATS property value, in network byte order.
389 */ 388 */
@@ -407,8 +406,9 @@ typedef void (*GNUNET_TRANSPORT_ReceiveCallback) (void *cls,
407 const struct 406 const struct
408 GNUNET_MessageHeader * 407 GNUNET_MessageHeader *
409 message, 408 message,
410 const struct GNUNET_TRANSPORT_ATS_Information *ats, 409 const struct
411 uint32_t ats_count); 410 GNUNET_TRANSPORT_ATS_Information
411 * ats, uint32_t ats_count);
412 412
413 413
414/** 414/**
@@ -427,10 +427,11 @@ struct GNUNET_TRANSPORT_Handle;
427 * @param ats_count number of entries in ats (excluding 0-termination) 427 * @param ats_count number of entries in ats (excluding 0-termination)
428 */ 428 */
429typedef void 429typedef void
430 (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, 430 (*GNUNET_TRANSPORT_NotifyConnect) (void *cls,
431 const struct GNUNET_PeerIdentity * peer, 431 const struct GNUNET_PeerIdentity * peer,
432 const struct GNUNET_TRANSPORT_ATS_Information *ats, 432 const struct
433 uint32_t ats_count); 433 GNUNET_TRANSPORT_ATS_Information * ats,
434 uint32_t ats_count);
434 435
435/** 436/**
436 * Function called to notify transport users that another 437 * Function called to notify transport users that another
@@ -440,9 +441,9 @@ typedef void
440 * @param peer the peer that disconnected 441 * @param peer the peer that disconnected
441 */ 442 */
442typedef void 443typedef void
443 (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, 444 (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls,
444 const struct GNUNET_PeerIdentity * 445 const struct GNUNET_PeerIdentity *
445 peer); 446 peer);
446 447
447 448
448/** 449/**
@@ -452,8 +453,7 @@ typedef void
452 * @param address NULL on error, otherwise 0-terminated printable UTF-8 string 453 * @param address NULL on error, otherwise 0-terminated printable UTF-8 string
453 */ 454 */
454typedef void 455typedef void
455(*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, 456 (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, const char *address);
456 const char *address);
457 457
458 458
459/** 459/**
@@ -471,9 +471,10 @@ typedef void
471 */ 471 */
472struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct 472struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct
473 GNUNET_CONFIGURATION_Handle 473 GNUNET_CONFIGURATION_Handle
474 *cfg, 474 *cfg,
475 const struct GNUNET_PeerIdentity *self, 475 const struct
476 void *cls, 476 GNUNET_PeerIdentity
477 *self, void *cls,
477 GNUNET_TRANSPORT_ReceiveCallback 478 GNUNET_TRANSPORT_ReceiveCallback
478 rec, 479 rec,
479 GNUNET_TRANSPORT_NotifyConnect 480 GNUNET_TRANSPORT_NotifyConnect
@@ -499,7 +500,7 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle);
499 */ 500 */
500void 501void
501GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, 502GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle,
502 const struct GNUNET_PeerIdentity *target); 503 const struct GNUNET_PeerIdentity *target);
503 504
504 505
505/** 506/**
@@ -544,15 +545,15 @@ struct GNUNET_TRANSPORT_TransmitHandle;
544 * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) 545 * using GNUNET_TRANSPORT_notify_transmit_ready_cancel)
545 */ 546 */
546struct GNUNET_TRANSPORT_TransmitHandle 547struct GNUNET_TRANSPORT_TransmitHandle
547 *GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle 548 *GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle
548 *handle, 549 *handle,
549 const struct GNUNET_PeerIdentity 550 const struct GNUNET_PeerIdentity
550 *target, size_t size, 551 *target, size_t size,
551 uint32_t priority, 552 uint32_t priority,
552 struct GNUNET_TIME_Relative 553 struct GNUNET_TIME_Relative
553 timeout, 554 timeout,
554 GNUNET_CONNECTION_TransmitReadyNotify 555 GNUNET_CONNECTION_TransmitReadyNotify
555 notify, void *notify_cls); 556 notify, void *notify_cls);
556 557
557 558
558/** 559/**
@@ -574,8 +575,10 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct
574 * @param cls closure 575 * @param cls closure
575 * @param hello our updated HELLO 576 * @param hello our updated HELLO
576 */ 577 */
577typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback)(void *cls, 578typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls,
578 const struct GNUNET_MessageHeader *hello); 579 const struct
580 GNUNET_MessageHeader *
581 hello);
579 582
580 583
581/** 584/**
@@ -600,8 +603,8 @@ GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle,
600 */ 603 */
601void 604void
602GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, 605GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle,
603 GNUNET_TRANSPORT_HelloUpdateCallback rec, 606 GNUNET_TRANSPORT_HelloUpdateCallback rec,
604 void *rec_cls); 607 void *rec_cls);
605 608
606 609
607/** 610/**
@@ -618,8 +621,7 @@ GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle,
618void 621void
619GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, 622GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
620 const struct GNUNET_MessageHeader *hello, 623 const struct GNUNET_MessageHeader *hello,
621 GNUNET_SCHEDULER_Task cont, 624 GNUNET_SCHEDULER_Task cont, void *cls);
622 void *cls);
623 625
624 626
625/** 627/**
@@ -637,13 +639,13 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
637 */ 639 */
638void 640void
639GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, 641GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
640 const char * address, 642 const char *address,
641 size_t addressLen, 643 size_t addressLen,
642 int numeric, 644 int numeric,
643 const char *nameTrans, 645 const char *nameTrans,
644 struct GNUNET_TIME_Relative timeout, 646 struct GNUNET_TIME_Relative timeout,
645 GNUNET_TRANSPORT_AddressLookUpCallback aluc, 647 GNUNET_TRANSPORT_AddressLookUpCallback aluc,
646 void *aluc_cls); 648 void *aluc_cls);
647 649
648 650
649/** 651/**
@@ -657,10 +659,12 @@ GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
657 * @param peer_address_callback_cls closure for peer_address_callback 659 * @param peer_address_callback_cls closure for peer_address_callback
658 */ 660 */
659void 661void
660GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, 662GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle
663 *cfg,
661 const struct GNUNET_PeerIdentity *peer, 664 const struct GNUNET_PeerIdentity *peer,
662 struct GNUNET_TIME_Relative timeout, 665 struct GNUNET_TIME_Relative timeout,
663 GNUNET_TRANSPORT_AddressLookUpCallback peer_address_callback, 666 GNUNET_TRANSPORT_AddressLookUpCallback
667 peer_address_callback,
664 void *peer_address_callback_cls); 668 void *peer_address_callback_cls);
665 669
666 670
@@ -676,7 +680,8 @@ GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle *
676void 680void
677GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, 681GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
678 struct GNUNET_TIME_Relative timeout, 682 struct GNUNET_TIME_Relative timeout,
679 GNUNET_TRANSPORT_AddressLookUpCallback peer_address_callback, 683 GNUNET_TRANSPORT_AddressLookUpCallback
684 peer_address_callback,
680 void *peer_address_callback_cls); 685 void *peer_address_callback_cls);
681 686
682 687
@@ -693,8 +698,9 @@ struct GNUNET_TRANSPORT_Blacklist;
693 * @param pid peer to approve or disapproave 698 * @param pid peer to approve or disapproave
694 * @return GNUNET_OK if the connection is allowed 699 * @return GNUNET_OK if the connection is allowed
695 */ 700 */
696typedef int (*GNUNET_TRANSPORT_BlacklistCallback)(void *cls, 701typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls,
697 const struct GNUNET_PeerIdentity *pid); 702 const struct
703 GNUNET_PeerIdentity * pid);
698 704
699 705
700/** 706/**
@@ -711,10 +717,12 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback)(void *cls,
711 * @param cb_cls closure for cb 717 * @param cb_cls closure for cb
712 * @return NULL on error, otherwise handle for cancellation 718 * @return NULL on error, otherwise handle for cancellation
713 */ 719 */
714struct GNUNET_TRANSPORT_Blacklist * 720struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct
715GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, 721 GNUNET_CONFIGURATION_Handle
716 GNUNET_TRANSPORT_BlacklistCallback cb, 722 *cfg,
717 void *cb_cls); 723 GNUNET_TRANSPORT_BlacklistCallback
724 cb,
725 void *cb_cls);
718 726
719 727
720/** 728/**
@@ -723,8 +731,7 @@ GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg,
723 * 731 *
724 * @param br handle of the request that is to be cancelled 732 * @param br handle of the request that is to be cancelled
725 */ 733 */
726void 734void GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br);
727GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br);
728 735
729 736
730 737