This source file includes following definitions.
- tfrc_lh_init
- tfrc_lh_is_initialised
- tfrc_lh_length
1
2 #ifndef _DCCP_LI_HIST_
3 #define _DCCP_LI_HIST_
4
5
6
7
8
9
10 #include <linux/ktime.h>
11 #include <linux/list.h>
12 #include <linux/slab.h>
13
14
15
16
17
18 #define NINTERVAL 8
19 #define LIH_SIZE (NINTERVAL + 1)
20
21
22
23
24
25
26
27
28 struct tfrc_loss_interval {
29 u64 li_seqno:48,
30 li_ccval:4,
31 li_is_closed:1;
32 u32 li_length;
33 };
34
35
36
37
38
39
40
41 struct tfrc_loss_hist {
42 struct tfrc_loss_interval *ring[LIH_SIZE];
43 u8 counter;
44 u32 i_mean;
45 };
46
47 static inline void tfrc_lh_init(struct tfrc_loss_hist *lh)
48 {
49 memset(lh, 0, sizeof(struct tfrc_loss_hist));
50 }
51
52 static inline u8 tfrc_lh_is_initialised(struct tfrc_loss_hist *lh)
53 {
54 return lh->counter > 0;
55 }
56
57 static inline u8 tfrc_lh_length(struct tfrc_loss_hist *lh)
58 {
59 return min(lh->counter, (u8)LIH_SIZE);
60 }
61
62 struct tfrc_rx_hist;
63
64 int tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *,
65 u32 (*first_li)(struct sock *), struct sock *);
66 u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *);
67 void tfrc_lh_cleanup(struct tfrc_loss_hist *lh);
68
69 #endif