Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+
+/**
+ * @file transport/transport_api_peer_address_lookup.c
+ * @brief given a peer id, get all known addresses from transport service
+ *
+ * This api provides the ability to query the transport service about
+ * the status of connections to a specific peer. Calls back with a
+ * pretty printed string of the address, as formatted by the appropriate
+ * transport plugin, and whether or not the address given is currently
+ * in the 'connected' state (according to the transport service).
+ */
+
#include "platform.h"
#include "gnunet_client_lib.h"
#include "gnunet_arm_service.h"
void *peer_address_callback_cls)
{
struct PeerAddressLookupMessage msg;
- struct GNUNET_TIME_Absolute abs_timeout;
struct AddressLookupCtx *peer_address_lookup_cb;
struct GNUNET_CLIENT_Connection *client;
peer_address_callback (peer_address_callback_cls, NULL);
return;
}
- abs_timeout = GNUNET_TIME_relative_to_absolute (timeout);
-
msg.header.size = htons (sizeof(struct PeerAddressLookupMessage));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_PEER_ADDRESS_LOOKUP);
- msg.timeout = GNUNET_TIME_absolute_hton (abs_timeout);
+ msg.timeout = GNUNET_TIME_relative_hton (timeout);
memcpy(&msg.peer, peer, sizeof(struct GNUNET_PeerIdentity));
peer_address_lookup_cb = GNUNET_malloc (sizeof (struct AddressLookupCtx));
peer_address_lookup_cb->cb = peer_address_callback;
peer_address_lookup_cb->cb_cls = peer_address_callback_cls;
- peer_address_lookup_cb->timeout = abs_timeout;
+ peer_address_lookup_cb->timeout = GNUNET_TIME_relative_to_absolute (timeout);
peer_address_lookup_cb->client = client;
GNUNET_assert (GNUNET_OK ==
GNUNET_CLIENT_transmit_and_get_response (client,