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.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 2990bfb12587..d5c414bf7819 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -129,6 +129,30 @@ DECLARE_SNMP_STAT(struct dccp_mib, dccp_statistics);
129#define DCCP_ADD_STATS_USER(field, val) \ 129#define DCCP_ADD_STATS_USER(field, val) \
130 SNMP_ADD_STATS_USER(dccp_statistics, field, val) 130 SNMP_ADD_STATS_USER(dccp_statistics, field, val)
131 131
132/*
133 * Checksumming routines
134 */
135static inline int dccp_csum_coverage(const struct sk_buff *skb)
136{
137 const struct dccp_hdr* dh = dccp_hdr(skb);
138
139 if (dh->dccph_cscov == 0)
140 return skb->len;
141 return (dh->dccph_doff + dh->dccph_cscov - 1) * sizeof(u32);
142}
143
144static inline void dccp_csum_outgoing(struct sk_buff *skb)
145{
146 int cov = dccp_csum_coverage(skb);
147
148 if (cov >= skb->len)
149 dccp_hdr(skb)->dccph_cscov = 0;
150
151 skb->csum = skb_checksum(skb, 0, (cov > skb->len)? skb->len : cov, 0);
152}
153
154extern void dccp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb);
155
132extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb); 156extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb);
133 157
134extern void dccp_send_ack(struct sock *sk); 158extern void dccp_send_ack(struct sock *sk);
@@ -214,14 +238,9 @@ extern void dccp_shutdown(struct sock *sk, int how);
214extern int inet_dccp_listen(struct socket *sock, int backlog); 238extern int inet_dccp_listen(struct socket *sock, int backlog);
215extern unsigned int dccp_poll(struct file *file, struct socket *sock, 239extern unsigned int dccp_poll(struct file *file, struct socket *sock,
216 poll_table *wait); 240 poll_table *wait);
217extern void dccp_v4_send_check(struct sock *sk, int len,
218 struct sk_buff *skb);
219extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, 241extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
220 int addr_len); 242 int addr_len);
221 243
222extern int dccp_v4_checksum(const struct sk_buff *skb,
223 const __be32 saddr, const __be32 daddr);
224
225extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code); 244extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code);
226extern void dccp_send_close(struct sock *sk, const int active); 245extern void dccp_send_close(struct sock *sk, const int active);
227extern int dccp_invalid_packet(struct sk_buff *skb); 246extern int dccp_invalid_packet(struct sk_buff *skb);