X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Fbandwidth.c;h=3b9b64239b9a12a1167a6ed671a0474991ba961c;hb=65f518e8036699fa3c574266d39e3cd1263af9e8;hp=ceec09b52be5c65eb93920ef1fe888b997d0d4d9;hpb=f1f603c7d0b3f03dca46a4f313472288eb080eb1;p=oweals%2Fgnunet.git diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c index ceec09b52..3b9b64239 100644 --- a/src/util/bandwidth.c +++ b/src/util/bandwidth.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2010, 2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2010, 2013 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -61,7 +61,26 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, { return GNUNET_BANDWIDTH_value_init (GNUNET_MIN - (ntohl (b1.value__), ntohl (b2.value__))); + (ntohl (b1.value__), + ntohl (b2.value__))); +} + + +/** + * Compute the MAX of two bandwidth values. + * + * @param b1 first value + * @param b2 second value + * @return the min of b1 and b2 + */ +struct GNUNET_BANDWIDTH_Value32NBO +GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1, + struct GNUNET_BANDWIDTH_Value32NBO b2) +{ + return + GNUNET_BANDWIDTH_value_init (GNUNET_MAX + (ntohl (b1.value__), + ntohl (b2.value__))); }