aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_bandwidth_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-16 16:03:20 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-16 16:03:20 +0000
commit16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch)
treee09d4fe5191dc329b3e1b667f2914f8313bcba59 /src/include/gnunet_bandwidth_lib.h
parent4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff)
downloadgnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz
gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/include/gnunet_bandwidth_lib.h')
-rw-r--r--src/include/gnunet_bandwidth_lib.h64
1 files changed, 29 insertions, 35 deletions
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h
index e78d16552..75f71b32c 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -89,8 +89,8 @@ struct GNUNET_BANDWIDTH_Tracker
89 * @param bytes_per_second value to create 89 * @param bytes_per_second value to create
90 * @return the new bandwidth value 90 * @return the new bandwidth value
91 */ 91 */
92struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t 92struct GNUNET_BANDWIDTH_Value32NBO
93 bytes_per_second); 93GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second);
94 94
95 95
96/** 96/**
@@ -107,12 +107,11 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t
107 * @param deadline when is the deadline 107 * @param deadline when is the deadline
108 * @return number of bytes available at bps until deadline 108 * @return number of bytes available at bps until deadline
109 */ 109 */
110uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct 110uint64_t
111 GNUNET_BANDWIDTH_Value32NBO 111GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO
112 bps, 112 bps,
113 struct 113 struct GNUNET_TIME_Relative
114 GNUNET_TIME_Relative 114 deadline);
115 deadline);
116 115
117 116
118/** 117/**
@@ -123,11 +122,9 @@ uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct
123 * @param size number of bytes we want to have available 122 * @param size number of bytes we want to have available
124 * @return how long it would take 123 * @return how long it would take
125 */ 124 */
126struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct 125struct GNUNET_TIME_Relative
127 GNUNET_BANDWIDTH_Value32NBO 126GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps,
128 bps, 127 uint64_t size);
129 uint64_t
130 size);
131 128
132 129
133 130
@@ -138,12 +135,9 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct
138 * @param b2 second value 135 * @param b2 second value
139 * @return the min of b1 and b2 136 * @return the min of b1 and b2
140 */ 137 */
141struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct 138struct GNUNET_BANDWIDTH_Value32NBO
142 GNUNET_BANDWIDTH_Value32NBO 139GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1,
143 b1, 140 struct GNUNET_BANDWIDTH_Value32NBO b2);
144 struct
145 GNUNET_BANDWIDTH_Value32NBO
146 b2);
147 141
148 142
149/** 143/**
@@ -160,10 +154,10 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct
160 * @param max_carry_s maximum number of seconds unused bandwidth 154 * @param max_carry_s maximum number of seconds unused bandwidth
161 * may accumulate before it expires 155 * may accumulate before it expires
162 */ 156 */
163void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, 157void
164 struct GNUNET_BANDWIDTH_Value32NBO 158GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
165 bytes_per_second_limit, 159 struct GNUNET_BANDWIDTH_Value32NBO
166 uint32_t max_carry_s); 160 bytes_per_second_limit, uint32_t max_carry_s);
167 161
168 162
169/** 163/**
@@ -177,8 +171,9 @@ void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
177 * @param size number of bytes consumed 171 * @param size number of bytes consumed
178 * @return GNUNET_YES if this consumption is above the limit 172 * @return GNUNET_YES if this consumption is above the limit
179 */ 173 */
180int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, 174int
181 ssize_t size); 175GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
176 ssize_t size);
182 177
183 178
184/** 179/**
@@ -190,10 +185,9 @@ int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
190 * @param size number of bytes we would like to consume 185 * @param size number of bytes we would like to consume
191 * @return time to wait for consumption to be OK 186 * @return time to wait for consumption to be OK
192 */ 187 */
193struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct 188struct GNUNET_TIME_Relative
194 GNUNET_BANDWIDTH_Tracker 189GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av,
195 *av, 190 size_t size);
196 size_t size);
197 191
198 192
199/** 193/**
@@ -203,9 +197,8 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct
203 * @param av tracker to query 197 * @param av tracker to query
204 * @return number of bytes available for consumption right now 198 * @return number of bytes available for consumption right now
205 */ 199 */
206int64_t GNUNET_BANDWIDTH_tracker_get_available (struct 200int64_t
207 GNUNET_BANDWIDTH_Tracker 201GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av);
208 *av);
209 202
210 203
211/** 204/**
@@ -214,9 +207,10 @@ int64_t GNUNET_BANDWIDTH_tracker_get_available (struct
214 * @param av tracker to initialize 207 * @param av tracker to initialize
215 * @param bytes_per_second_limit new limit to assume 208 * @param bytes_per_second_limit new limit to assume
216 */ 209 */
217void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, 210void
218 struct GNUNET_BANDWIDTH_Value32NBO 211GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av,
219 bytes_per_second_limit); 212 struct GNUNET_BANDWIDTH_Value32NBO
213 bytes_per_second_limit);
220 214
221 215
222#if 0 /* keep Emacsens' auto-indent happy */ 216#if 0 /* keep Emacsens' auto-indent happy */