aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/output.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:24:16 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:50 -0500
commitf21e68caa0ddffddf98a1e729e734a470957b6ec (patch)
tree52b372d10cbacd066867ba1c918f48b9fdaad950 /net/dccp/output.c
parent34ca6860810342441f801226b19ae6c9e0ecb34f (diff)
[DCCP]: Prepare the AF agnostic core for the introduction of DCCPv6
Basically exports a similar set of functions as the one exported by the non-AF specific TCP code. In the process moved some non-AF specific code from dccp_v4_connect to dccp_connect_init and moved the checksum verification from dccp_invalid_packet to dccp_v4_rcv, so as to use it in dccp_v6_rcv too. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r--net/dccp/output.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index f35880503bb8..c40f7f8a328b 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -135,12 +135,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
135unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu) 135unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
136{ 136{
137 struct dccp_sock *dp = dccp_sk(sk); 137 struct dccp_sock *dp = dccp_sk(sk);
138 /*
139 * FIXME: we really should be using the af_specific thing to support
140 * IPv6.
141 * mss_now = pmtu - tp->af_specific->net_header_len -
142 * sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext);
143 */
144 int mss_now = (pmtu - inet_csk(sk)->icsk_af_ops->net_header_len - 138 int mss_now = (pmtu - inet_csk(sk)->icsk_af_ops->net_header_len -
145 sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext)); 139 sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext));
146 140
@@ -164,6 +158,8 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
164 return mss_now; 158 return mss_now;
165} 159}
166 160
161EXPORT_SYMBOL_GPL(dccp_sync_mss);
162
167void dccp_write_space(struct sock *sk) 163void dccp_write_space(struct sock *sk)
168{ 164{
169 read_lock(&sk->sk_callback_lock); 165 read_lock(&sk->sk_callback_lock);
@@ -319,6 +315,8 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
319 return skb; 315 return skb;
320} 316}
321 317
318EXPORT_SYMBOL_GPL(dccp_make_response);
319
322struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst, 320struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst,
323 const enum dccp_reset_codes code) 321 const enum dccp_reset_codes code)
324 322
@@ -375,6 +373,7 @@ struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst,
375 */ 373 */
376static inline void dccp_connect_init(struct sock *sk) 374static inline void dccp_connect_init(struct sock *sk)
377{ 375{
376 struct dccp_sock *dp = dccp_sk(sk);
378 struct dst_entry *dst = __sk_dst_get(sk); 377 struct dst_entry *dst = __sk_dst_get(sk);
379 struct inet_connection_sock *icsk = inet_csk(sk); 378 struct inet_connection_sock *icsk = inet_csk(sk);
380 379
@@ -383,10 +382,16 @@ static inline void dccp_connect_init(struct sock *sk)
383 382
384 dccp_sync_mss(sk, dst_mtu(dst)); 383 dccp_sync_mss(sk, dst_mtu(dst));
385 384
386 /* 385 dccp_update_gss(sk, dp->dccps_iss);
387 * FIXME: set dp->{dccps_swh,dccps_swl}, with 386 /*
388 * something like dccp_inc_seq 387 * SWL and AWL are initially adjusted so that they are not less than
389 */ 388 * the initial Sequence Numbers received and sent, respectively:
389 * SWL := max(GSR + 1 - floor(W/4), ISR),
390 * AWL := max(GSS - W' + 1, ISS).
391 * These adjustments MUST be applied only at the beginning of the
392 * connection.
393 */
394 dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss));
390 395
391 icsk->icsk_retransmits = 0; 396 icsk->icsk_retransmits = 0;
392} 397}
@@ -418,6 +423,8 @@ int dccp_connect(struct sock *sk)
418 return 0; 423 return 0;
419} 424}
420 425
426EXPORT_SYMBOL_GPL(dccp_connect);
427
421void dccp_send_ack(struct sock *sk) 428void dccp_send_ack(struct sock *sk)
422{ 429{
423 /* If we have been reset, we may not send again. */ 430 /* If we have been reset, we may not send again. */