diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-18 12:20:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-18 12:20:14 +0000 |
commit | aed237fb57999eaf6f3d578bc1f081a6a684836f (patch) | |
tree | cb91c9f305fd4b533731cbc4ba6f091425470ebe /src/transport/gnunet-service-transport_ats.h | |
parent | 96e83adb54d5be78b5a5d2245ddd334096c51c9e (diff) | |
download | gnunet-aed237fb57999eaf6f3d578bc1f081a6a684836f.tar.gz gnunet-aed237fb57999eaf6f3d578bc1f081a6a684836f.zip |
combing through transport ATS logic, documenting and cleaning code
Diffstat (limited to 'src/transport/gnunet-service-transport_ats.h')
-rw-r--r-- | src/transport/gnunet-service-transport_ats.h | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/transport/gnunet-service-transport_ats.h b/src/transport/gnunet-service-transport_ats.h index de0800d0a..75743606a 100644 --- a/src/transport/gnunet-service-transport_ats.h +++ b/src/transport/gnunet-service-transport_ats.h | |||
@@ -43,6 +43,8 @@ GST_ats_done (void); | |||
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Test if ATS knows about this @a address and @a session. | 45 | * Test if ATS knows about this @a address and @a session. |
46 | * Note that even if the address is expired, we return | ||
47 | * #GNUNET_YES if the respective session matches. | ||
46 | * | 48 | * |
47 | * @param address the address | 49 | * @param address the address |
48 | * @param session the session | 50 | * @param session the session |
@@ -54,7 +56,8 @@ GST_ats_is_known (const struct GNUNET_HELLO_Address *address, | |||
54 | 56 | ||
55 | 57 | ||
56 | /** | 58 | /** |
57 | * Test if ATS knows about this @a address. | 59 | * Test if ATS knows about this @a address. Note that |
60 | * expired addresses do not count. | ||
58 | * | 61 | * |
59 | * @param address the address | 62 | * @param address the address |
60 | * @return #GNUNET_YES if @a address is known, #GNUNET_NO if not. | 63 | * @return #GNUNET_YES if @a address is known, #GNUNET_NO if not. |
@@ -79,7 +82,7 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address, | |||
79 | 82 | ||
80 | /** | 83 | /** |
81 | * Reset address blocking time. Resets the exponential | 84 | * Reset address blocking time. Resets the exponential |
82 | * back-off timer for this address to zero. Done when | 85 | * back-off timer for this address to zero. Called when |
83 | * an address was used to create a successful connection. | 86 | * an address was used to create a successful connection. |
84 | * | 87 | * |
85 | * @param address the address to reset the blocking timer | 88 | * @param address the address to reset the blocking timer |
@@ -91,10 +94,10 @@ GST_ats_block_reset (const struct GNUNET_HELLO_Address *address, | |||
91 | 94 | ||
92 | 95 | ||
93 | /** | 96 | /** |
94 | * Notify ATS about the a new inbound address. We may already | 97 | * Notify ATS about a new inbound @a address. The @a address in |
95 | * know the address (as this is called each time we receive | 98 | * combination with the @a session must be new, but this function will |
96 | * a message from an inbound connection). If the address is | 99 | * perform a santiy check. If the @a address is indeed new, make it |
97 | * indeed new, make it available to ATS. | 100 | * available to ATS. |
98 | * | 101 | * |
99 | * @param address the address | 102 | * @param address the address |
100 | * @param session the session | 103 | * @param session the session |
@@ -107,7 +110,7 @@ GST_ats_add_inbound_address (const struct GNUNET_HELLO_Address *address, | |||
107 | 110 | ||
108 | 111 | ||
109 | /** | 112 | /** |
110 | * Notify ATS about the new address including the network this address is | 113 | * Notify ATS about a new address including the network this address is |
111 | * located in. The address must NOT be inbound and must be new to ATS. | 114 | * located in. The address must NOT be inbound and must be new to ATS. |
112 | * | 115 | * |
113 | * @param address the address | 116 | * @param address the address |
@@ -119,8 +122,10 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address, | |||
119 | 122 | ||
120 | 123 | ||
121 | /** | 124 | /** |
122 | * Notify ATS about a new session now existing for the given | 125 | * Notify ATS about a new @a session now existing for the given |
123 | * address. | 126 | * @a address. Essentially, an outbound @a address was used |
127 | * to establish a @a session. It is safe to call this function | ||
128 | * repeatedly for the same @a address and @a session pair. | ||
124 | * | 129 | * |
125 | * @param address the address | 130 | * @param address the address |
126 | * @param session the session | 131 | * @param session the session |
@@ -146,7 +151,8 @@ GST_ats_update_metrics (const struct GNUNET_HELLO_Address *address, | |||
146 | 151 | ||
147 | 152 | ||
148 | /** | 153 | /** |
149 | * Notify ATS about utilization changes to an address. | 154 | * Notify ATS about utilization changes to an @a address. |
155 | * Does nothing if the @a address is not known to us. | ||
150 | * | 156 | * |
151 | * @param address our information about the address | 157 | * @param address our information about the address |
152 | * @param bps_in new utilization inbound | 158 | * @param bps_in new utilization inbound |
@@ -159,7 +165,8 @@ GST_ats_update_utilization (const struct GNUNET_HELLO_Address *address, | |||
159 | 165 | ||
160 | 166 | ||
161 | /** | 167 | /** |
162 | * Notify ATS about property changes to an address's properties. | 168 | * Notify ATS about @a delay changes to properties of an @a address. |
169 | * Does nothing if the @a address is not known to us. | ||
163 | * | 170 | * |
164 | * @param address the address | 171 | * @param address the address |
165 | * @param session the session | 172 | * @param session the session |
@@ -171,7 +178,8 @@ GST_ats_update_delay (const struct GNUNET_HELLO_Address *address, | |||
171 | 178 | ||
172 | 179 | ||
173 | /** | 180 | /** |
174 | * Notify ATS about property changes to an address's properties. | 181 | * Notify ATS about DV @a distance change to an @a address. |
182 | * Does nothing if the @a address is not known to us. | ||
175 | * | 183 | * |
176 | * @param address the address | 184 | * @param address the address |
177 | * @param distance new distance value | 185 | * @param distance new distance value |
@@ -182,8 +190,12 @@ GST_ats_update_distance (const struct GNUNET_HELLO_Address *address, | |||
182 | 190 | ||
183 | 191 | ||
184 | /** | 192 | /** |
185 | * Notify ATS that the session (but not the address) of | 193 | * Notify ATS that the @a session (but not the @a address) of |
186 | * a given address is no longer relevant. | 194 | * a given @a address is no longer relevant. (The @a session |
195 | * went down.) This function may be called even if for the | ||
196 | * respective outbound address #GST_ats_new_session() was | ||
197 | * never called and thus the pair is unknown to ATS. In this | ||
198 | * case, the call is simply ignored. | ||
187 | * | 199 | * |
188 | * @param address the address | 200 | * @param address the address |
189 | * @param session the session | 201 | * @param session the session |