aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r--net/dccp/dccp.h56
1 files changed, 36 insertions, 20 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 8a0d7af649e4..62e735f1807d 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -25,7 +25,8 @@ extern int dccp_debug;
25 do { if (dccp_debug) \ 25 do { if (dccp_debug) \
26 printk(KERN_DEBUG "%s: " format, __FUNCTION__ , ##a); \ 26 printk(KERN_DEBUG "%s: " format, __FUNCTION__ , ##a); \
27 } while (0) 27 } while (0)
28#define dccp_pr_debug_cat(format, a...) do { if (dccp_debug) printk(format, ##a); } while (0) 28#define dccp_pr_debug_cat(format, a...) do { if (dccp_debug) \
29 printk(format, ##a); } while (0)
29#else 30#else
30#define dccp_pr_debug(format, a...) 31#define dccp_pr_debug(format, a...)
31#define dccp_pr_debug_cat(format, a...) 32#define dccp_pr_debug_cat(format, a...)
@@ -72,7 +73,8 @@ static inline const int after48(const u64 seq1, const u64 seq2)
72} 73}
73 74
74/* is seq2 <= seq1 <= seq3 ? */ 75/* is seq2 <= seq1 <= seq3 ? */
75static inline const int between48(const u64 seq1, const u64 seq2, const u64 seq3) 76static inline const int between48(const u64 seq1, const u64 seq2,
77 const u64 seq3)
76{ 78{
77 return (seq3 << 16) - (seq2 << 16) >= (seq1 << 16) - (seq2 << 16); 79 return (seq3 << 16) - (seq2 << 16) >= (seq1 << 16) - (seq2 << 16);
78} 80}
@@ -107,12 +109,14 @@ struct dccp_mib {
107} __SNMP_MIB_ALIGN__; 109} __SNMP_MIB_ALIGN__;
108 110
109DECLARE_SNMP_STAT(struct dccp_mib, dccp_statistics); 111DECLARE_SNMP_STAT(struct dccp_mib, dccp_statistics);
110#define DCCP_INC_STATS(field) SNMP_INC_STATS(dccp_statistics, field) 112#define DCCP_INC_STATS(field) SNMP_INC_STATS(dccp_statistics, field)
111#define DCCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(dccp_statistics, field) 113#define DCCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(dccp_statistics, field)
112#define DCCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(dccp_statistics, field) 114#define DCCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(dccp_statistics, field)
113#define DCCP_DEC_STATS(field) SNMP_DEC_STATS(dccp_statistics, field) 115#define DCCP_DEC_STATS(field) SNMP_DEC_STATS(dccp_statistics, field)
114#define DCCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(dccp_statistics, field, val) 116#define DCCP_ADD_STATS_BH(field, val) \
115#define DCCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(dccp_statistics, field, val) 117 SNMP_ADD_STATS_BH(dccp_statistics, field, val)
118#define DCCP_ADD_STATS_USER(field, val) \
119 SNMP_ADD_STATS_USER(dccp_statistics, field, val)
116 120
117extern int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb); 121extern int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb);
118extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb); 122extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb);
@@ -234,8 +238,8 @@ extern int dccp_disconnect(struct sock *sk, int flags);
234extern int dccp_getsockopt(struct sock *sk, int level, int optname, 238extern int dccp_getsockopt(struct sock *sk, int level, int optname,
235 char *optval, int *optlen); 239 char *optval, int *optlen);
236extern int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg); 240extern int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg);
237extern int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 241extern int dccp_sendmsg(struct kiocb *iocb, struct sock *sk,
238 size_t size); 242 struct msghdr *msg, size_t size);
239extern int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, 243extern int dccp_recvmsg(struct kiocb *iocb, struct sock *sk,
240 struct msghdr *msg, size_t len, int nonblock, 244 struct msghdr *msg, size_t len, int nonblock,
241 int flags, int *addr_len); 245 int flags, int *addr_len);
@@ -246,7 +250,8 @@ extern void dccp_shutdown(struct sock *sk, int how);
246extern int dccp_v4_checksum(const struct sk_buff *skb, 250extern int dccp_v4_checksum(const struct sk_buff *skb,
247 const u32 saddr, const u32 daddr); 251 const u32 saddr, const u32 daddr);
248 252
249extern int dccp_v4_send_reset(struct sock *sk, enum dccp_reset_codes code); 253extern int dccp_v4_send_reset(struct sock *sk,
254 enum dccp_reset_codes code);
250extern void dccp_send_close(struct sock *sk); 255extern void dccp_send_close(struct sock *sk);
251 256
252struct dccp_skb_cb { 257struct dccp_skb_cb {
@@ -303,7 +308,8 @@ static inline void dccp_inc_seqno(u64 *seqno)
303 308
304static inline void dccp_hdr_set_seq(struct dccp_hdr *dh, const u64 gss) 309static inline void dccp_hdr_set_seq(struct dccp_hdr *dh, const u64 gss)
305{ 310{
306 struct dccp_hdr_ext *dhx = (struct dccp_hdr_ext *)((void *)dh + sizeof(*dh)); 311 struct dccp_hdr_ext *dhx = (struct dccp_hdr_ext *)((void *)dh +
312 sizeof(*dh));
307 313
308#if defined(__LITTLE_ENDIAN_BITFIELD) 314#if defined(__LITTLE_ENDIAN_BITFIELD)
309 dh->dccph_seq = htonl((gss >> 32)) >> 8; 315 dh->dccph_seq = htonl((gss >> 32)) >> 8;
@@ -315,7 +321,8 @@ static inline void dccp_hdr_set_seq(struct dccp_hdr *dh, const u64 gss)
315 dhx->dccph_seq_low = htonl(gss & 0xffffffff); 321 dhx->dccph_seq_low = htonl(gss & 0xffffffff);
316} 322}
317 323
318static inline void dccp_hdr_set_ack(struct dccp_hdr_ack_bits *dhack, const u64 gsr) 324static inline void dccp_hdr_set_ack(struct dccp_hdr_ack_bits *dhack,
325 const u64 gsr)
319{ 326{
320#if defined(__LITTLE_ENDIAN_BITFIELD) 327#if defined(__LITTLE_ENDIAN_BITFIELD)
321 dhack->dccph_ack_nr_high = htonl((gsr >> 32)) >> 8; 328 dhack->dccph_ack_nr_high = htonl((gsr >> 32)) >> 8;
@@ -332,11 +339,14 @@ static inline void dccp_update_gsr(struct sock *sk, u64 seq)
332 struct dccp_sock *dp = dccp_sk(sk); 339 struct dccp_sock *dp = dccp_sk(sk);
333 u64 tmp_gsr; 340 u64 tmp_gsr;
334 341
335 dccp_set_seqno(&tmp_gsr, dp->dccps_gsr + 1 - (dp->dccps_options.dccpo_sequence_window / 4)); 342 dccp_set_seqno(&tmp_gsr,
343 (dp->dccps_gsr + 1 -
344 (dp->dccps_options.dccpo_sequence_window / 4)));
336 dp->dccps_gsr = seq; 345 dp->dccps_gsr = seq;
337 dccp_set_seqno(&dp->dccps_swl, max48(tmp_gsr, dp->dccps_isr)); 346 dccp_set_seqno(&dp->dccps_swl, max48(tmp_gsr, dp->dccps_isr));
338 dccp_set_seqno(&dp->dccps_swh, 347 dccp_set_seqno(&dp->dccps_swh,
339 dp->dccps_gsr + (3 * dp->dccps_options.dccpo_sequence_window) / 4); 348 (dp->dccps_gsr +
349 (3 * dp->dccps_options.dccpo_sequence_window) / 4));
340} 350}
341 351
342static inline void dccp_update_gss(struct sock *sk, u64 seq) 352static inline void dccp_update_gss(struct sock *sk, u64 seq)
@@ -344,7 +354,9 @@ static inline void dccp_update_gss(struct sock *sk, u64 seq)
344 struct dccp_sock *dp = dccp_sk(sk); 354 struct dccp_sock *dp = dccp_sk(sk);
345 u64 tmp_gss; 355 u64 tmp_gss;
346 356
347 dccp_set_seqno(&tmp_gss, dp->dccps_gss - dp->dccps_options.dccpo_sequence_window + 1); 357 dccp_set_seqno(&tmp_gss,
358 (dp->dccps_gss -
359 dp->dccps_options.dccpo_sequence_window + 1));
348 dp->dccps_awl = max48(tmp_gss, dp->dccps_iss); 360 dp->dccps_awl = max48(tmp_gss, dp->dccps_iss);
349 dp->dccps_awh = dp->dccps_gss = seq; 361 dp->dccps_awh = dp->dccps_gss = seq;
350} 362}
@@ -373,16 +385,20 @@ extern struct socket *dccp_ctl_socket;
373 * 385 *
374 * @dccpap_buf_head - circular buffer head 386 * @dccpap_buf_head - circular buffer head
375 * @dccpap_buf_tail - circular buffer tail 387 * @dccpap_buf_tail - circular buffer tail
376 * @dccpap_buf_ackno - ack # of the most recent packet acknoldgeable in the buffer (i.e. %dccpap_buf_head) 388 * @dccpap_buf_ackno - ack # of the most recent packet acknowledgeable in the
377 * @dccpap_buf_nonce - the one-bit sum of the ECN Nonces on all packets acked by the buffer with State 0 389 * buffer (i.e. %dccpap_buf_head)
390 * @dccpap_buf_nonce - the one-bit sum of the ECN Nonces on all packets acked
391 * by the buffer with State 0
378 * 392 *
379 * Additionally, the HC-Receiver must keep some information about the 393 * Additionally, the HC-Receiver must keep some information about the
380 * Ack Vectors it has recently sent. For each packet sent carrying an 394 * Ack Vectors it has recently sent. For each packet sent carrying an
381 * Ack Vector, it remembers four variables: 395 * Ack Vector, it remembers four variables:
382 * 396 *
383 * @dccpap_ack_seqno - the Sequence Number used for the packet (HC-Receiver seqno) 397 * @dccpap_ack_seqno - the Sequence Number used for the packet
398 * (HC-Receiver seqno)
384 * @dccpap_ack_ptr - the value of buf_head at the time of acknowledgement. 399 * @dccpap_ack_ptr - the value of buf_head at the time of acknowledgement.
385 * @dccpap_ack_ackno - the Acknowledgement Number used for the packet (HC-Sender seqno) 400 * @dccpap_ack_ackno - the Acknowledgement Number used for the packet
401 * (HC-Sender seqno)
386 * @dccpap_ack_nonce - the one-bit sum of the ECN Nonces for all State 0. 402 * @dccpap_ack_nonce - the one-bit sum of the ECN Nonces for all State 0.
387 * 403 *
388 * @dccpap_buf_len - circular buffer length 404 * @dccpap_buf_len - circular buffer length