From: Matthias Wachs Date: Wed, 29 Sep 2010 12:24:37 +0000 (+0000) Subject: added basic definition of quality information X-Git-Tag: initial-import-from-subversion-38251~20240 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=43f689d4b50ac03747908ac64c9bc56a411c3cfe;p=oweals%2Fgnunet.git added basic definition of quality information --- 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 @@ -24,12 +24,25 @@ * @author Matthias Wachs */ +/** + * The structs defined here are used by the transport plugin to tell ATS about the transport's properties like cost and quality + * and on the other side the structs are used by highlevel components to communicate the constraints they have for a transprot to ATS + * + * +---+ + * +-----------+ Constraints | | Plugin properties +---------+ + * | Highlevel |------------> |ATS| <------------------|Transport| + * | Component | ATS struct | | ATS struct | Plugin | + * +-----------+ | | +---------+ + * +---+ + * + */ + + /** * Enum defining all known cost types for ATS * Enum values are used in the GNUNET_ATS_Cost_Information struct as (key,value)-pair * 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] */ - enum GNUNET_ATS_Cost_Type { /* @@ -161,7 +174,7 @@ enum GNUNET_ATS_Cost_Type }; /** - * This structure will be used by plugins to communicate costs to ATS + * This structure will be used by plugins to communicate costs to ATS or by higher level components to tell ATS their constraints * Always a pair of (GNUNET_ATS_Cost_Types, uint32_t value) * Value is always uint32_t, so all units used to define costs have to be normalized to fit uint32_t */ @@ -177,3 +190,62 @@ struct GNUNET_ATS_Cost_Information */ uint32_t cost_value; }; + +/** + * Enum defining all known quality types for ATS + * Enum values are used in the GNUNET_ATS_Cost_Information struct as (key,value)-pair + * 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] + */ + +enum GNUNET_ATS_Quality_Type +{ + /* + * Quality will be passed as struct GNUNET_ATS_Quality_Information[] + * array is 0-terminated: + * the last element in the array is the pair (GNUNET_ATS_ARRAY_TERMINATOR, 0) + */ + GNUNET_ATS_ARRAY_TERMINATOR = 0, + + /* Physical layer quality properties */ + + GNUNET_ATS_PHY_SIGNAL_STRENGTH = 1, + + GNUNET_ATS_PHY_COLLISION_RATE = 2, + + GNUNET_ATS_PHY_ERROR_RATE = 3, + + /* Network layer quality properties */ + + GNUNET_ATS_NET_DELAY = 4, + + GNUNET_ATS_NET_LOSSRATE = 5, + + GNUNET_ATS_NET_ERRORRATE = 6, + + GNUNET_ATS_NET_DROPRATE = 6, + + GNUNET_ATS_NET_JITTER = 6, + + GNUNET_ATS_NET_THROUGHPUT = 7, +}; + +/** + * This structure will be used by plugins to communicate quality to ATS or by higher level components to tell ATS their + * quality constraints + * + * Always a pair of (GNUNET_ATS_Quality_Type, uint32_t value) + * Value is always uint32_t, so all units used to define quality values have to be normalized to fit uint32_t + */ +struct GNUNET_ATS_Quality_Information +{ + /** + * ATS Quality Type + */ + uint32_t quality_type; + + /** + * ATS Quality value + */ + uint32_t quality_value; +}; +