aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-05 08:26:53 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-05 08:26:53 +0000
commit8cdbd31820ad0b71bbe3eb431723802bda7883df (patch)
tree829f297605846205c4bd5612b8a0b536b1d2f1fa /src/transport/gnunet-service-transport_neighbours.c
parent6b0266fa3464b54f37ec1e1f2ac0725b318b0027 (diff)
downloadgnunet-8cdbd31820ad0b71bbe3eb431723802bda7883df.tar.gz
gnunet-8cdbd31820ad0b71bbe3eb431723802bda7883df.zip
more client code
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 4107c0012..89a622d95 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -84,6 +84,64 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target)
84 84
85 85
86/** 86/**
87 * Transmit a message to the given target using the active connection.
88 *
89 * @param target destination
90 * @param msg message to send
91 * @param cont function to call when done
92 * @param cont_cls closure for 'cont'
93 */
94void
95GST_neighbours_send (const struct GNUNET_PeerIdentity *target,
96 const struct GNUNET_MessageHeader *msg,
97 GST_NeighbourSendContinuation cont,
98 void *cont_cls)
99{
100}
101
102
103/**
104 * Change the incoming quota for the given peer.
105 *
106 * @param neighbour identity of peer to change qutoa for
107 * @param quota new quota
108 */
109void
110GST_neighbours_set_quota (const struct GNUNET_PeerIdentity *neighbour,
111 struct GNUNET_BANDWIDTH_Value32NBO quota)
112{
113#if 0
114
115 n = find_neighbour (neighbour);
116 if (n == NULL)
117 {
118 GNUNET_STATISTICS_update (stats,
119 gettext_noop ("# SET QUOTA messages ignored (no such peer)"),
120 1,
121 GNUNET_NO);
122 return;
123 }
124 GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker,
125 quota);
126 if (0 != ntohl (qsm->quota.value__))
127 return;
128#if DEBUG_TRANSPORT
129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
130 "Disconnecting peer `%4s' due to `%s'\n",
131 GNUNET_i2s(&n->id),
132 "SET_QUOTA");
133#endif
134 GNUNET_STATISTICS_update (stats,
135 gettext_noop ("# disconnects due to quota of 0"),
136 1,
137 GNUNET_NO);
138 GST_neighbours_force_disconnect (neighbour);
139
140#endif
141}
142
143
144/**
87 * If we have an active connection to the given target, it must be shutdown. 145 * If we have an active connection to the given target, it must be shutdown.
88 * 146 *
89 * @param target peer to disconnect from 147 * @param target peer to disconnect from