*/
struct GNUNET_CORE_TransmitHandle *hello_req;
- /**
- * Our handle for the request to connect to this peer; NULL if no
- * such request is pending.
- */
- struct GNUNET_CORE_PeerRequestHandle *connect_req;
-
/**
* Pointer to the HELLO message of this peer; can be NULL.
*/
/**
- * Function that decides if a connection is acceptable or not.
+ * Function that decides if a connection is acceptable or not.
* If we have a blacklist, only friends are allowed, so the check
* is rather simple.
*
}
-/**
- * Function called by core when our request to connect was transmitted.
- *
- * @param cls the 'struct Peer' for which we issued the connect request
- * @param success was the request transmitted
- */
-static void
-connect_completed_callback (void *cls, int success)
-{
- struct Peer *pos = cls;
-
- pos->connect_req = NULL;
-}
-
-
/**
* Check if an additional connection from the given peer is allowed.
- *
+ *
* @param peer connection to check
* @return GNUNET_OK if the connection is allowed
*/
GNUNET_CONTAINER_multihashmap_remove (peers, pid, pos));
if (pos->hello_req != NULL)
GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req);
- if (pos->connect_req != NULL)
- GNUNET_CORE_peer_request_connect_cancel (pos->connect_req);
if (pos->hello_delay_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (pos->hello_delay_task);
if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_i2s (&pos->pid));
#endif
GNUNET_STATISTICS_update (stats,
- gettext_noop ("# connect requests issued to core"),
- 1, GNUNET_NO);
- pos->connect_req =
- GNUNET_CORE_peer_request_connect (handle, &pos->pid,
- &connect_completed_callback, pos);
+ gettext_noop
+ ("# connect requests issued to transport"), 1,
+ GNUNET_NO);
+ GNUNET_TRANSPORT_try_connect (transport, &pos->pid);
}
*
* @param cls closure
* @param pid identity of a peer
- * @param value 'struct Peer*' for the peer we are considering
+ * @param value 'struct Peer*' for the peer we are considering
* @return GNUNET_YES (continue iteration)
*/
static int
* @param cls closure
* @param peer peer identity this notification is about
* @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
*/
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi,
+ unsigned int atsi_count)
{
struct Peer *pos;
* Iterator called on each address.
*
* @param cls flag that we will set if we see any addresses
- * @param tname name of the transport
+ * @param address the address of the peer
* @param expiration when will the given address expire
- * @param addr the address of the peer
- * @param addrlen number of bytes in addr
* @return GNUNET_SYSERR always, to terminate iteration
*/
static int
-address_iterator (void *cls, const char *tname,
- struct GNUNET_TIME_Absolute expiration, const void *addr,
- uint16_t addrlen)
+address_iterator (void *cls, const struct GNUNET_HELLO_Address *address,
+ struct GNUNET_TIME_Absolute expiration)
{
int *flag = cls;
* @param cls closure
* @param server handle to the server, NULL if we failed
* @param my_id ID of this peer, NULL if we failed
- * @param publicKey public key of this peer, NULL if we failed
*/
static void
core_init (void *cls, struct GNUNET_CORE_Handle *server,
- const struct GNUNET_PeerIdentity *my_id,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+ const struct GNUNET_PeerIdentity *my_id)
{
if (server == NULL)
{
* for loopback messages where we are both sender and receiver)
* @param message the actual HELLO message
* @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_encrypted_hello (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi,
+ unsigned int atsi_count)
{
struct Peer *peer;
struct GNUNET_PeerIdentity pid;
transport = GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL, NULL, NULL);
handle =
GNUNET_CORE_connect (cfg, 1, NULL, &core_init, &connect_notify,
- &disconnect_notify, NULL, NULL, GNUNET_NO, NULL,
- GNUNET_NO, handlers);
+ &disconnect_notify, NULL, GNUNET_NO, NULL, GNUNET_NO,
+ handlers);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleaning_task,
NULL);
if (NULL == transport)