···49 return b > 20 ? tmp / (b / 10) : tmp;50}5152-#ifdef CCID3_DEBUG53-extern int ccid3_debug;54055#define ccid3_pr_debug(format, a...) \56 do { if (ccid3_debug) \57 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \···59#else60#define ccid3_pr_debug(format, a...)61#endif62-63-#define TFRC_MIN_PACKET_SIZE 1664-#define TFRC_STD_PACKET_SIZE 25665-#define TFRC_MAX_PACKET_SIZE 6553566-67-#define TFRC_INITIAL_TIMEOUT (2 * USEC_PER_SEC)68-/* two seconds as per CCID3 spec 11 */69-70-#define TFRC_OPSYS_HALF_TIME_GRAN (USEC_PER_SEC / (2 * HZ))71-/* above is in usecs - half the scheduling granularity as per RFC3448 4.6 */72-73-#define TFRC_WIN_COUNT_PER_RTT 474-#define TFRC_WIN_COUNT_LIMIT 1675-76-#define TFRC_MAX_BACK_OFF_TIME 6477-/* above is in seconds */78-79-#define TFRC_SMALLEST_P 4080-81-#define TFRC_RECV_IVAL_F_LENGTH 8 /* length(w[]) */82-83-/* Number of later packets received before one is considered lost */84-#define TFRC_RECV_NUM_LATE_LOSS 385-86-enum ccid3_options {87- TFRC_OPT_LOSS_EVENT_RATE = 192,88- TFRC_OPT_LOSS_INTERVALS = 193,89- TFRC_OPT_RECEIVE_RATE = 194,90-};91-92-static int ccid3_debug;9394static struct dccp_tx_hist *ccid3_tx_hist;95static struct dccp_rx_hist *ccid3_rx_hist;
···49 return b > 20 ? tmp / (b / 10) : tmp;50}5152+static int ccid3_debug;05354+#ifdef CCID3_DEBUG55#define ccid3_pr_debug(format, a...) \56 do { if (ccid3_debug) \57 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \···59#else60#define ccid3_pr_debug(format, a...)61#endif00000000000000000000000000000006263static struct dccp_tx_hist *ccid3_tx_hist;64static struct dccp_rx_hist *ccid3_rx_hist;
+37-5
net/dccp/ccids/ccid3.h
···36#ifndef _DCCP_CCID3_H_37#define _DCCP_CCID3_H_3839-#include <linux/types.h>40#include <linux/list.h>00000000000000000000000000000004142struct ccid3_options_received {43 u64 ccid3or_seqno:48,···78 u32 ccid3or_receive_rate;79};8081-/** struct ccid3_hc_tx_sock - CCID3 sender half connection congestion control block82 *83 * @ccid3hctx_state - Sender state84 * @ccid3hctx_x - Current sending rate···88 * @ccid3hctx_rtt - Estimate of current round trip time in usecs89 * @@ccid3hctx_p - Current loss event rate (0-1) scaled by 100000090 * @ccid3hctx_last_win_count - Last window counter sent91- * @ccid3hctx_t_last_win_count - Timestamp of earliest packet with last_win_count value sent092 * @ccid3hctx_no_feedback_timer - Handle to no feedback timer93 * @ccid3hctx_idle - FIXME94 * @ccid3hctx_t_ld - Time last doubled during slow start···144};145146#define ccid3_hc_tx_field(s,field) (s->dccps_hc_tx_ccid_private == NULL ? 0 : \147- ((struct ccid3_hc_tx_sock *)s->dccps_hc_tx_ccid_private)->ccid3hctx_##field)148149#define ccid3_hc_rx_field(s,field) (s->dccps_hc_rx_ccid_private == NULL ? 0 : \150- ((struct ccid3_hc_rx_sock *)s->dccps_hc_rx_ccid_private)->ccid3hcrx_##field)151152#endif /* _DCCP_CCID3_H_ */
···36#ifndef _DCCP_CCID3_H_37#define _DCCP_CCID3_H_3839+#include <linux/config.h>40#include <linux/list.h>41+#include <linux/time.h>42+#include <linux/types.h>43+44+#define TFRC_MIN_PACKET_SIZE 1645+#define TFRC_STD_PACKET_SIZE 25646+#define TFRC_MAX_PACKET_SIZE 6553547+48+/* Two seconds as per CCID3 spec */49+#define TFRC_INITIAL_TIMEOUT (2 * USEC_PER_SEC)50+51+/* In usecs - half the scheduling granularity as per RFC3448 4.6 */52+#define TFRC_OPSYS_HALF_TIME_GRAN (USEC_PER_SEC / (2 * HZ))53+54+#define TFRC_WIN_COUNT_PER_RTT 455+#define TFRC_WIN_COUNT_LIMIT 1656+57+/* In seconds */58+#define TFRC_MAX_BACK_OFF_TIME 6459+60+#define TFRC_SMALLEST_P 4061+62+#define TFRC_RECV_IVAL_F_LENGTH 863+64+/* Number of later packets received before one is considered lost */65+#define TFRC_RECV_NUM_LATE_LOSS 366+67+enum ccid3_options {68+ TFRC_OPT_LOSS_EVENT_RATE = 192,69+ TFRC_OPT_LOSS_INTERVALS = 193,70+ TFRC_OPT_RECEIVE_RATE = 194,71+};7273struct ccid3_options_received {74 u64 ccid3or_seqno:48,···47 u32 ccid3or_receive_rate;48};4950+/** struct ccid3_hc_tx_sock - CCID3 sender half connection sock51 *52 * @ccid3hctx_state - Sender state53 * @ccid3hctx_x - Current sending rate···57 * @ccid3hctx_rtt - Estimate of current round trip time in usecs58 * @@ccid3hctx_p - Current loss event rate (0-1) scaled by 100000059 * @ccid3hctx_last_win_count - Last window counter sent60+ * @ccid3hctx_t_last_win_count - Timestamp of earliest packet61+ * with last_win_count value sent62 * @ccid3hctx_no_feedback_timer - Handle to no feedback timer63 * @ccid3hctx_idle - FIXME64 * @ccid3hctx_t_ld - Time last doubled during slow start···112};113114#define ccid3_hc_tx_field(s,field) (s->dccps_hc_tx_ccid_private == NULL ? 0 : \115+ ((struct ccid3_hc_tx_sock *)s->dccps_hc_tx_ccid_private)->ccid3hctx_##field)116117#define ccid3_hc_rx_field(s,field) (s->dccps_hc_rx_ccid_private == NULL ? 0 : \118+ ((struct ccid3_hc_rx_sock *)s->dccps_hc_rx_ccid_private)->ccid3hcrx_##field)119120#endif /* _DCCP_CCID3_H_ */