aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_validation.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-22 19:57:22 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-22 19:57:22 +0000
commit658f44879747d23c92e30ca004b04e2dddac73d8 (patch)
treec3e225cc738cc9588393c6de2b908b4f6e4b9f04 /src/transport/gnunet-service-transport_validation.h
parent58121840c21ad0a64d6e2b11dd01f50064ca1773 (diff)
downloadgnunet-658f44879747d23c92e30ca004b04e2dddac73d8.tar.gz
gnunet-658f44879747d23c92e30ca004b04e2dddac73d8.zip
-simplify logic a bit, doxygen, indentation
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.h')
-rw-r--r--src/transport/gnunet-service-transport_validation.h72
1 files changed, 35 insertions, 37 deletions
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h
index 71c095c1b..df2ef0ee8 100644
--- a/src/transport/gnunet-service-transport_validation.h
+++ b/src/transport/gnunet-service-transport_validation.h
@@ -32,35 +32,12 @@
32#include "gnunet_hello_lib.h" 32#include "gnunet_hello_lib.h"
33 33
34/** 34/**
35 * Function called to notify transport users that a neighbour peer changed its
36 * active address.
37 *
38 * @param cls closure
39 * @param peer peer this update is about (never NULL)
40 * @param address address (never NULL)
41 * @param last_validation point in time when last validation was performed
42 * @param valid_until point in time how long address is valid
43 * @param next_validation point in time when next validation will be performed
44 * @param state state of validation notification
45 */
46typedef void (*GST_ValidationChangedCallback) (void *cls,
47 const struct GNUNET_PeerIdentity *peer,
48 const struct GNUNET_HELLO_Address *address,
49 struct GNUNET_TIME_Absolute last_validation,
50 struct GNUNET_TIME_Absolute valid_until,
51 struct GNUNET_TIME_Absolute next_validation,
52 enum GNUNET_TRANSPORT_ValidationState state);
53
54
55/**
56 * Start the validation subsystem. 35 * Start the validation subsystem.
57 * 36 *
58 * @param cb callback to call with changes to valdidation entries
59 * @param cb_cls cls for the callback
60 * @param max_fds maximum number of fds to use 37 * @param max_fds maximum number of fds to use
61 */ 38 */
62void 39void
63GST_validation_start (GST_ValidationChangedCallback cb, void *cb_cls, unsigned int max_fds); 40GST_validation_start (unsigned int max_fds);
64 41
65 42
66/** 43/**
@@ -77,8 +54,8 @@ GST_validation_stop (void);
77 * 54 *
78 * @param address the address 55 * @param address the address
79 * @param session the session 56 * @param session the session
80 * @param in_use GNUNET_YES if we are now using the address for a connection, 57 * @param in_use #GNUNET_YES if we are now using the address for a connection,
81 * GNUNET_NO if we are no longer using the address for a connection 58 * #GNUNET_NO if we are no longer using the address for a connection
82 */ 59 */
83void 60void
84GST_validation_set_address_use (const struct GNUNET_HELLO_Address *address, 61GST_validation_set_address_use (const struct GNUNET_HELLO_Address *address,
@@ -101,15 +78,39 @@ GST_validation_get_address_latency (const struct GNUNET_PeerIdentity *sender,
101 const struct GNUNET_HELLO_Address *address, 78 const struct GNUNET_HELLO_Address *address,
102 struct Session *session); 79 struct Session *session);
103 80
81
82/**
83 * Function called to notify transport users that a neighbour peer changed its
84 * active address.
85 *
86 * @param cls closure
87 * @param peer peer this update is about (never NULL)
88 * @param address address (never NULL)
89 * @param last_validation point in time when last validation was performed
90 * @param valid_until point in time how long address is valid
91 * @param next_validation point in time when next validation will be performed
92 * @param state state of validation notification
93 */
94typedef void
95(*GST_ValidationChangedCallback) (void *cls,
96 const struct GNUNET_PeerIdentity *peer,
97 const struct GNUNET_HELLO_Address *address,
98 struct GNUNET_TIME_Absolute last_validation,
99 struct GNUNET_TIME_Absolute valid_until,
100 struct GNUNET_TIME_Absolute next_validation,
101 enum GNUNET_TRANSPORT_ValidationState state);
102
103
104/** 104/**
105 * Iterate over all iteration entries 105 * Iterate over all iteration entries
106 * 106 *
107 * @param cb function to call 107 * @param cb function to call
108 * @param cb_cls closure for cb 108 * @param cb_cls closure for @a cb
109 */ 109 */
110void 110void
111GST_validation_iterate (GST_ValidationChangedCallback cb, void *cb_cls); 111GST_validation_iterate (GST_ValidationChangedCallback cb, void *cb_cls);
112 112
113
113/** 114/**
114 * We've received a PING. If appropriate, generate a PONG. 115 * We've received a PING. If appropriate, generate a PONG.
115 * 116 *
@@ -163,15 +164,12 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello);
163 * otherwise a time in the future if we're currently denying re-validation 164 * otherwise a time in the future if we're currently denying re-validation
164 * @param address the address 165 * @param address the address
165 */ 166 */
166typedef void (*GST_ValidationAddressCallback) (void *cls, 167typedef void
167 const struct 168(*GST_ValidationAddressCallback) (void *cls,
168 GNUNET_CRYPTO_EddsaPublicKey *public_key, 169 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
169 struct GNUNET_TIME_Absolute 170 struct GNUNET_TIME_Absolute valid_until,
170 valid_until, 171 struct GNUNET_TIME_Absolute validation_block,
171 struct GNUNET_TIME_Absolute 172 const struct GNUNET_HELLO_Address *address);
172 validation_block,
173 const struct GNUNET_HELLO_Address
174 * address);
175 173
176 174
177/** 175/**
@@ -179,7 +177,7 @@ typedef void (*GST_ValidationAddressCallback) (void *cls,
179 * 177 *
180 * @param target peer information is requested for 178 * @param target peer information is requested for
181 * @param cb function to call; will not be called after this function returns 179 * @param cb function to call; will not be called after this function returns
182 * @param cb_cls closure for 'cb' 180 * @param cb_cls closure for @a cb
183 */ 181 */
184void 182void
185GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, 183GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target,