diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-01 14:32:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-01 14:32:34 +0000 |
commit | 8ea46cc3c928bd5f74859dc74f305c94b687aad2 (patch) | |
tree | 8a18d4d5a51a7ad7572aa7b5e2386d14e1d1c6b1 /src/transport/plugin_transport_udp.h | |
parent | 3c8d61656ddd2f9fcfd86345618086223dde363b (diff) | |
download | gnunet-8ea46cc3c928bd5f74859dc74f305c94b687aad2.tar.gz gnunet-8ea46cc3c928bd5f74859dc74f305c94b687aad2.zip |
-simplifying event loop for UDP, separting v4/v6 for better performance (in theory at least)
Diffstat (limited to 'src/transport/plugin_transport_udp.h')
-rw-r--r-- | src/transport/plugin_transport_udp.h | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h index e1ff5e9cf..e6cb5b450 100644 --- a/src/transport/plugin_transport_udp.h +++ b/src/transport/plugin_transport_udp.h | |||
@@ -121,29 +121,14 @@ union UdpAddress | |||
121 | 121 | ||
122 | 122 | ||
123 | /** | 123 | /** |
124 | * UDP Message-Packet header (after defragmentation). | 124 | * Information we track for each message in the queue. |
125 | */ | 125 | */ |
126 | struct UDPMessage | ||
127 | { | ||
128 | /** | ||
129 | * Message header. | ||
130 | */ | ||
131 | struct GNUNET_MessageHeader header; | ||
132 | |||
133 | /** | ||
134 | * Always zero for now. | ||
135 | */ | ||
136 | uint32_t reserved; | ||
137 | |||
138 | /** | ||
139 | * What is the identity of the sender | ||
140 | */ | ||
141 | struct GNUNET_PeerIdentity sender; | ||
142 | |||
143 | }; | ||
144 | |||
145 | struct UDP_MessageWrapper; | 126 | struct UDP_MessageWrapper; |
146 | 127 | ||
128 | |||
129 | /** | ||
130 | * Closure for #append_port(). | ||
131 | */ | ||
147 | struct PrettyPrinterContext; | 132 | struct PrettyPrinterContext; |
148 | 133 | ||
149 | 134 | ||
@@ -172,7 +157,7 @@ struct Plugin | |||
172 | /** | 157 | /** |
173 | * ID of select task for IPv4 | 158 | * ID of select task for IPv4 |
174 | */ | 159 | */ |
175 | struct GNUNET_SCHEDULER_Task *select_task; | 160 | struct GNUNET_SCHEDULER_Task *select_task_v4; |
176 | 161 | ||
177 | /** | 162 | /** |
178 | * ID of select task for IPv6 | 163 | * ID of select task for IPv6 |
@@ -205,31 +190,11 @@ struct Plugin | |||
205 | struct GNUNET_NAT_Handle *nat; | 190 | struct GNUNET_NAT_Handle *nat; |
206 | 191 | ||
207 | /** | 192 | /** |
208 | * FD Read set | ||
209 | */ | ||
210 | struct GNUNET_NETWORK_FDSet *rs_v4; | ||
211 | |||
212 | /** | ||
213 | * FD Write set | ||
214 | */ | ||
215 | struct GNUNET_NETWORK_FDSet *ws_v4; | ||
216 | |||
217 | /** | ||
218 | * The read socket for IPv4 | 193 | * The read socket for IPv4 |
219 | */ | 194 | */ |
220 | struct GNUNET_NETWORK_Handle *sockv4; | 195 | struct GNUNET_NETWORK_Handle *sockv4; |
221 | 196 | ||
222 | /** | 197 | /** |
223 | * FD Read set | ||
224 | */ | ||
225 | struct GNUNET_NETWORK_FDSet *rs_v6; | ||
226 | |||
227 | /** | ||
228 | * FD Write set | ||
229 | */ | ||
230 | struct GNUNET_NETWORK_FDSet *ws_v6; | ||
231 | |||
232 | /** | ||
233 | * The read socket for IPv6 | 198 | * The read socket for IPv6 |
234 | */ | 199 | */ |
235 | struct GNUNET_NETWORK_Handle *sockv6; | 200 | struct GNUNET_NETWORK_Handle *sockv6; |
@@ -347,6 +312,17 @@ struct Plugin | |||
347 | }; | 312 | }; |
348 | 313 | ||
349 | 314 | ||
315 | /** | ||
316 | * Function called for a quick conversion of the binary address to | ||
317 | * a numeric address. Note that the caller must not free the | ||
318 | * address and that the next call to this function is allowed | ||
319 | * to override the address again. | ||
320 | * | ||
321 | * @param cls closure | ||
322 | * @param addr binary address (a `union UdpAddress`) | ||
323 | * @param addrlen length of the @a addr | ||
324 | * @return string representing the same address | ||
325 | */ | ||
350 | const char * | 326 | const char * |
351 | udp_address_to_string (void *cls, | 327 | udp_address_to_string (void *cls, |
352 | const void *addr, | 328 | const void *addr, |