diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.h | 146 |
1 files changed, 58 insertions, 88 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h index e96e2f24c..6302cd898 100644 --- a/src/cadet/gnunet-service-cadet_connection.h +++ b/src/cadet/gnunet-service-cadet_connection.h | |||
@@ -118,90 +118,86 @@ typedef void | |||
118 | 118 | ||
119 | 119 | ||
120 | /** | 120 | /** |
121 | * Core handler for connection creation. | 121 | * Handler for connection creation. |
122 | * | 122 | * |
123 | * @param cls Closure (unused). | 123 | * @param peer Message sender (neighbor). |
124 | * @param peer Sender (neighbor). | 124 | * @param msg Message itself. |
125 | * @param message Message. | ||
126 | * @return #GNUNET_OK to keep the connection open, | ||
127 | * #GNUNET_SYSERR to close it (signal serious error) | ||
128 | */ | 125 | */ |
129 | int | 126 | void |
130 | GCC_handle_create (void *cls, | 127 | GCC_handle_create (struct CadetPeer *peer, |
131 | const struct GNUNET_PeerIdentity *peer, | 128 | const struct GNUNET_CADET_ConnectionCreate *msg); |
132 | const struct GNUNET_MessageHeader *message); | ||
133 | 129 | ||
134 | 130 | ||
135 | /** | 131 | /** |
136 | * Core handler for path confirmations. | 132 | * Handler for connection confirmations. |
137 | * | 133 | * |
138 | * @param cls closure | 134 | * @param peer Message sender (neighbor). |
139 | * @param message message | 135 | * @param msg Message itself. |
140 | * @param peer peer identity this notification is about | ||
141 | * @return #GNUNET_OK to keep the connection open, | ||
142 | * #GNUNET_SYSERR to close it (signal serious error) | ||
143 | */ | 136 | */ |
144 | int | 137 | void |
145 | GCC_handle_confirm (void *cls, | 138 | GCC_handle_confirm (struct CadetPeer *peer, |
146 | const struct GNUNET_PeerIdentity *peer, | 139 | const struct GNUNET_CADET_ConnectionACK *msg); |
147 | const struct GNUNET_MessageHeader *message); | ||
148 | 140 | ||
149 | 141 | ||
150 | /** | 142 | /** |
151 | * Core handler for notifications of broken paths | 143 | * Handler for notifications of broken connections. |
152 | * | 144 | * |
153 | * @param cls Closure (unused). | 145 | * @param peer Message sender (neighbor). |
154 | * @param id Peer identity of sending neighbor. | 146 | * @param msg Message itself. |
155 | * @param message Message. | ||
156 | * @return #GNUNET_OK to keep the connection open, | ||
157 | * #GNUNET_SYSERR to close it (signal serious error) | ||
158 | */ | 147 | */ |
159 | int | 148 | void |
160 | GCC_handle_broken (void* cls, | 149 | GCC_handle_broken (struct CadetPeer *peer, |
161 | const struct GNUNET_PeerIdentity* id, | 150 | const struct GNUNET_CADET_ConnectionBroken *msg); |
162 | const struct GNUNET_MessageHeader* message); | ||
163 | 151 | ||
164 | /** | 152 | /** |
165 | * Core handler for tunnel destruction | 153 | * Handler for notifications of destroyed connections. |
166 | * | 154 | * |
167 | * @param cls Closure (unused). | 155 | * @param peer Message sender (neighbor). |
168 | * @param peer Peer identity of sending neighbor. | 156 | * @param msg Message itself. |
169 | * @param message Message. | ||
170 | * | ||
171 | * @return GNUNET_OK to keep the connection open, | ||
172 | * GNUNET_SYSERR to close it (signal serious error) | ||
173 | */ | 157 | */ |
174 | int | 158 | void |
175 | GCC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, | 159 | GCC_handle_destroy (struct CadetPeer *peer, |
176 | const struct GNUNET_MessageHeader *message); | 160 | const struct GNUNET_CADET_ConnectionDestroy *msg); |
177 | 161 | ||
178 | /** | 162 | /** |
179 | * Core handler for key exchange traffic (ephemeral key, ping, pong). | 163 | * Handler for cadet network traffic hop-by-hop acks. |
180 | * | 164 | * |
181 | * @param cls Closure (unused). | 165 | * @param peer Message sender (neighbor). |
182 | * @param message Message received. | 166 | * @param msg Message itself. |
183 | * @param peer Peer who sent the message. | 167 | */ |
168 | void | ||
169 | GCC_handle_ack (struct CadetPeer *peer, | ||
170 | const struct GNUNET_CADET_ACK *msg); | ||
171 | |||
172 | /** | ||
173 | * Handler for cadet network traffic hop-by-hop data counter polls. | ||
184 | * | 174 | * |
185 | * @return GNUNET_OK to keep the connection open, | 175 | * @param peer Message sender (neighbor). |
186 | * GNUNET_SYSERR to close it (signal serious error) | 176 | * @param msg Message itself. |
187 | */ | 177 | */ |
188 | int | 178 | void |
189 | GCC_handle_kx (void *cls, const struct GNUNET_PeerIdentity *peer, | 179 | GCC_handle_poll (struct CadetPeer *peer, |
190 | const struct GNUNET_MessageHeader *message); | 180 | const struct GNUNET_CADET_Poll *msg); |
191 | 181 | ||
192 | /** | 182 | /** |
193 | * Core handler for encrypted cadet network traffic (channel mgmt, data). | 183 | * Handler for key exchange traffic (Axolotl KX). |
194 | * | 184 | * |
195 | * @param cls Closure (unused). | 185 | * @param peer Message sender (neighbor). |
196 | * @param message Message received. | 186 | * @param msg Message itself. |
197 | * @param peer Peer who sent the message. | 187 | */ |
188 | void | ||
189 | GCC_handle_kx (struct CadetPeer *peer, | ||
190 | const struct GNUNET_CADET_KX *msg); | ||
191 | |||
192 | /** | ||
193 | * Handler for encrypted cadet network traffic (channel mgmt, data). | ||
198 | * | 194 | * |
199 | * @return GNUNET_OK to keep the connection open, | 195 | * @param peer Message sender (neighbor). |
200 | * GNUNET_SYSERR to close it (signal serious error) | 196 | * @param msg Message itself. |
201 | */ | 197 | */ |
202 | int | 198 | void |
203 | GCC_handle_encrypted (void *cls, const struct GNUNET_PeerIdentity *peer, | 199 | GCC_handle_encrypted (struct CadetPeer *peer, |
204 | const struct GNUNET_MessageHeader *message); | 200 | const struct GNUNET_CADET_AX *msg); |
205 | 201 | ||
206 | /** | 202 | /** |
207 | * Core handler for axolotl key exchange traffic. | 203 | * Core handler for axolotl key exchange traffic. |
@@ -230,34 +226,6 @@ GCC_handle_ax (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
230 | struct GNUNET_MessageHeader *message); | 226 | struct GNUNET_MessageHeader *message); |
231 | 227 | ||
232 | /** | 228 | /** |
233 | * Core handler for cadet network traffic point-to-point acks. | ||
234 | * | ||
235 | * @param cls closure | ||
236 | * @param message message | ||
237 | * @param peer peer identity this notification is about | ||
238 | * | ||
239 | * @return GNUNET_OK to keep the connection open, | ||
240 | * GNUNET_SYSERR to close it (signal serious error) | ||
241 | */ | ||
242 | int | ||
243 | GCC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer, | ||
244 | const struct GNUNET_MessageHeader *message); | ||
245 | |||
246 | /** | ||
247 | * Core handler for cadet network traffic point-to-point ack polls. | ||
248 | * | ||
249 | * @param cls closure | ||
250 | * @param message message | ||
251 | * @param peer peer identity this notification is about | ||
252 | * | ||
253 | * @return GNUNET_OK to keep the connection open, | ||
254 | * GNUNET_SYSERR to close it (signal serious error) | ||
255 | */ | ||
256 | int | ||
257 | GCC_handle_poll (void *cls, const struct GNUNET_PeerIdentity *peer, | ||
258 | const struct GNUNET_MessageHeader *message); | ||
259 | |||
260 | /** | ||
261 | * Core handler for cadet keepalives. | 229 | * Core handler for cadet keepalives. |
262 | * | 230 | * |
263 | * @param cls closure | 231 | * @param cls closure |
@@ -301,11 +269,12 @@ GCC_shutdown (void); | |||
301 | * Create a connection. | 269 | * Create a connection. |
302 | * | 270 | * |
303 | * @param cid Connection ID (either created locally or imposed remotely). | 271 | * @param cid Connection ID (either created locally or imposed remotely). |
304 | * @param t Tunnel this connection belongs to (or NULL); | 272 | * @param t Tunnel this connection belongs to (or NULL for transit connections); |
305 | * @param path Path this connection has to use (copy is made). | 273 | * @param path Path this connection has to use (copy is made). |
306 | * @param own_pos Own position in the @c path path. | 274 | * @param own_pos Own position in the @c path path. |
307 | * | 275 | * |
308 | * @return Newly created connection, NULL in case of error (own id not in path). | 276 | * @return Newly created connection. |
277 | * NULL in case of error: own id not in path, wrong neighbors, ... | ||
309 | */ | 278 | */ |
310 | struct CadetConnection * | 279 | struct CadetConnection * |
311 | GCC_new (const struct GNUNET_CADET_Hash *cid, | 280 | GCC_new (const struct GNUNET_CADET_Hash *cid, |
@@ -525,6 +494,7 @@ GCC_cancel (struct CadetConnectionQueue *q); | |||
525 | * @param message Message to send. Function makes a copy of it. | 494 | * @param message Message to send. Function makes a copy of it. |
526 | * If message is not hop-by-hop, decrements TTL of copy. | 495 | * If message is not hop-by-hop, decrements TTL of copy. |
527 | * @param payload_type Type of payload, in case the message is encrypted. | 496 | * @param payload_type Type of payload, in case the message is encrypted. |
497 | * @param payload_id ID of the payload (PID, ACK, ...). | ||
528 | * @param c Connection on which this message is transmitted. | 498 | * @param c Connection on which this message is transmitted. |
529 | * @param fwd Is this a fwd message? | 499 | * @param fwd Is this a fwd message? |
530 | * @param force Force the connection to accept the message (buffer overfill). | 500 | * @param force Force the connection to accept the message (buffer overfill). |