aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/bandwidth.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index 1ed87ff9b..3b9b64239 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -61,7 +61,26 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1,
61{ 61{
62 return 62 return
63 GNUNET_BANDWIDTH_value_init (GNUNET_MIN 63 GNUNET_BANDWIDTH_value_init (GNUNET_MIN
64 (ntohl (b1.value__), ntohl (b2.value__))); 64 (ntohl (b1.value__),
65 ntohl (b2.value__)));
66}
67
68
69/**
70 * Compute the MAX of two bandwidth values.
71 *
72 * @param b1 first value
73 * @param b2 second value
74 * @return the min of b1 and b2
75 */
76struct GNUNET_BANDWIDTH_Value32NBO
77GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1,
78 struct GNUNET_BANDWIDTH_Value32NBO b2)
79{
80 return
81 GNUNET_BANDWIDTH_value_init (GNUNET_MAX
82 (ntohl (b1.value__),
83 ntohl (b2.value__)));
65} 84}
66 85
67 86