lossStatistics.h 706 Bytes
Newer Older
Andreas Schmidt's avatar
Andreas Schmidt committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef PRRT_LOSS_STATISTICS_H
#define PRRT_LOSS_STATISTICS_H

#include <stdint.h>

typedef struct lossStatistics {
    uint16_t packetCount;
    uint16_t erasureCount;
    uint16_t gapLength;
    uint16_t gapCount;
    uint16_t burstLength;
    uint16_t burstCount;
} PrrtLossStatistics;

PrrtLossStatistics PrrtLossStatistics_add(PrrtLossStatistics a, PrrtLossStatistics b);

#define LossStatistics_get_packet_loss_rate(stats) (((float) stats.erasureCount) / stats.packetCount)
#define LossStatistics_get_avg_gap_length(stats) (((float) stats.gapLength) / stats.gapCount)
#define LossStatistics_get_avg_burst_length(stats) (((float) stats.burstLength) / stats.burstCount)

#endif //PRRT_LOSS_STATISTICS_H