aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-09-29 12:24:37 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-09-29 12:24:37 +0000
commit43f689d4b50ac03747908ac64c9bc56a411c3cfe (patch)
tree05fc5893e8f6f57c50497314ee4fb72ffd2e63b4 /src/transport
parent174ef345169fe0cc4894e950b3b358b867430875 (diff)
downloadgnunet-43f689d4b50ac03747908ac64c9bc56a411c3cfe.tar.gz
gnunet-43f689d4b50ac03747908ac64c9bc56a411c3cfe.zip
added basic definition of quality information
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/transport_selection.h76
1 files changed, 74 insertions, 2 deletions
diff --git a/src/transport/transport_selection.h b/src/transport/transport_selection.h
index 4e6ccc81f..f07da2682 100644
--- a/src/transport/transport_selection.h
+++ b/src/transport/transport_selection.h
@@ -25,11 +25,24 @@
25 */ 25 */
26 26
27/** 27/**
28 * The structs defined here are used by the transport plugin to tell ATS about the transport's properties like cost and quality
29 * and on the other side the structs are used by highlevel components to communicate the constraints they have for a transprot to ATS
30 *
31 * +---+
32 * +-----------+ Constraints | | Plugin properties +---------+
33 * | Highlevel |------------> |ATS| <------------------|Transport|
34 * | Component | ATS struct | | ATS struct | Plugin |
35 * +-----------+ | | +---------+
36 * +---+
37 *
38 */
39
40
41/**
28 * Enum defining all known cost types for ATS 42 * Enum defining all known cost types for ATS
29 * Enum values are used in the GNUNET_ATS_Cost_Information struct as (key,value)-pair 43 * Enum values are used in the GNUNET_ATS_Cost_Information struct as (key,value)-pair
30 * Cost are always stored in uint32_t, so all units used to define costs have to be normalized to fit in uint32_t [0 .. 4.294.967.295] 44 * Cost are always stored in uint32_t, so all units used to define costs have to be normalized to fit in uint32_t [0 .. 4.294.967.295]
31 */ 45 */
32
33enum GNUNET_ATS_Cost_Type 46enum GNUNET_ATS_Cost_Type
34{ 47{
35 /* 48 /*
@@ -161,7 +174,7 @@ enum GNUNET_ATS_Cost_Type
161}; 174};
162 175
163/** 176/**
164 * This structure will be used by plugins to communicate costs to ATS 177 * This structure will be used by plugins to communicate costs to ATS or by higher level components to tell ATS their constraints
165 * Always a pair of (GNUNET_ATS_Cost_Types, uint32_t value) 178 * Always a pair of (GNUNET_ATS_Cost_Types, uint32_t value)
166 * Value is always uint32_t, so all units used to define costs have to be normalized to fit uint32_t 179 * Value is always uint32_t, so all units used to define costs have to be normalized to fit uint32_t
167 */ 180 */
@@ -177,3 +190,62 @@ struct GNUNET_ATS_Cost_Information
177 */ 190 */
178 uint32_t cost_value; 191 uint32_t cost_value;
179}; 192};
193
194/**
195 * Enum defining all known quality types for ATS
196 * Enum values are used in the GNUNET_ATS_Cost_Information struct as (key,value)-pair
197 * Cost are always stored in uint32_t, so all units used to define costs have to be normalized to fit in uint32_t [0 .. 4.294.967.295]
198 */
199
200enum GNUNET_ATS_Quality_Type
201{
202 /*
203 * Quality will be passed as struct GNUNET_ATS_Quality_Information[]
204 * array is 0-terminated:
205 * the last element in the array is the pair (GNUNET_ATS_ARRAY_TERMINATOR, 0)
206 */
207 GNUNET_ATS_ARRAY_TERMINATOR = 0,
208
209 /* Physical layer quality properties */
210
211 GNUNET_ATS_PHY_SIGNAL_STRENGTH = 1,
212
213 GNUNET_ATS_PHY_COLLISION_RATE = 2,
214
215 GNUNET_ATS_PHY_ERROR_RATE = 3,
216
217 /* Network layer quality properties */
218
219 GNUNET_ATS_NET_DELAY = 4,
220
221 GNUNET_ATS_NET_LOSSRATE = 5,
222
223 GNUNET_ATS_NET_ERRORRATE = 6,
224
225 GNUNET_ATS_NET_DROPRATE = 6,
226
227 GNUNET_ATS_NET_JITTER = 6,
228
229 GNUNET_ATS_NET_THROUGHPUT = 7,
230};
231
232/**
233 * This structure will be used by plugins to communicate quality to ATS or by higher level components to tell ATS their
234 * quality constraints
235 *
236 * Always a pair of (GNUNET_ATS_Quality_Type, uint32_t value)
237 * Value is always uint32_t, so all units used to define quality values have to be normalized to fit uint32_t
238 */
239struct GNUNET_ATS_Quality_Information
240{
241 /**
242 * ATS Quality Type
243 */
244 uint32_t quality_type;
245
246 /**
247 * ATS Quality value
248 */
249 uint32_t quality_value;
250};
251