aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-01-23 12:44:35 +0000
committerBart Polot <bart@net.in.tum.de>2014-01-23 12:44:35 +0000
commit65b732a465152cf0769651397ff9d2c0980e1727 (patch)
treeb010db1563b4f792d12a006ae42e0847c6254824 /src/include
parent593bc9052dfa57754323db455028d80c13e673cc (diff)
downloadgnunet-65b732a465152cf0769651397ff9d2c0980e1727.tar.gz
gnunet-65b732a465152cf0769651397ff9d2c0980e1727.zip
- add peers info to mesh CLI and API
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_mesh_service.h37
-rw-r--r--src/include/gnunet_protocols.h12
2 files changed, 48 insertions, 1 deletions
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h
index 97dc4619f..d7c74b6f9 100644
--- a/src/include/gnunet_mesh_service.h
+++ b/src/include/gnunet_mesh_service.h
@@ -391,6 +391,22 @@ typedef void (*GNUNET_MESH_ChannelCB) (void *cls,
391 const struct GNUNET_PeerIdentity *peer, 391 const struct GNUNET_PeerIdentity *peer,
392 const struct GNUNET_PeerIdentity *parent); 392 const struct GNUNET_PeerIdentity *parent);
393 393
394/**
395 * Method called to retrieve information about all peers in MESH, called
396 * once per peer.
397 *
398 * After last peer has been reported, an additional call with NULL is done.
399 *
400 * @param cls Closure.
401 * @param peer Peer, or NULL on "EOF".
402 * @param tunnel Do we have a tunnel towards this peer?
403 * @param best_path How long is the best path?
404 * (0 = unknown, 1 = ourselves, 2 = neighbor)
405 */
406typedef void (*GNUNET_MESH_PeersCB) (void *cls,
407 const struct GNUNET_PeerIdentity *peer,
408 int tunnel, unsigned int best_path);
409
394 410
395/** 411/**
396 * Method called to retrieve information about all tunnels in MESH, called 412 * Method called to retrieve information about all tunnels in MESH, called
@@ -486,6 +502,27 @@ void *
486GNUNET_MESH_get_channels_cancel (struct GNUNET_MESH_Handle *h); 502GNUNET_MESH_get_channels_cancel (struct GNUNET_MESH_Handle *h);
487 503
488 504
505
506/**
507 * Request information about the running mesh peer.
508 * The callback will be called for every peer known to the service.
509 *
510 * If called again on the same handle, it will overwrite the previous
511 * callback and cls. To retrieve the cls, monitor_cancel must be
512 * called first.
513 *
514 * WARNING: unstable API, likely to change in the future!
515 *
516 * @param h Handle to the mesh peer.
517 * @param callback Function to call with the requested data.
518 * @param callback_cls Closure for @c callback.
519 */
520void
521GNUNET_MESH_get_peers (struct GNUNET_MESH_Handle *h,
522 GNUNET_MESH_PeersCB callback,
523 void *callback_cls);
524
525
489/** 526/**
490 * Request information about the running mesh peer. 527 * Request information about the running mesh peer.
491 * The callback will be called for every channel known to the service, 528 * The callback will be called for every channel known to the service,
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 2a69e3029..77d7e216b 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -612,7 +612,7 @@ extern "C"
612#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP 157 612#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP 157
613 613
614/** 614/**
615 * Trail to a particular peer is returned to this peer. 615 * Trail to a particular peer is returned to this peer.
616 */ 616 */
617#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_RESULT 158 617#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_RESULT 158
618 618
@@ -933,6 +933,16 @@ extern "C"
933#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_CONNECTION 295 933#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_CONNECTION 295
934 934
935/** 935/**
936 * Local information about all peers known to the service.
937 */
938#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_PEERS 296
939
940/**
941 * Local information of service about a specific peer.
942 */
943#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_PEER 297
944
945/**
936 * Traffic (net-cat style) used by the Command Line Interface. 946 * Traffic (net-cat style) used by the Command Line Interface.
937 */ 947 */
938#define GNUNET_MESSAGE_TYPE_MESH_CLI 298 948#define GNUNET_MESSAGE_TYPE_MESH_CLI 298