diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-02-05 16:02:05 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-02-05 16:02:05 +0000 |
commit | b839234911d97f59e81a8851f2ee873541776dc0 (patch) | |
tree | 53e4075cc0b8a6be6ceb3060641b905cb5b7efb9 /src/transport/transport_api.c | |
parent | 5b8d8b20b1173decf43ab53bb0d431cc35553c3e (diff) | |
download | gnunet-b839234911d97f59e81a8851f2ee873541776dc0.tar.gz gnunet-b839234911d97f59e81a8851f2ee873541776dc0.zip |
docu
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 966a71ee3..7f0bc92d2 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -1207,6 +1207,32 @@ send_metric (void *cls, size_t size, void *buf) | |||
1207 | return ssize; | 1207 | return ssize; |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | |||
1211 | /** | ||
1212 | * Set transport metrics for a peer and a direction | ||
1213 | * | ||
1214 | * @param handle transport handle | ||
1215 | * @param peer the peer to set the metric for | ||
1216 | * @param direction can be: TM_SEND, TM_RECV, TM_BOTH | ||
1217 | * @param ats the metric as ATS information | ||
1218 | * @param ats_count the number of metrics | ||
1219 | * | ||
1220 | * Supported ATS values: | ||
1221 | * GNUNET_ATS_QUALITY_NET_DELAY (value in ms) | ||
1222 | * GNUNET_ATS_QUALITY_NET_DISTANCE (value in #hops) | ||
1223 | * | ||
1224 | * Example | ||
1225 | * To enforce a delay of 10 ms for peer p1 in sending direction use: | ||
1226 | * | ||
1227 | * struct GNUNET_ATS_Information ats; | ||
1228 | * ats.type = ntohl (GNUNET_ATS_QUALITY_NET_DELAY); | ||
1229 | * ats.value = ntohl (10); | ||
1230 | * GNUNET_TRANSPORT_set_traffic_metric (th, p1, TM_SEND, &ats, 1); | ||
1231 | * | ||
1232 | * Note: | ||
1233 | * Delay restrictions in receiving direction will be enforced with | ||
1234 | * 1 message delay. | ||
1235 | */ | ||
1210 | void | 1236 | void |
1211 | GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle, | 1237 | GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle, |
1212 | const struct GNUNET_PeerIdentity *peer, | 1238 | const struct GNUNET_PeerIdentity *peer, |