aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-16 12:29:57 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-16 12:29:57 +0000
commit8a5993b15da336afade45be6ee4619a39561956a (patch)
tree362f51ad0697f94ded8990cafd82ae7793d6c1be /src/transport
parentb0c00af6d9eee5788c0220da6e427e8bacf81637 (diff)
downloadgnunet-8a5993b15da336afade45be6ee4619a39561956a.tar.gz
gnunet-8a5993b15da336afade45be6ee4619a39561956a.zip
documentation for transport service
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport.c35
-rw-r--r--src/transport/gnunet-service-transport.h12
-rw-r--r--src/transport/gnunet-service-transport_clients.c13
-rw-r--r--src/transport/gnunet-service-transport_validation.h17
4 files changed, 32 insertions, 45 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 66f177145..76a398dc9 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -267,18 +267,12 @@ kill_session (const char *plugin_name, struct Session *session)
267 * Function called by the transport for each received message. 267 * Function called by the transport for each received message.
268 * 268 *
269 * @param cls closure, const char* with the name of the plugin we received the message from 269 * @param cls closure, const char* with the name of the plugin we received the message from
270 * @param peer (claimed) identity of the other peer 270 * @param address address and (claimed) identity of the other peer
271 * @param message the message, NULL if we only care about 271 * @param message the message, NULL if we only care about
272 * learning about the delay until we should receive again 272 * learning about the delay until we should receive again
273 * @param session identifier used for this session (NULL for plugins 273 * @param session identifier used for this session (NULL for plugins
274 * that do not offer bi-directional communication to the sender 274 * that do not offer bi-directional communication to the sender
275 * using the same "connection") 275 * using the same "connection")
276 * @param sender_address binary address of the sender (if we established the
277 * connection or are otherwise sure of it; should be NULL
278 * for inbound TCP/UDP connections since it it not clear
279 * that we could establish ourselves a connection to that
280 * IP address and get the same system)
281 * @param sender_address_len number of bytes in @a sender_address
282 * @return how long the plugin should wait until receiving more data 276 * @return how long the plugin should wait until receiving more data
283 * (plugins that do not support this, can ignore the return value) 277 * (plugins that do not support this, can ignore the return value)
284 */ 278 */
@@ -579,13 +573,10 @@ GST_ats_update_metrics (const struct GNUNET_PeerIdentity *peer,
579} 573}
580 574
581/** 575/**
582 * Function that will be called to figure if an address is an loopback, 576 * Function that will be called to update metrics for an address
583 * LAN, WAN etc. address
584 * 577 *
585 * @param cls closure 578 * @param cls closure
586 * @param peer the peer 579 * @param address address to update metrics for
587 * @param address binary address
588 * @param address_len length of the @a address
589 * @param session the session 580 * @param session the session
590 * @param ats the ats information to update 581 * @param ats the ats information to update
591 * @param ats_count the number of @a ats elements 582 * @param ats_count the number of @a ats elements
@@ -649,6 +640,7 @@ plugin_env_session_start (void *cls, struct GNUNET_HELLO_Address *address,
649 * actually happened. 640 * actually happened.
650 * 641 *
651 * @param cls closure 642 * @param cls closure
643 * @param peer the peer this address is intended for
652 * @param address address to use (for peer given in address) 644 * @param address address to use (for peer given in address)
653 * @param session session to use (if available) 645 * @param session session to use (if available)
654 * @param bandwidth_out assigned outbound bandwidth for the connection in NBO, 646 * @param bandwidth_out assigned outbound bandwidth for the connection in NBO,
@@ -659,11 +651,14 @@ plugin_env_session_start (void *cls, struct GNUNET_HELLO_Address *address,
659 * @param ats_count number of @a ats elements 651 * @param ats_count number of @a ats elements
660 */ 652 */
661static void 653static void
662ats_request_address_change (void *cls, const struct GNUNET_PeerIdentity *peer, 654ats_request_address_change (void *cls,
663 const struct GNUNET_HELLO_Address *address, struct Session *session, 655 const struct GNUNET_PeerIdentity *peer,
656 const struct GNUNET_HELLO_Address *address,
657 struct Session *session,
664 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 658 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
665 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 659 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
666 const struct GNUNET_ATS_Information *ats, uint32_t ats_count) 660 const struct GNUNET_ATS_Information *ats,
661 uint32_t ats_count)
667{ 662{
668 uint32_t bw_in = ntohl (bandwidth_in.value__); 663 uint32_t bw_in = ntohl (bandwidth_in.value__);
669 uint32_t bw_out = ntohl (bandwidth_out.value__); 664 uint32_t bw_out = ntohl (bandwidth_out.value__);
@@ -776,11 +771,11 @@ neighbours_changed_notification (void *cls,
776 * 771 *
777 * @param cls closure 772 * @param cls closure
778 * @param peer peer this update is about (never NULL) 773 * @param peer peer this update is about (never NULL)
779 * @param address address, NULL on disconnect 774 * @param address address (never NULL)
780 * @param state current state this peer is in 775 * @param last_validation point in time when last validation was performed
781 * @param state_timeout timeout for the current state of the peer 776 * @param valid_until point in time how long address is valid
782 * @param bandwidth_in bandwidth assigned inbound 777 * @param next_validation point in time when next validation will be performed
783 * @param bandwidth_out bandwidth assigned outbound 778 * @param state state of validation notification
784 */ 779 */
785static void 780static void
786validation_changed_notification (void *cls, 781validation_changed_notification (void *cls,
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h
index 34ed61f9e..67456bd46 100644
--- a/src/transport/gnunet-service-transport.h
+++ b/src/transport/gnunet-service-transport.h
@@ -82,22 +82,14 @@ typedef void
82 82
83/** 83/**
84 * Function called by the transport for each received message. 84 * Function called by the transport for each received message.
85 * This function should also be called with "NULL" for the
86 * message to signal that the other peer disconnected.
87 * 85 *
88 * @param cls closure, const char* with the name of the plugin we received the message from 86 * @param cls closure, const char* with the name of the plugin we received the message from
89 * @param peer (claimed) identity of the other peer 87 * @param address address and (claimed) identity of the other peer
90 * @param message the message, NULL if we only care about 88 * @param message the message, NULL if we only care about
91 * learning about the delay until we should receive again -- FIXME! 89 * learning about the delay until we should receive again
92 * @param session identifier used for this session (NULL for plugins 90 * @param session identifier used for this session (NULL for plugins
93 * that do not offer bi-directional communication to the sender 91 * that do not offer bi-directional communication to the sender
94 * using the same "connection") 92 * using the same "connection")
95 * @param sender_address binary address of the sender (if we established the
96 * connection or are otherwise sure of it; should be NULL
97 * for inbound TCP/UDP connections since it it not clear
98 * that we could establish ourselves a connection to that
99 * IP address and get the same system)
100 * @param sender_address_len number of bytes in sender_address
101 * @return how long the plugin should wait until receiving more data 93 * @return how long the plugin should wait until receiving more data
102 * (plugins that do not support this, can ignore the return value) 94 * (plugins that do not support this, can ignore the return value)
103 */ 95 */
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c
index aefe581c7..7b47bb6f5 100644
--- a/src/transport/gnunet-service-transport_clients.c
+++ b/src/transport/gnunet-service-transport_clients.c
@@ -262,6 +262,7 @@ setup_client (struct GNUNET_SERVER_Client *client)
262 * Find the handle to the monitoring client associated with the given 262 * Find the handle to the monitoring client associated with the given
263 * client handle 263 * client handle
264 * 264 *
265 * @param head the head of the client queue to look in
265 * @param client server's client handle to look up 266 * @param client server's client handle to look up
266 * @return handle to the monitoring client 267 * @return handle to the monitoring client
267 */ 268 */
@@ -1006,15 +1007,15 @@ struct IterationContext
1006}; 1007};
1007 1008
1008/** 1009/**
1009 * Output information of neighbours to the given client. 1010 * Output information of validation entries to the given client.
1010 * 1011 *
1011 * @param cls the 'struct PeerIterationContext' 1012 * @param cls the 'struct IterationContext'
1012 * @param peer identity of the neighbour 1013 * @param peer identity of the neighbour
1013 * @param address the address 1014 * @param address the address
1014 * @param state current state this peer is in 1015 * @param last_validation point in time when last validation was performed
1015 * @param state_timeout timeout for the current state of the peer 1016 * @param valid_until point in time how long address is valid
1016 * @param bandwidth_in inbound quota in NBO 1017 * @param next_validation point in time when next validation will be performed
1017 * @param bandwidth_out outbound quota in NBO 1018 * @param state state of validation notification
1018 */ 1019 */
1019static void 1020static void
1020send_validation_information (void *cls, 1021send_validation_information (void *cls,
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h
index d117faca5..179070454 100644
--- a/src/transport/gnunet-service-transport_validation.h
+++ b/src/transport/gnunet-service-transport_validation.h
@@ -32,17 +32,16 @@
32#include "gnunet_hello_lib.h" 32#include "gnunet_hello_lib.h"
33 33
34/** 34/**
35 * Function called for each address (or address status change) that 35 * Function called to notify transport users that a neighbour peer changed its
36 * the validation module is aware of (for the given target). 36 * active address.
37 * 37 *
38 * @param cls closure 38 * @param cls closure
39 * @param public_key public key for the peer, never NULL 39 * @param peer peer this update is about (never NULL)
40 * @param valid_until is ZERO if we never validated the address, 40 * @param address address (never NULL)
41 * otherwise a time up to when we consider it (or was) valid 41 * @param last_validation point in time when last validation was performed
42 * @param validation_block is FOREVER if the address is for an unsupported plugin (from PEERINFO) 42 * @param valid_until point in time how long address is valid
43 * is ZERO if the address is considered valid (no validation needed) 43 * @param next_validation point in time when next validation will be performed
44 * otherwise a time in the future if we're currently denying re-validation 44 * @param state state of validation notification
45 * @param address the address
46 */ 45 */
47typedef void (*GST_ValidationChangedCallback) (void *cls, 46typedef void (*GST_ValidationChangedCallback) (void *cls,
48 const struct GNUNET_PeerIdentity *peer, 47 const struct GNUNET_PeerIdentity *peer,