diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-08 23:20:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-08 23:20:42 +0000 |
commit | a983a0267109b1b6a8e16e476e2f2956a8771b94 (patch) | |
tree | 79bcae73cdb7b87b4f55d4396e79baea76ef53a6 /src/transport/gnunet-service-transport_neighbours.h | |
parent | a3f8ef5b89dc44fc3acfb8f081a502f3409e4224 (diff) | |
download | gnunet-a983a0267109b1b6a8e16e476e2f2956a8771b94.tar.gz gnunet-a983a0267109b1b6a8e16e476e2f2956a8771b94.zip |
refactoring how we handle peer addresses in peerinfo/ats/transport/hello subsystems -- use a struct instead of 3--4 arguments
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.h')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.h | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index 48e54e656..72ced636d 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -152,17 +152,14 @@ GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | |||
152 | * @param neighbour identity of the neighbour | 152 | * @param neighbour identity of the neighbour |
153 | * @param ats performance data | 153 | * @param ats performance data |
154 | * @param ats_count number of entries in ats (including 0-termination) | 154 | * @param ats_count number of entries in ats (including 0-termination) |
155 | * @param transport plugin | 155 | * @param address the address (or NULL) |
156 | * @param addr address | ||
157 | * @param addrlen address length | ||
158 | */ | 156 | */ |
159 | typedef void (*GST_NeighbourIterator) (void *cls, | 157 | typedef void (*GST_NeighbourIterator) (void *cls, |
160 | const struct GNUNET_PeerIdentity * | 158 | const struct GNUNET_PeerIdentity * |
161 | neighbour, | 159 | neighbour, |
162 | const struct GNUNET_ATS_Information * | 160 | const struct GNUNET_ATS_Information * |
163 | ats, uint32_t ats_count, | 161 | ats, uint32_t ats_count, |
164 | const char *transport, const void *addr, | 162 | const struct GNUNET_HELLO_Address *address); |
165 | size_t addrlen); | ||
166 | 163 | ||
167 | 164 | ||
168 | /** | 165 | /** |
@@ -191,10 +188,8 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
191 | * use the given address. | 188 | * use the given address. |
192 | * | 189 | * |
193 | * @param peer identity of the peer to switch the address for | 190 | * @param peer identity of the peer to switch the address for |
194 | * @param plugin_name name of transport that delivered the PONG | ||
195 | * @param address address of the other peer, NULL if other peer | 191 | * @param address address of the other peer, NULL if other peer |
196 | * connected to us | 192 | * connected to us |
197 | * @param address_len number of bytes in address | ||
198 | * @param session session to use (or NULL) | 193 | * @param session session to use (or NULL) |
199 | * @param ats performance data | 194 | * @param ats performance data |
200 | * @param ats_count number of entries in ats | 195 | * @param ats_count number of entries in ats |
@@ -204,19 +199,11 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
204 | * connection is not up (yet) | 199 | * connection is not up (yet) |
205 | */ | 200 | */ |
206 | int | 201 | int |
207 | GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | ||
208 | const char *plugin_name, const void *address, | ||
209 | size_t address_len, struct Session *session, | ||
210 | const struct GNUNET_ATS_Information *ats, | ||
211 | uint32_t ats_count); | ||
212 | |||
213 | int | ||
214 | GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, | 202 | GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, |
215 | const char *plugin_name, | 203 | const struct GNUNET_HELLO_Address *address, |
216 | const void *address, size_t address_len, | 204 | struct Session *session, |
217 | struct Session *session, | 205 | const struct GNUNET_ATS_Information *ats, |
218 | const struct GNUNET_ATS_Information *ats, | 206 | uint32_t ats_count, |
219 | uint32_t ats_count, | ||
220 | struct GNUNET_BANDWIDTH_Value32NBO | 207 | struct GNUNET_BANDWIDTH_Value32NBO |
221 | bandwidth_in, | 208 | bandwidth_in, |
222 | struct GNUNET_BANDWIDTH_Value32NBO | 209 | struct GNUNET_BANDWIDTH_Value32NBO |
@@ -229,10 +216,8 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, | |||
229 | * | 216 | * |
230 | * @param message possibly a 'struct SessionConnectMessage' (check format) | 217 | * @param message possibly a 'struct SessionConnectMessage' (check format) |
231 | * @param peer identity of the peer to switch the address for | 218 | * @param peer identity of the peer to switch the address for |
232 | * @param plugin_name name of transport that delivered the PONG | ||
233 | * @param address address of the other peer, NULL if other peer | 219 | * @param address address of the other peer, NULL if other peer |
234 | * connected to us | 220 | * connected to us |
235 | * @param address_len number of bytes in address | ||
236 | * @param session session to use (or NULL) | 221 | * @param session session to use (or NULL) |
237 | * @param ats performance data | 222 | * @param ats performance data |
238 | * @param ats_count number of entries in ats (excluding 0-termination) | 223 | * @param ats_count number of entries in ats (excluding 0-termination) |
@@ -240,19 +225,28 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, | |||
240 | void | 225 | void |
241 | GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | 226 | GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, |
242 | const struct GNUNET_PeerIdentity *peer, | 227 | const struct GNUNET_PeerIdentity *peer, |
243 | const char *plugin_name, | 228 | const struct GNUNET_HELLO_Address *address, |
244 | const char *sender_address, | ||
245 | uint16_t sender_address_len, | ||
246 | struct Session *session, | 229 | struct Session *session, |
247 | const struct GNUNET_ATS_Information *ats, | 230 | const struct GNUNET_ATS_Information *ats, |
248 | uint32_t ats_count); | 231 | uint32_t ats_count); |
249 | 232 | ||
233 | |||
234 | /** | ||
235 | * We received a 'SESSION_CONNECT_ACK' message from the other peer. | ||
236 | * Consider switching to it. | ||
237 | * | ||
238 | * @param message possibly a 'struct SessionConnectMessage' (check format) | ||
239 | * @param peer identity of the peer to switch the address for | ||
240 | * @param address address of the other peer, NULL if other peer | ||
241 | * connected to us | ||
242 | * @param session session to use (or NULL) | ||
243 | * @param ats performance data | ||
244 | * @param ats_count number of entries in ats | ||
245 | */ | ||
250 | void | 246 | void |
251 | GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | 247 | GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, |
252 | const struct GNUNET_PeerIdentity *peer, | 248 | const struct GNUNET_PeerIdentity *peer, |
253 | const char *plugin_name, | 249 | const struct GNUNET_HELLO_Address *address, |
254 | const char *sender_address, | ||
255 | uint16_t sender_address_len, | ||
256 | struct Session *session, | 250 | struct Session *session, |
257 | const struct GNUNET_ATS_Information *ats, | 251 | const struct GNUNET_ATS_Information *ats, |
258 | uint32_t ats_count); | 252 | uint32_t ats_count); |
@@ -260,8 +254,8 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
260 | void | 254 | void |
261 | GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, | 255 | GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, |
262 | const struct GNUNET_PeerIdentity *peer, | 256 | const struct GNUNET_PeerIdentity *peer, |
263 | const char *plugin_name, const char *sender_address, | 257 | const struct GNUNET_HELLO_Address *address, |
264 | uint16_t sender_address_len, struct Session *session, | 258 | struct Session *session, |
265 | const struct GNUNET_ATS_Information *ats, | 259 | const struct GNUNET_ATS_Information *ats, |
266 | uint32_t ats_count); | 260 | uint32_t ats_count); |
267 | 261 | ||