diff options
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r-- | net/dccp/dccp.h | 29 |
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 | */ | ||
135 | static 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 | |||
144 | static 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 | |||
154 | extern void dccp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); | ||
155 | |||
132 | extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb); | 156 | extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb); |
133 | 157 | ||
134 | extern void dccp_send_ack(struct sock *sk); | 158 | extern void dccp_send_ack(struct sock *sk); |
@@ -214,14 +238,9 @@ extern void dccp_shutdown(struct sock *sk, int how); | |||
214 | extern int inet_dccp_listen(struct socket *sock, int backlog); | 238 | extern int inet_dccp_listen(struct socket *sock, int backlog); |
215 | extern unsigned int dccp_poll(struct file *file, struct socket *sock, | 239 | extern unsigned int dccp_poll(struct file *file, struct socket *sock, |
216 | poll_table *wait); | 240 | poll_table *wait); |
217 | extern void dccp_v4_send_check(struct sock *sk, int len, | ||
218 | struct sk_buff *skb); | ||
219 | extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, | 241 | extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, |
220 | int addr_len); | 242 | int addr_len); |
221 | 243 | ||
222 | extern int dccp_v4_checksum(const struct sk_buff *skb, | ||
223 | const __be32 saddr, const __be32 daddr); | ||
224 | |||
225 | extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code); | 244 | extern int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code); |
226 | extern void dccp_send_close(struct sock *sk, const int active); | 245 | extern void dccp_send_close(struct sock *sk, const int active); |
227 | extern int dccp_invalid_packet(struct sk_buff *skb); | 246 | extern int dccp_invalid_packet(struct sk_buff *skb); |