Revision 74a5d4ae measures-monl.c

View differences:

measures-monl.c
246 246
/*
247 247
 * Helper to retrieve a measure
248 248
*/
249
double get_measure(const struct nodeID *id, int j, enum stat_types st)
249
double get_measure(struct nodeID *id, int j, enum stat_types st)
250 250
{
251 251
	return (id->n_mhs > j) ? monRetrieveResult(id->mhs[j], st) : NAN;
252 252
}
......
254 254
/*
255 255
 * Hopcount to a given peer
256 256
*/
257
int get_hopcount(const struct nodeID *id){
257
int get_hopcount(struct nodeID *id){
258 258
	double r = get_measure(id, 0, LAST);
259 259
	return isnan(r) ? -1 : (int) r;
260 260
}
......
262 262
/*
263 263
 * RTT to a given peer in seconds
264 264
*/
265
double get_rtt(const struct nodeID *id){
265
double get_rtt(struct nodeID *id){
266 266
	return get_measure(id, 1, WIN_AVG);
267 267
}
268 268

  
269 269
/*
270 270
 * average RTT to a set of peers in seconds
271 271
*/
272
double get_average_rtt(const struct nodeID **ids, int len){
272
double get_average_rtt(struct nodeID **ids, int len){
273 273
	int i;
274 274
	int n = 0;
275 275
	double sum = 0;
......
287 287
/*
288 288
 * loss ratio from a given peer as 0..1
289 289
*/
290
double get_lossrate(const struct nodeID *id){
290
double get_lossrate(struct nodeID *id){
291 291
	return get_measure(id, 2, WIN_AVG);
292 292
}
293 293

  
294 294
/*
295 295
 * average loss ratio from a set of peers as 0..1
296 296
*/
297
double get_average_lossrate(const struct nodeID **ids, int len){
297
double get_average_lossrate(struct nodeID **ids, int len){
298 298
	int i;
299 299
	int n = 0;
300 300
	double sum = 0;

Also available in: Unified diff