blob: 8d3c9bfa49155b8389f8fd57c68320382bbcc6b5 [file] [log] [blame]
Arnaldo Carvalho de Meloae6706f2005-08-27 23:03:09 -03001#ifndef _DCCP_LI_HIST_
2#define _DCCP_LI_HIST_
3/*
4 * net/dccp/ccids/lib/loss_interval.h
5 *
Ian McDonaldb2f41ff2007-05-28 12:23:29 -03006 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand.
7 * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz>
Arnaldo Carvalho de Meloae6706f2005-08-27 23:03:09 -03008 * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
14 */
15
Arnaldo Carvalho de Meloae6706f2005-08-27 23:03:09 -030016#include <linux/list.h>
17#include <linux/slab.h>
18#include <linux/time.h>
19
20#define DCCP_LI_HIST_IVAL_F_LENGTH 8
21
22struct dccp_li_hist {
Christoph Lametere18b8902006-12-06 20:33:20 -080023 struct kmem_cache *dccplih_slab;
Arnaldo Carvalho de Meloae6706f2005-08-27 23:03:09 -030024};
25
26extern struct dccp_li_hist *dccp_li_hist_new(const char *name);
27extern void dccp_li_hist_delete(struct dccp_li_hist *hist);
28
29struct dccp_li_hist_entry {
30 struct list_head dccplih_node;
31 u64 dccplih_seqno:48,
32 dccplih_win_count:4;
33 u32 dccplih_interval;
34};
35
Arnaldo Carvalho de Meloae6706f2005-08-27 23:03:09 -030036extern void dccp_li_hist_purge(struct dccp_li_hist *hist,
37 struct list_head *list);
38
39extern u32 dccp_li_hist_calc_i_mean(struct list_head *list);
40
Arnaldo Carvalho de Melocc0a9102007-06-14 17:41:28 -030041extern void dccp_li_update_li(struct sock *sk, struct dccp_li_hist *li_hist,
42 struct list_head *li_hist_list,
43 struct list_head *hist_list,
44 struct timeval *last_feedback, u16 s,
45 u32 bytes_recv, u32 previous_x_recv,
46 u64 seq_loss, u8 win_loss);
Arnaldo Carvalho de Meloae6706f2005-08-27 23:03:09 -030047#endif /* _DCCP_LI_HIST_ */