[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17316 - in gnunet/src: core dht fs hostlist include mesh n
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17316 - in gnunet/src: core dht fs hostlist include mesh nse testing topology |
Date: |
Mon, 10 Oct 2011 13:29:59 +0200 |
Author: grothoff
Date: 2011-10-10 13:29:59 +0200 (Mon, 10 Oct 2011)
New Revision: 17316
Modified:
gnunet/src/core/core_api.c
gnunet/src/core/test_core_api.c
gnunet/src/core/test_core_api_reliability.c
gnunet/src/core/test_core_api_send_to_self.c
gnunet/src/core/test_core_api_start_only.c
gnunet/src/core/test_core_quota_compliance.c
gnunet/src/dht/gnunet-service-dht_neighbours.c
gnunet/src/fs/gnunet-service-fs.c
gnunet/src/fs/gnunet-service-fs_cp.c
gnunet/src/fs/gnunet-service-fs_cp.h
gnunet/src/hostlist/gnunet-daemon-hostlist.c
gnunet/src/include/gnunet_ats_service.h
gnunet/src/include/gnunet_core_service.h
gnunet/src/include/gnunet_protocols.h
gnunet/src/mesh/gnunet-service-mesh.c
gnunet/src/mesh/mesh_api.c
gnunet/src/nse/gnunet-service-nse.c
gnunet/src/testing/testing.c
gnunet/src/topology/gnunet-daemon-topology.c
Log:
another core API simplification due to ATS introduction
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2011-10-10 11:23:37 UTC (rev 17315)
+++ gnunet/src/core/core_api.c 2011-10-10 11:29:59 UTC (rev 17316)
@@ -178,11 +178,6 @@
GNUNET_CORE_DisconnectEventHandler disconnects;
/**
- * Function to call whenever we're notified about a peer changing status.
- */
- GNUNET_CORE_PeerStatusEventHandler status_events;
-
- /**
* Function to call whenever we receive an inbound message.
*/
GNUNET_CORE_MessageCallback inbound_notify;
@@ -785,7 +780,6 @@
const struct DisconnectNotifyMessage *dnm;
const struct NotifyTrafficMessage *ntm;
const struct GNUNET_MessageHeader *em;
- const struct PeerStatusNotifyMessage *psnm;
const struct SendMessageReady *smr;
const struct GNUNET_CORE_MessageHandler *mh;
GNUNET_CORE_StartupCallback init;
@@ -941,52 +935,6 @@
if (trigger)
trigger_next_request (h, GNUNET_NO);
break;
- case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_STATUS_CHANGE:
- if (NULL == h->status_events)
- {
- GNUNET_break (0);
- return;
- }
- if (msize < sizeof (struct PeerStatusNotifyMessage))
- {
- GNUNET_break (0);
- reconnect_later (h);
- return;
- }
- psnm = (const struct PeerStatusNotifyMessage *) msg;
- if (0 == memcmp (&h->me, &psnm->peer, sizeof (struct GNUNET_PeerIdentity)))
- {
- /* self-change!? */
- GNUNET_break (0);
- return;
- }
- ats_count = ntohl (psnm->ats_count);
- if ((msize !=
- sizeof (struct PeerStatusNotifyMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)) ||
- (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR !=
- ntohl ((&psnm->ats)[ats_count].type)))
- {
- GNUNET_break (0);
- reconnect_later (h);
- return;
- }
-#if DEBUG_CORE > 1
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received notification about status change by `%s'.\n",
- GNUNET_i2s (&psnm->peer));
-#endif
- pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &psnm->peer.hashPubKey);
- if (pr == NULL)
- {
- GNUNET_break (0);
- reconnect_later (h);
- return;
- }
- h->status_events (h->cls, &psnm->peer, psnm->bandwidth_in,
- psnm->bandwidth_out,
- GNUNET_TIME_absolute_ntoh (psnm->timeout), &psnm->ats);
- break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND:
if (msize < sizeof (struct NotifyTrafficMessage))
{
@@ -1223,8 +1171,6 @@
init->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_INIT);
init->header.size = htons (msize);
opt = GNUNET_CORE_OPTION_SEND_CONNECT | GNUNET_CORE_OPTION_SEND_DISCONNECT;
- if (h->status_events != NULL)
- opt |= GNUNET_CORE_OPTION_SEND_STATUS_CHANGE;
if (h->inbound_notify != NULL)
{
if (h->inbound_hdr_only)
@@ -1261,7 +1207,6 @@
* connected to the core service; note that timeout is only meaningful
if init is not NULL
* @param connects function to call on peer connect, can be NULL
* @param disconnects function to call on peer disconnect / timeout, can be
NULL
- * @param status_events function to call on changes to peer connection status,
can be NULL
* @param inbound_notify function to call for all inbound messages, can be NULL
* @param inbound_hdr_only set to GNUNET_YES if inbound_notify will only read
the
* GNUNET_MessageHeader and hence we do not need to give it the
full message;
@@ -1280,7 +1225,6 @@
GNUNET_CORE_StartupCallback init,
GNUNET_CORE_ConnectEventHandler connects,
GNUNET_CORE_DisconnectEventHandler disconnects,
- GNUNET_CORE_PeerStatusEventHandler status_events,
GNUNET_CORE_MessageCallback inbound_notify,
int inbound_hdr_only,
GNUNET_CORE_MessageCallback outbound_notify,
@@ -1296,7 +1240,6 @@
h->init = init;
h->connects = connects;
h->disconnects = disconnects;
- h->status_events = status_events;
h->inbound_notify = inbound_notify;
h->outbound_notify = outbound_notify;
h->inbound_hdr_only = inbound_hdr_only;
Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c 2011-10-10 11:23:37 UTC (rev 17315)
+++ gnunet/src/core/test_core_api.c 2011-10-10 11:29:59 UTC (rev 17316)
@@ -299,7 +299,7 @@
/* connect p2 */
p2.ch =
GNUNET_CORE_connect (p2.cfg, 1, &p2, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify,
+ &disconnect_notify, &inbound_notify,
GNUNET_YES, &outbound_notify, GNUNET_YES,
handlers);
}
@@ -347,7 +347,7 @@
&terminate_task_error, NULL);
p1.ch =
GNUNET_CORE_connect (p1.cfg, 1, &p1, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify,
+ &disconnect_notify, &inbound_notify,
GNUNET_YES, &outbound_notify, GNUNET_YES, handlers);
}
Modified: gnunet/src/core/test_core_api_reliability.c
===================================================================
--- gnunet/src/core/test_core_api_reliability.c 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/core/test_core_api_reliability.c 2011-10-10 11:29:59 UTC (rev
17316)
@@ -381,7 +381,7 @@
OKPP;
/* connect p2 */
GNUNET_CORE_connect (p2.cfg, 1, &p2, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify, GNUNET_YES,
+ &disconnect_notify, &inbound_notify, GNUNET_YES,
&outbound_notify, GNUNET_YES, handlers);
}
else
@@ -451,7 +451,7 @@
err_task =
GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
GNUNET_CORE_connect (p1.cfg, 1, &p1, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify, GNUNET_YES,
+ &disconnect_notify, &inbound_notify, GNUNET_YES,
&outbound_notify, GNUNET_YES, handlers);
}
Modified: gnunet/src/core/test_core_api_send_to_self.c
===================================================================
--- gnunet/src/core/test_core_api_send_to_self.c 2011-10-10 11:23:37 UTC
(rev 17315)
+++ gnunet/src/core/test_core_api_send_to_self.c 2011-10-10 11:29:59 UTC
(rev 17316)
@@ -182,7 +182,7 @@
"test_core_api_peer1.conf"));
core =
- GNUNET_CORE_connect (core_cfg, 42, NULL, &init, &connect_cb, NULL, NULL,
+ GNUNET_CORE_connect (core_cfg, 42, NULL, &init, &connect_cb, NULL,
NULL, 0, NULL, 0, handlers);
die_task =
Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/core/test_core_api_start_only.c 2011-10-10 11:29:59 UTC (rev
17316)
@@ -127,7 +127,7 @@
/* connect p2 */
p2.ch =
GNUNET_CORE_connect (p2.cfg, 1, &p2, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify,
+ &disconnect_notify, &inbound_notify,
GNUNET_YES, &outbound_notify, GNUNET_YES,
handlers);
}
@@ -190,7 +190,7 @@
&timeout_task, NULL);
p1.ch =
GNUNET_CORE_connect (p1.cfg, 1, &p1, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify,
+ &disconnect_notify, &inbound_notify,
GNUNET_YES, &outbound_notify, GNUNET_YES, handlers);
}
Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c 2011-10-10 11:23:37 UTC
(rev 17315)
+++ gnunet/src/core/test_core_quota_compliance.c 2011-10-10 11:29:59 UTC
(rev 17316)
@@ -520,7 +520,7 @@
OKPP;
/* connect p2 */
p2.ch = GNUNET_CORE_connect (p2.cfg, 1, &p2, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify,
GNUNET_YES,
+ &disconnect_notify, &inbound_notify,
GNUNET_YES,
&outbound_notify, GNUNET_YES, handlers);
}
else
@@ -630,7 +630,7 @@
¤t_quota_p2_out));
p1.ch = GNUNET_CORE_connect (p1.cfg, 1, &p1, &init_notify, &connect_notify,
- &disconnect_notify, NULL, &inbound_notify,
GNUNET_YES,
+ &disconnect_notify, &inbound_notify, GNUNET_YES,
&outbound_notify, GNUNET_YES, handlers);
}
Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c 2011-10-10 11:23:37 UTC
(rev 17315)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c 2011-10-10 11:29:59 UTC
(rev 17316)
@@ -2053,7 +2053,6 @@
&core_init,
&handle_core_connect,
&handle_core_disconnect,
- NULL, /* Do we care about "status" updates?
*/
NULL, GNUNET_NO,
NULL, GNUNET_NO,
core_handlers);
Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c 2011-10-10 11:23:37 UTC (rev 17315)
+++ gnunet/src/fs/gnunet-service-fs.c 2011-10-10 11:29:59 UTC (rev 17316)
@@ -508,7 +508,7 @@
NULL, &peer_init_handler,
&peer_connect_handler,
&GSF_peer_disconnect_handler_,
- &GSF_peer_status_handler_, NULL, GNUNET_NO,
+ NULL, GNUNET_NO,
NULL, GNUNET_NO, p2p_handlers);
if (NULL == GSF_core)
{
Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/fs/gnunet-service-fs_cp.c 2011-10-10 11:29:59 UTC (rev
17316)
@@ -1503,32 +1503,6 @@
/**
- * Method called whenever a given peer has a status change.
- *
- * @param cls closure
- * @param peer peer identity this notification is about
- * @param bandwidth_in available amount of inbound bandwidth
- * @param bandwidth_out available amount of outbound bandwidth
- * @param timeout absolute time when this peer will time out
- * unless we see some further activity from it
- * @param atsi status information
- */
-void
-GSF_peer_status_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
- struct GNUNET_TIME_Absolute timeout,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
-{
- struct GSF_ConnectedPeer *cp;
-
- cp = GNUNET_CONTAINER_multihashmap_get (cp_map, &peer->hashPubKey);
- GNUNET_assert (NULL != cp);
- update_atsi (cp, atsi);
-}
-
-
-/**
* A peer disconnected from us. Tear down the connected peer
* record.
*
Modified: gnunet/src/fs/gnunet-service-fs_cp.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.h 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/fs/gnunet-service-fs_cp.h 2011-10-10 11:29:59 UTC (rev
17316)
@@ -253,25 +253,6 @@
/**
- * Method called whenever a given peer has a status change.
- *
- * @param cls closure
- * @param peer peer identity this notification is about
- * @param bandwidth_in available amount of inbound bandwidth
- * @param bandwidth_out available amount of outbound bandwidth
- * @param timeout absolute time when this peer will time out
- * unless we see some further activity from it
- * @param atsi status information
- */
-void
-GSF_peer_status_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
- struct GNUNET_TIME_Absolute timeout,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi);
-
-
-/**
* Handle P2P "MIGRATION_STOP" message.
*
* @param cls closure, always NULL
Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c 2011-10-10 11:23:37 UTC
(rev 17315)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c 2011-10-10 11:29:59 UTC
(rev 17316)
@@ -259,7 +259,7 @@
core =
GNUNET_CORE_connect (cfg, 1, NULL, &core_init, &connect_handler,
- &disconnect_handler, NULL, NULL, GNUNET_NO, NULL,
+ &disconnect_handler, NULL, GNUNET_NO, NULL,
GNUNET_NO,
learning ? learn_handlers : no_learn_handlers);
Modified: gnunet/src/include/gnunet_ats_service.h
===================================================================
--- gnunet/src/include/gnunet_ats_service.h 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/include/gnunet_ats_service.h 2011-10-10 11:29:59 UTC (rev
17316)
@@ -282,7 +282,8 @@
* @param preference increase incoming traffic share preference by this amount;
* in the absence of "amount" reservations, we use this
* preference value to assign proportional bandwidth shares
- * to all connected peers
+ * to all connected peers; in the future, this should be
+ * replaced with more specific QoS expressions...
* @param info function to call with the resulting configuration information
* @param info_cls closure for info
* @return NULL on error
Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/include/gnunet_core_service.h 2011-10-10 11:29:59 UTC (rev
17316)
@@ -67,33 +67,6 @@
/**
- * Method called whenever a given peer has a status change.
- *
- * @param cls closure
- * @param peer peer identity this notification is about
- * @param timeout absolute time when this peer will time out
- * unless we see some further activity from it
- * @param bandwidth_in available amount of inbound bandwidth
- * @param bandwidth_out available amount of outbound bandwidth
- * @param atsi performance data for the connection
- */
-typedef void (*GNUNET_CORE_PeerStatusEventHandler) (void *cls,
- const struct
- GNUNET_PeerIdentity * peer,
- struct
- GNUNET_BANDWIDTH_Value32NBO
- bandwidth_in,
- struct
- GNUNET_BANDWIDTH_Value32NBO
- bandwidth_out,
- struct GNUNET_TIME_Absolute
- timeout,
- const struct
-
GNUNET_TRANSPORT_ATS_Information
- * atsi);
-
-
-/**
* Method called whenever a peer disconnects.
*
* @param cls closure
@@ -186,7 +159,6 @@
* connected to the core service; note that timeout is only meaningful
if init is not NULL
* @param connects function to call on peer connect, can be NULL
* @param disconnects function to call on peer disconnect / timeout, can be
NULL
- * @param status_events function to call on peer status changes, can be NULL
* @param inbound_notify function to call for all inbound messages, can be NULL
* note that the core is allowed to drop notifications about
inbound
* messages if the client does not process them fast enough
(for this
@@ -220,7 +192,6 @@
GNUNET_CORE_StartupCallback init,
GNUNET_CORE_ConnectEventHandler connects,
GNUNET_CORE_DisconnectEventHandler disconnects,
- GNUNET_CORE_PeerStatusEventHandler status_events,
GNUNET_CORE_MessageCallback inbound_notify,
int inbound_hdr_only,
GNUNET_CORE_MessageCallback outbound_notify,
Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/include/gnunet_protocols.h 2011-10-10 11:29:59 UTC (rev
17316)
@@ -402,12 +402,6 @@
#define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND 71
/**
- * Response from server about (possibly updated) P2P
- * connection configuration.
- */
-#define GNUNET_MESSAGE_TYPE_CORE_CONFIGURATION_INFO 73
-
-/**
* Request from client to transmit message.
*/
#define GNUNET_MESSAGE_TYPE_CORE_SEND_REQUEST 74
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2011-10-10 11:23:37 UTC (rev
17315)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2011-10-10 11:29:59 UTC (rev
17316)
@@ -3370,7 +3370,6 @@
&core_init, /* Call core_init once
connected */
&core_connect, /* Handle connects */
&core_disconnect, /* remove peers on
disconnects */
- NULL, /* Do we care about "status"
updates? */
NULL, /* Don't notify about all
incoming messages */
GNUNET_NO, /* For header only in
notification */
NULL, /* Don't notify about all
outbound messages */
Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c 2011-10-10 11:23:37 UTC (rev 17315)
+++ gnunet/src/mesh/mesh_api.c 2011-10-10 11:29:59 UTC (rev 17316)
@@ -872,7 +872,7 @@
ret->core =
GNUNET_CORE_connect (cfg, 42, ret, &core_startup, &core_connect,
- &core_disconnect, NULL, NULL, GNUNET_NO, NULL,
+ &core_disconnect, NULL, GNUNET_NO, NULL,
GNUNET_NO, core_handlers);
ret->transport =
GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL, NULL, NULL);
Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2011-10-10 11:23:37 UTC (rev 17315)
+++ gnunet/src/nse/gnunet-service-nse.c 2011-10-10 11:29:59 UTC (rev 17316)
@@ -1360,7 +1360,6 @@
&core_init, /* Call core_init once
connected */
&handle_core_connect, /* Handle connects */
&handle_core_disconnect, /* Handle
disconnects */
- NULL, /* Do we care about "status" updates?
*/
NULL, /* Don't want notified about all
incoming messages */
GNUNET_NO, /* For header only inbound
notification */
NULL, /* Don't want notified about all
outbound messages */
Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c 2011-10-10 11:23:37 UTC (rev 17315)
+++ gnunet/src/testing/testing.c 2011-10-10 11:29:59 UTC (rev 17316)
@@ -1994,7 +1994,7 @@
ctx->d1core_ready = GNUNET_NO;
ctx->d1core =
GNUNET_CORE_connect (ctx->d1->cfg, 1, ctx, &core_init_notify,
- &connect_notify, NULL, NULL, NULL, GNUNET_NO, NULL,
+ &connect_notify, NULL, NULL, GNUNET_NO, NULL,
GNUNET_NO, no_handlers);
if (ctx->d1core == NULL)
{
@@ -2115,7 +2115,7 @@
#endif
ctx->d1core =
GNUNET_CORE_connect (ctx->d1->cfg, 1, ctx, &core_init_notify,
- &connect_notify, NULL, NULL, NULL, GNUNET_NO,
NULL,
+ &connect_notify, NULL, NULL, GNUNET_NO, NULL,
GNUNET_NO, no_handlers);
}
Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c 2011-10-10 11:23:37 UTC
(rev 17315)
+++ gnunet/src/topology/gnunet-daemon-topology.c 2011-10-10 11:29:59 UTC
(rev 17316)
@@ -1278,7 +1278,7 @@
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,
+ &disconnect_notify, NULL, GNUNET_NO, NULL,
GNUNET_NO, handlers);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleaning_task,
NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17316 - in gnunet/src: core dht fs hostlist include mesh nse testing topology,
gnunet <=