aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/cadet.h')
-rw-r--r--src/cadet/cadet.h97
1 files changed, 84 insertions, 13 deletions
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h
index 226288284..51296ae50 100644
--- a/src/cadet/cadet.h
+++ b/src/cadet/cadet.h
@@ -249,24 +249,97 @@ struct GNUNET_CADET_LocalInfo
249 249
250 250
251/** 251/**
252 * Message to inform the client about one of the peers in the service. 252 * Message to inform the client about channels in the service.
253 *
254 * TODO: split into two messages!
255 */ 253 */
256struct GNUNET_CADET_LocalInfoPeer 254struct GNUNET_CADET_RequestPathInfoMessage
257{ 255{
258 /** 256 /**
259 * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEER or 257 * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH
260 * #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS
261 */ 258 */
262 struct GNUNET_MessageHeader header; 259 struct GNUNET_MessageHeader header;
263 260
261 /**
262 * Always zero.
263 */
264 uint32_t resered GNUNET_PACKED;
265
266 /**
267 * ID of the destination of the channel (can be local peer).
268 */
269 struct GNUNET_PeerIdentity peer;
270};
271
272
273/**
274 * Message to inform the client about channels in the service.
275 */
276struct GNUNET_CADET_ChannelInfoMessage
277{
278 /**
279 * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL.
280 */
281 struct GNUNET_MessageHeader header;
282
264 /** 283 /**
265 * Offset the peer has in the path this message is about. 284 * Root of the channel
266 */ 285 */
267 uint16_t offset GNUNET_PACKED; 286 struct GNUNET_PeerIdentity root;
268 287
269 /** 288 /**
289 * Destination of the channel
290 */
291 struct GNUNET_PeerIdentity dest;
292
293 /* FIXME: expand! */
294};
295
296
297/**
298 * Message to as the service about information on a channel.
299 */
300struct GNUNET_CADET_RequestChannelInfoMessage
301{
302 /**
303 * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_CHANNEL.
304 */
305 struct GNUNET_MessageHeader header;
306
307 /**
308 * Target of the channel.
309 */
310 struct GNUNET_PeerIdentity target;
311
312};
313
314
315/**
316 * Message to inform the client about one of the paths known to the service.
317 */
318struct GNUNET_CADET_LocalInfoPath
319{
320 /**
321 * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH.
322 */
323 struct GNUNET_MessageHeader header;
324
325 /**
326 * Zero.
327 */
328 uint32_t reserved GNUNET_PACKED;
329};
330
331
332/**
333 * Message to inform the client about one of the peers in the service.
334 */
335struct GNUNET_CADET_LocalInfoPeers
336{
337 /**
338 * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS
339 */
340 struct GNUNET_MessageHeader header;
341
342 /**
270 * Number of paths. 343 * Number of paths.
271 */ 344 */
272 uint16_t paths GNUNET_PACKED; 345 uint16_t paths GNUNET_PACKED;
@@ -277,17 +350,15 @@ struct GNUNET_CADET_LocalInfoPeer
277 int16_t tunnel GNUNET_PACKED; 350 int16_t tunnel GNUNET_PACKED;
278 351
279 /** 352 /**
280 * We are finished with the paths. 353 * Shortest known path.
281 */ 354 */
282 uint16_t finished_with_paths; 355 uint32_t best_path_length GNUNET_PACKED;
283 356
284 /** 357 /**
285 * ID of the peer (can be local peer). 358 * ID of the peer (can be local peer).
286 */ 359 */
287 struct GNUNET_PeerIdentity destination; 360 struct GNUNET_PeerIdentity destination;
288 361
289 /* If type == PEER (no 'S'): GNUNET_PeerIdentity paths[]
290 * (each path ends in destination) */
291}; 362};
292 363
293 364