aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-30 10:06:33 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-30 10:06:33 +0000
commit105e00be9252a2e6db0dec566b2b0d9e633a31bf (patch)
tree36cbccc92d2da220cd0f1e5354b2f175a93ccbaa /src/testbed/gnunet-service-testbed.h
parent8cc87399cf760b9fa3cbdb40bf71d1eb333c8434 (diff)
downloadgnunet-105e00be9252a2e6db0dec566b2b0d9e633a31bf.tar.gz
gnunet-105e00be9252a2e6db0dec566b2b0d9e633a31bf.zip
cache transport handles with peer connect notifications
Diffstat (limited to 'src/testbed/gnunet-service-testbed.h')
-rw-r--r--src/testbed/gnunet-service-testbed.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h
index 72ad5d15a..b7924dc59 100644
--- a/src/testbed/gnunet-service-testbed.h
+++ b/src/testbed/gnunet-service-testbed.h
@@ -814,6 +814,22 @@ typedef void (*GST_cache_callback) (void *cls, struct GNUNET_CORE_Handle *ch,
814 814
815 815
816/** 816/**
817 * Callback to notify when the target peer given to
818 * GST_cache_get_handle_transport() is connected. Note that this callback may
819 * not be called if the target peer is already connected. Use
820 * GNUNET_TRANSPORT_check_neighbour_connected() to check if the target peer is
821 * already connected or not. This callback will be called only once or never (in
822 * case the target cannot be connected).
823 *
824 * @param cls the closure given to GST_cache_get_handle_done() for this callback
825 * @param target the peer identity of the target peer. The pointer should be
826 * valid until GST_cache_get_handle_done() is called.
827 */
828typedef void (*GST_cache_peer_connect_notify) (void *cls,
829 const struct GNUNET_PeerIdentity *target);
830
831
832/**
817 * Get a transport handle with the given configuration. If the handle is already 833 * Get a transport handle with the given configuration. If the handle is already
818 * cached before, it will be retured in the given callback; the peer_id is used to lookup in the 834 * cached before, it will be retured in the given callback; the peer_id is used to lookup in the
819 * cache. If not a new operation is started to open the transport handle and 835 * cache. If not a new operation is started to open the transport handle and
@@ -824,6 +840,12 @@ typedef void (*GST_cache_callback) (void *cls, struct GNUNET_CORE_Handle *ch,
824 * created if it was not present in the cache 840 * created if it was not present in the cache
825 * @param cb the callback to notify when the transport handle is available 841 * @param cb the callback to notify when the transport handle is available
826 * @param cb_cls the closure for the above callback 842 * @param cb_cls the closure for the above callback
843 * @param target the peer identify of the peer whose connection to our TRANSPORT
844 * subsystem will be notified through the connect_notify_cb. Can be NULL
845 * @param connect_notify_cb the callback to call when the given target peer is
846 * connected. This callback will only be called once or never again (in
847 * case the target peer cannot be connected). Can be NULL
848 * @param connect_notify_cb_cls the closure for the above callback
827 * @return the handle which can be used cancel or mark that the handle is no 849 * @return the handle which can be used cancel or mark that the handle is no
828 * longer being used 850 * longer being used
829 */ 851 */
@@ -831,7 +853,10 @@ struct GSTCacheGetHandle *
831GST_cache_get_handle_transport (unsigned int peer_id, 853GST_cache_get_handle_transport (unsigned int peer_id,
832 const struct GNUNET_CONFIGURATION_Handle *cfg, 854 const struct GNUNET_CONFIGURATION_Handle *cfg,
833 GST_cache_callback cb, 855 GST_cache_callback cb,
834 void *cb_cls); 856 void *cb_cls,
857 const struct GNUNET_PeerIdentity *target,
858 GST_cache_peer_connect_notify connect_notify_cb,
859 void *connect_notify_cb_cls);
835 860
836 861
837/** 862/**