diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-13 10:37:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-13 10:37:53 +0000 |
commit | 1bd94de53f074f451440dc9a8d466359f35f00c1 (patch) | |
tree | 4435032175333119ea157a2ded20e1121bc6e4ac /src/transport | |
parent | 6180140e3395ebec3c1e2ae50cd07f0feda24b40 (diff) | |
download | gnunet-1bd94de53f074f451440dc9a8d466359f35f00c1.tar.gz gnunet-1bd94de53f074f451440dc9a8d466359f35f00c1.zip |
traffic report is not used
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport-new.c | 92 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.c | 1 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.h | 1 |
3 files changed, 88 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-transport-new.c b/src/transport/gnunet-service-transport-new.c index cd1901a27..7b9ffe2ee 100644 --- a/src/transport/gnunet-service-transport-new.c +++ b/src/transport/gnunet-service-transport-new.c | |||
@@ -94,6 +94,47 @@ process_hello_update (void *cls, | |||
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | |||
98 | /** | ||
99 | * Function called by the transport for each received message. | ||
100 | * This function should also be called with "NULL" for the | ||
101 | * message to signal that the other peer disconnected. | ||
102 | * | ||
103 | * @param cls closure | ||
104 | * @param peer (claimed) identity of the other peer | ||
105 | * @param message the message, NULL if we only care about | ||
106 | * learning about the delay until we should receive again -- FIXME! | ||
107 | * @param distance in overlay hops; use 1 unless DV (or 0 if message == NULL) | ||
108 | * @param session identifier used for this session (NULL for plugins | ||
109 | * that do not offer bi-directional communication to the sender | ||
110 | * using the same "connection") | ||
111 | * @param sender_address binary address of the sender (if we established the | ||
112 | * connection or are otherwise sure of it; should be NULL | ||
113 | * for inbound TCP/UDP connections since it it not clear | ||
114 | * that we could establish ourselves a connection to that | ||
115 | * IP address and get the same system) | ||
116 | * @param sender_address_len number of bytes in sender_address | ||
117 | * @return how long the plugin should wait until receiving more data | ||
118 | * (plugins that do not support this, can ignore the return value) | ||
119 | */ | ||
120 | static struct GNUNET_TIME_Relative | ||
121 | plugin_env_receive_callback (void *cls, | ||
122 | const struct | ||
123 | GNUNET_PeerIdentity * | ||
124 | peer, | ||
125 | const struct | ||
126 | GNUNET_MessageHeader * | ||
127 | message, | ||
128 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | ||
129 | uint32_t ats_count, | ||
130 | struct Session *session, | ||
131 | const char *sender_address, | ||
132 | uint16_t sender_address_len) | ||
133 | { | ||
134 | return GNUNET_TIME_UNIT_ZERO; | ||
135 | } | ||
136 | |||
137 | |||
97 | /** | 138 | /** |
98 | * Function that will be called for each address the transport | 139 | * Function that will be called for each address the transport |
99 | * is aware that it might be reachable under. Update our HELLO. | 140 | * is aware that it might be reachable under. Update our HELLO. |
@@ -121,6 +162,50 @@ plugin_env_address_change_notification (void *cls, | |||
121 | 162 | ||
122 | 163 | ||
123 | /** | 164 | /** |
165 | * Function that will be called whenever the plugin internally | ||
166 | * cleans up a session pointer and hence the service needs to | ||
167 | * discard all of those sessions as well. Plugins that do not | ||
168 | * use sessions can simply omit calling this function and always | ||
169 | * use NULL wherever a session pointer is needed. This function | ||
170 | * should be called BEFORE a potential "TransmitContinuation" | ||
171 | * from the "TransmitFunction". | ||
172 | * | ||
173 | * @param cls closure | ||
174 | * @param peer which peer was the session for | ||
175 | * @param session which session is being destoyed | ||
176 | */ | ||
177 | static void | ||
178 | plugin_env_session_end (void *cls, | ||
179 | const struct GNUNET_PeerIdentity *peer, | ||
180 | struct Session *session) | ||
181 | { | ||
182 | } | ||
183 | |||
184 | |||
185 | /** | ||
186 | * Function called whenever the plugin has to notify ATS about costs for using this transport | ||
187 | * | ||
188 | * The cost will be passed as struct GNUNET_TRANSPORT_ATS_Cost_Information[] | ||
189 | * This array is 0-terminated, so the last element will be a pair: | ||
190 | * ((cost->cost_type==GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) && cost->cost_value==0)) | ||
191 | * | ||
192 | * @param cls closure | ||
193 | * @param peer peer | ||
194 | * @param addr peer address | ||
195 | * @param addrlen address length | ||
196 | * @param cost pointer to the first element of struct GNUNET_TRANSPORT_ATS_Cost_Information[] | ||
197 | */ | ||
198 | static void | ||
199 | plugin_env_cost_notification (void *cls, | ||
200 | const struct GNUNET_PeerIdentity *peer, | ||
201 | const void *addr, | ||
202 | uint16_t addrlen, | ||
203 | struct GNUNET_TRANSPORT_ATS_Information * cost) | ||
204 | { | ||
205 | } | ||
206 | |||
207 | |||
208 | /** | ||
124 | * Function called when the service shuts down. Unloads our plugins | 209 | * Function called when the service shuts down. Unloads our plugins |
125 | * and cancels pending validations. | 210 | * and cancels pending validations. |
126 | * | 211 | * |
@@ -216,11 +301,10 @@ run (void *cls, | |||
216 | /* start subsystems */ | 301 | /* start subsystems */ |
217 | GST_hello_start (&process_hello_update, NULL); | 302 | GST_hello_start (&process_hello_update, NULL); |
218 | GST_blacklist_start (server); | 303 | GST_blacklist_start (server); |
219 | GST_plugins_load (NULL, // FIXME... | 304 | GST_plugins_load (&plugin_env_receive_callback, |
220 | &plugin_env_address_change_notification, | 305 | &plugin_env_address_change_notification, |
221 | NULL, // FIXME... | 306 | &plugin_env_session_end, |
222 | NULL, // FIXME... | 307 | &plugin_env_cost_notification); |
223 | NULL); // FIXME... | ||
224 | GST_ats = GNUNET_ATS_init (GST_cfg, | 308 | GST_ats = GNUNET_ATS_init (GST_cfg, |
225 | NULL, // FIXME... | 309 | NULL, // FIXME... |
226 | NULL); // FIXME... | 310 | NULL); // FIXME... |
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c index bbc8d4183..bacafa5f3 100644 --- a/src/transport/gnunet-service-transport_plugins.c +++ b/src/transport/gnunet-service-transport_plugins.c | |||
@@ -94,7 +94,6 @@ static struct TransportPlugin *plugins_tail; | |||
94 | void | 94 | void |
95 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | 95 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, |
96 | GNUNET_TRANSPORT_AddressNotification address_cb, | 96 | GNUNET_TRANSPORT_AddressNotification address_cb, |
97 | GNUNET_TRANSPORT_TrafficReport traffic_cb, | ||
98 | GNUNET_TRANSPORT_SessionEnd session_end_cb, | 97 | GNUNET_TRANSPORT_SessionEnd session_end_cb, |
99 | GNUNET_TRANSPORT_CostReport cost_cb) | 98 | GNUNET_TRANSPORT_CostReport cost_cb) |
100 | { | 99 | { |
diff --git a/src/transport/gnunet-service-transport_plugins.h b/src/transport/gnunet-service-transport_plugins.h index f4a6857a2..ee93918c7 100644 --- a/src/transport/gnunet-service-transport_plugins.h +++ b/src/transport/gnunet-service-transport_plugins.h | |||
@@ -47,7 +47,6 @@ | |||
47 | void | 47 | void |
48 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | 48 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, |
49 | GNUNET_TRANSPORT_AddressNotification address_cb, | 49 | GNUNET_TRANSPORT_AddressNotification address_cb, |
50 | GNUNET_TRANSPORT_TrafficReport traffic_cb, | ||
51 | GNUNET_TRANSPORT_SessionEnd session_end_cb, | 50 | GNUNET_TRANSPORT_SessionEnd session_end_cb, |
52 | GNUNET_TRANSPORT_CostReport cost_cb); | 51 | GNUNET_TRANSPORT_CostReport cost_cb); |
53 | 52 | ||