diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-18 03:18:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-18 03:18:32 -0400 |
commit | 65299d6c3cfb49cc3eee4fc483e7edd23ea7b2ed (patch) | |
tree | 111ec511694c75d2bc0f7404f6ea02b6230cae7a | |
parent | ae31c3399d17b1f7bc1742724f70476b5417744f (diff) |
[CCID3]: Introduce include/linux/tfrc.h
Moving the TFRC sender and receiver variables to separate structs, so
that we can copy these structs to userspace thru getsockopt,
dccp_diag, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/tfrc.h | 35 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.h | 23 |
2 files changed, 48 insertions, 10 deletions
diff --git a/include/linux/tfrc.h b/include/linux/tfrc.h new file mode 100644 index 000000000000..7dab7831c3cb --- /dev/null +++ b/include/linux/tfrc.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _LINUX_TFRC_H_ | ||
2 | #define _LINUX_TFRC_H_ | ||
3 | /* | ||
4 | * include/linux/tfrc.h | ||
5 | * | ||
6 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. | ||
7 | * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> | ||
8 | * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
9 | * Copyright (c) 2003 Nils-Erik Mattsson, Joacim Haggmark, Magnus Erixzon | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | |||
19 | struct tfrc_rx_info { | ||
20 | __u32 tfrcrx_x_recv; | ||
21 | __u32 tfrcrx_rtt; | ||
22 | __u32 tfrcrx_p; | ||
23 | }; | ||
24 | |||
25 | struct tfrc_tx_info { | ||
26 | __u32 tfrctx_x; | ||
27 | __u32 tfrctx_x_recv; | ||
28 | __u32 tfrctx_x_calc; | ||
29 | __u32 tfrctx_rtt; | ||
30 | __u32 tfrctx_p; | ||
31 | __u32 tfrctx_rto; | ||
32 | __u32 tfrctx_ipi; | ||
33 | }; | ||
34 | |||
35 | #endif /* _LINUX_TFRC_H_ */ | ||
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h index eb248778eea3..0bde4583d091 100644 --- a/net/dccp/ccids/ccid3.h +++ b/net/dccp/ccids/ccid3.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/list.h> | 40 | #include <linux/list.h> |
41 | #include <linux/time.h> | 41 | #include <linux/time.h> |
42 | #include <linux/types.h> | 42 | #include <linux/types.h> |
43 | #include <linux/tfrc.h> | ||
43 | 44 | ||
44 | #define TFRC_MIN_PACKET_SIZE 16 | 45 | #define TFRC_MIN_PACKET_SIZE 16 |
45 | #define TFRC_STD_PACKET_SIZE 256 | 46 | #define TFRC_STD_PACKET_SIZE 256 |
@@ -93,12 +94,15 @@ struct ccid3_options_received { | |||
93 | * @ccid3hctx_hist - Packet history | 94 | * @ccid3hctx_hist - Packet history |
94 | */ | 95 | */ |
95 | struct ccid3_hc_tx_sock { | 96 | struct ccid3_hc_tx_sock { |
96 | u32 ccid3hctx_x; | 97 | struct tfrc_tx_info ccid3hctx_tfrc; |
97 | u32 ccid3hctx_x_recv; | 98 | #define ccid3hctx_x ccid3hctx_tfrc.tfrctx_x |
98 | u32 ccid3hctx_x_calc; | 99 | #define ccid3hctx_x_recv ccid3hctx_tfrc.tfrctx_x_recv |
100 | #define ccid3hctx_x_calc ccid3hctx_tfrc.tfrctx_x_calc | ||
101 | #define ccid3hctx_rtt ccid3hctx_tfrc.tfrctx_rtt | ||
102 | #define ccid3hctx_p ccid3hctx_tfrc.tfrctx_p | ||
103 | #define ccid3hctx_t_rto ccid3hctx_tfrc.tfrctx_rto | ||
104 | #define ccid3hctx_t_ipi ccid3hctx_tfrc.tfrctx_ipi | ||
99 | u16 ccid3hctx_s; | 105 | u16 ccid3hctx_s; |
100 | u32 ccid3hctx_rtt; | ||
101 | u32 ccid3hctx_p; | ||
102 | u8 ccid3hctx_state; | 106 | u8 ccid3hctx_state; |
103 | u8 ccid3hctx_last_win_count; | 107 | u8 ccid3hctx_last_win_count; |
104 | u8 ccid3hctx_idle; | 108 | u8 ccid3hctx_idle; |
@@ -106,19 +110,19 @@ struct ccid3_hc_tx_sock { | |||
106 | struct timer_list ccid3hctx_no_feedback_timer; | 110 | struct timer_list ccid3hctx_no_feedback_timer; |
107 | struct timeval ccid3hctx_t_ld; | 111 | struct timeval ccid3hctx_t_ld; |
108 | struct timeval ccid3hctx_t_nom; | 112 | struct timeval ccid3hctx_t_nom; |
109 | u32 ccid3hctx_t_rto; | ||
110 | u32 ccid3hctx_t_ipi; | ||
111 | u32 ccid3hctx_delta; | 113 | u32 ccid3hctx_delta; |
112 | struct list_head ccid3hctx_hist; | 114 | struct list_head ccid3hctx_hist; |
113 | struct ccid3_options_received ccid3hctx_options_received; | 115 | struct ccid3_options_received ccid3hctx_options_received; |
114 | }; | 116 | }; |
115 | 117 | ||
116 | struct ccid3_hc_rx_sock { | 118 | struct ccid3_hc_rx_sock { |
119 | struct tfrc_rx_info ccid3hcrx_tfrc; | ||
120 | #define ccid3hcrx_x_recv ccid3hcrx_tfrc.tfrcrx_x_recv | ||
121 | #define ccid3hcrx_rtt ccid3hcrx_tfrc.tfrcrx_rtt | ||
122 | #define ccid3hcrx_p ccid3hcrx_tfrc.tfrcrx_p | ||
117 | u64 ccid3hcrx_seqno_last_counter:48, | 123 | u64 ccid3hcrx_seqno_last_counter:48, |
118 | ccid3hcrx_state:8, | 124 | ccid3hcrx_state:8, |
119 | ccid3hcrx_last_counter:4; | 125 | ccid3hcrx_last_counter:4; |
120 | u32 ccid3hcrx_rtt; | ||
121 | u32 ccid3hcrx_p; | ||
122 | u32 ccid3hcrx_bytes_recv; | 126 | u32 ccid3hcrx_bytes_recv; |
123 | struct timeval ccid3hcrx_tstamp_last_feedback; | 127 | struct timeval ccid3hcrx_tstamp_last_feedback; |
124 | struct timeval ccid3hcrx_tstamp_last_ack; | 128 | struct timeval ccid3hcrx_tstamp_last_ack; |
@@ -127,7 +131,6 @@ struct ccid3_hc_rx_sock { | |||
127 | u16 ccid3hcrx_s; | 131 | u16 ccid3hcrx_s; |
128 | u32 ccid3hcrx_pinv; | 132 | u32 ccid3hcrx_pinv; |
129 | u32 ccid3hcrx_elapsed_time; | 133 | u32 ccid3hcrx_elapsed_time; |
130 | u32 ccid3hcrx_x_recv; | ||
131 | }; | 134 | }; |
132 | 135 | ||
133 | static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk) | 136 | static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk) |