[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8546 - in gnunet: . src/core src/include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8546 - in gnunet: . src/core src/include |
Date: |
Wed, 10 Jun 2009 23:22:06 -0600 |
Author: grothoff
Date: 2009-06-10 23:22:06 -0600 (Wed, 10 Jun 2009)
New Revision: 8546
Modified:
gnunet/TODO
gnunet/src/core/core.h
gnunet/src/core/core_api.c
gnunet/src/core/gnunet-service-core.c
gnunet/src/core/test_core_api.c
gnunet/src/core/test_core_api_start_only.c
gnunet/src/include/gnunet_core_service.h
Log:
API clean up
Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2009-06-11 05:16:19 UTC (rev 8545)
+++ gnunet/TODO 2009-06-11 05:22:06 UTC (rev 8546)
@@ -1,8 +1,6 @@
PHASE #1: (Goal: settle key design questions)
Core:
-* API review: should "bpm" and "last_activity" arguments be
- included in the ClientEventHandler?
* Internal: topology
* Internal: advertising (propagate other peers' HELLOs, find new ones)
* Internal: bootstrapping
Modified: gnunet/src/core/core.h
===================================================================
--- gnunet/src/core/core.h 2009-06-11 05:16:19 UTC (rev 8545)
+++ gnunet/src/core/core.h 2009-06-11 05:22:06 UTC (rev 8546)
@@ -112,24 +112,15 @@
struct GNUNET_MessageHeader header;
/**
- * Available bandwidth to this peer; zero for disconnect.
- * [TODO: currently set to hard-coded constant and hence
- * not really useful, right?]
+ * Always zero.
*/
- uint32_t bpm_available GNUNET_PACKED;
+ uint32_t reserved GNUNET_PACKED;
/**
* Identity of the connecting peer.
*/
struct GNUNET_PeerIdentity peer;
- /**
- * Time of our last interaction with the peer; close
- * to "now" for connect messages.
- * [TODO: is this useful?]
- */
- struct GNUNET_TIME_AbsoluteNBO last_activity;
-
};
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2009-06-11 05:16:19 UTC (rev 8545)
+++ gnunet/src/core/core_api.c 2009-06-11 05:22:06 UTC (rev 8546)
@@ -446,6 +446,8 @@
break;
}
cnm = (const struct ConnectNotifyMessage *) msg;
+ h->connects (h->cls,
+ &cnm->peer);
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT:
if (NULL == h->disconnects)
@@ -459,6 +461,8 @@
break;
}
cnm = (const struct ConnectNotifyMessage *) msg;
+ h->disconnects (h->cls,
+ &cnm->peer);
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND:
if (msize <
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2009-06-11 05:16:19 UTC (rev
8545)
+++ gnunet/src/core/gnunet-service-core.c 2009-06-11 05:22:06 UTC (rev
8546)
@@ -989,8 +989,7 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending `%s' message to client.\n", "NOTIFY_CONNECT");
#endif
- cnm.bpm_available = htonl (n->bpm_out);
- cnm.last_activity = GNUNET_TIME_absolute_hton (n->last_activity);
+ cnm.reserved = htonl (0);
cnm.peer = n->peer;
send_to_client (c, &cnm.header, GNUNET_NO);
n = n->next;
@@ -2997,9 +2996,8 @@
schedule_quota_update (n);
cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
- cnm.bpm_available = htonl (n->bpm_out);
+ cnm.reserved = htonl (0);
cnm.peer = *peer;
- cnm.last_activity = GNUNET_TIME_absolute_hton (now);
send_to_all_clients (&cnm.header, GNUNET_YES);
}
@@ -3079,9 +3077,8 @@
neighbour_count--;
cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT);
- cnm.bpm_available = htonl (0);
+ cnm.reserved = htonl (0);
cnm.peer = *peer;
- cnm.last_activity = GNUNET_TIME_absolute_hton (n->last_activity);
send_to_all_clients (&cnm.header, GNUNET_YES);
free_neighbour (n);
}
Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c 2009-06-11 05:16:19 UTC (rev 8545)
+++ gnunet/src/core/test_core_api.c 2009-06-11 05:22:06 UTC (rev 8546)
@@ -90,21 +90,18 @@
static void
connect_notify (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- unsigned int bpm, struct GNUNET_TIME_Absolute last_activity)
+ const struct GNUNET_PeerIdentity *peer)
{
GNUNET_assert ((ok == 5) || (ok == 6));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Encrypted connection established to peer `%4s' (%u bpm)\n",
- GNUNET_i2s (peer), bpm);
+ "Encrypted connection established to peer `%4s'\n",
+ GNUNET_i2s (peer));
}
static void
disconnect_notify (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- unsigned int bpm,
- struct GNUNET_TIME_Absolute last_activity)
+ const struct GNUNET_PeerIdentity *peer)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer));
Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c 2009-06-11 05:16:19 UTC (rev
8545)
+++ gnunet/src/core/test_core_api_start_only.c 2009-06-11 05:22:06 UTC (rev
8546)
@@ -71,17 +71,14 @@
static void
connect_notify (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- unsigned int bpm, struct GNUNET_TIME_Absolute last_activity)
+ const struct GNUNET_PeerIdentity *peer)
{
}
static void
disconnect_notify (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- unsigned int bpm,
- struct GNUNET_TIME_Absolute last_activity)
+ const struct GNUNET_PeerIdentity *peer)
{
}
Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h 2009-06-11 05:16:19 UTC (rev
8545)
+++ gnunet/src/include/gnunet_core_service.h 2009-06-11 05:22:06 UTC (rev
8546)
@@ -56,17 +56,10 @@
*
* @param cls closure
* @param peer peer identity this notification is about
- * @param bpm how much bandwidth is available
- * (for sending) to this peer
- * @param last_activity when did we last
- * receive anything from this peer?
*/
typedef void (*GNUNET_CORE_ClientEventHandler) (void *cls,
const struct
- GNUNET_PeerIdentity * peer,
- unsigned int bpm,
- struct GNUNET_TIME_Absolute
- last_activity);
+ GNUNET_PeerIdentity * peer);
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8546 - in gnunet: . src/core src/include,
gnunet <=