[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>

authored by Arnaldo Carvalho de Melo and committed by David S. Miller 65299d6c ae31c339

+48 -10
+35
include/linux/tfrc.h
···
··· 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_ */
+13 -10
net/dccp/ccids/ccid3.h
··· 40 #include <linux/list.h> 41 #include <linux/time.h> 42 #include <linux/types.h> 43 44 #define TFRC_MIN_PACKET_SIZE 16 45 #define TFRC_STD_PACKET_SIZE 256 ··· 94 * @ccid3hctx_hist - Packet history 95 */ 96 struct ccid3_hc_tx_sock { 97 - u32 ccid3hctx_x; 98 - u32 ccid3hctx_x_recv; 99 - u32 ccid3hctx_x_calc; 100 u16 ccid3hctx_s; 101 - u32 ccid3hctx_rtt; 102 - u32 ccid3hctx_p; 103 u8 ccid3hctx_state; 104 u8 ccid3hctx_last_win_count; 105 u8 ccid3hctx_idle; ··· 110 struct timer_list ccid3hctx_no_feedback_timer; 111 struct timeval ccid3hctx_t_ld; 112 struct timeval ccid3hctx_t_nom; 113 - u32 ccid3hctx_t_rto; 114 - u32 ccid3hctx_t_ipi; 115 u32 ccid3hctx_delta; 116 struct list_head ccid3hctx_hist; 117 struct ccid3_options_received ccid3hctx_options_received; 118 }; 119 120 struct ccid3_hc_rx_sock { 121 u64 ccid3hcrx_seqno_last_counter:48, 122 ccid3hcrx_state:8, 123 ccid3hcrx_last_counter:4; 124 - u32 ccid3hcrx_rtt; 125 - u32 ccid3hcrx_p; 126 u32 ccid3hcrx_bytes_recv; 127 struct timeval ccid3hcrx_tstamp_last_feedback; 128 struct timeval ccid3hcrx_tstamp_last_ack; ··· 131 u16 ccid3hcrx_s; 132 u32 ccid3hcrx_pinv; 133 u32 ccid3hcrx_elapsed_time; 134 - u32 ccid3hcrx_x_recv; 135 }; 136 137 static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk)
··· 40 #include <linux/list.h> 41 #include <linux/time.h> 42 #include <linux/types.h> 43 + #include <linux/tfrc.h> 44 45 #define TFRC_MIN_PACKET_SIZE 16 46 #define TFRC_STD_PACKET_SIZE 256 ··· 93 * @ccid3hctx_hist - Packet history 94 */ 95 struct ccid3_hc_tx_sock { 96 + struct tfrc_tx_info ccid3hctx_tfrc; 97 + #define ccid3hctx_x ccid3hctx_tfrc.tfrctx_x 98 + #define ccid3hctx_x_recv ccid3hctx_tfrc.tfrctx_x_recv 99 + #define ccid3hctx_x_calc ccid3hctx_tfrc.tfrctx_x_calc 100 + #define ccid3hctx_rtt ccid3hctx_tfrc.tfrctx_rtt 101 + #define ccid3hctx_p ccid3hctx_tfrc.tfrctx_p 102 + #define ccid3hctx_t_rto ccid3hctx_tfrc.tfrctx_rto 103 + #define ccid3hctx_t_ipi ccid3hctx_tfrc.tfrctx_ipi 104 u16 ccid3hctx_s; 105 u8 ccid3hctx_state; 106 u8 ccid3hctx_last_win_count; 107 u8 ccid3hctx_idle; ··· 106 struct timer_list ccid3hctx_no_feedback_timer; 107 struct timeval ccid3hctx_t_ld; 108 struct timeval ccid3hctx_t_nom; 109 u32 ccid3hctx_delta; 110 struct list_head ccid3hctx_hist; 111 struct ccid3_options_received ccid3hctx_options_received; 112 }; 113 114 struct ccid3_hc_rx_sock { 115 + struct tfrc_rx_info ccid3hcrx_tfrc; 116 + #define ccid3hcrx_x_recv ccid3hcrx_tfrc.tfrcrx_x_recv 117 + #define ccid3hcrx_rtt ccid3hcrx_tfrc.tfrcrx_rtt 118 + #define ccid3hcrx_p ccid3hcrx_tfrc.tfrcrx_p 119 u64 ccid3hcrx_seqno_last_counter:48, 120 ccid3hcrx_state:8, 121 ccid3hcrx_last_counter:4; 122 u32 ccid3hcrx_bytes_recv; 123 struct timeval ccid3hcrx_tstamp_last_feedback; 124 struct timeval ccid3hcrx_tstamp_last_ack; ··· 127 u16 ccid3hcrx_s; 128 u32 ccid3hcrx_pinv; 129 u32 ccid3hcrx_elapsed_time; 130 }; 131 132 static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk)