diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-14 02:24:16 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:50 -0500 |
commit | f21e68caa0ddffddf98a1e729e734a470957b6ec (patch) | |
tree | 52b372d10cbacd066867ba1c918f48b9fdaad950 /net/dccp/proto.c | |
parent | 34ca6860810342441f801226b19ae6c9e0ecb34f (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/proto.c')
-rw-r--r-- | net/dccp/proto.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 9cb2989f93b2..51dfacd22a6e 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -41,8 +41,12 @@ | |||
41 | 41 | ||
42 | DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics) __read_mostly; | 42 | DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics) __read_mostly; |
43 | 43 | ||
44 | EXPORT_SYMBOL_GPL(dccp_statistics); | ||
45 | |||
44 | atomic_t dccp_orphan_count = ATOMIC_INIT(0); | 46 | atomic_t dccp_orphan_count = ATOMIC_INIT(0); |
45 | 47 | ||
48 | EXPORT_SYMBOL_GPL(dccp_orphan_count); | ||
49 | |||
46 | static struct net_protocol dccp_protocol = { | 50 | static struct net_protocol dccp_protocol = { |
47 | .handler = dccp_v4_rcv, | 51 | .handler = dccp_v4_rcv, |
48 | .err_handler = dccp_v4_err, | 52 | .err_handler = dccp_v4_err, |
@@ -149,6 +153,8 @@ int dccp_disconnect(struct sock *sk, int flags) | |||
149 | return err; | 153 | return err; |
150 | } | 154 | } |
151 | 155 | ||
156 | EXPORT_SYMBOL_GPL(dccp_disconnect); | ||
157 | |||
152 | /* | 158 | /* |
153 | * Wait for a DCCP event. | 159 | * Wait for a DCCP event. |
154 | * | 160 | * |
@@ -156,8 +162,8 @@ int dccp_disconnect(struct sock *sk, int flags) | |||
156 | * take care of normal races (between the test and the event) and we don't | 162 | * take care of normal races (between the test and the event) and we don't |
157 | * go look at any of the socket buffers directly. | 163 | * go look at any of the socket buffers directly. |
158 | */ | 164 | */ |
159 | static unsigned int dccp_poll(struct file *file, struct socket *sock, | 165 | unsigned int dccp_poll(struct file *file, struct socket *sock, |
160 | poll_table *wait) | 166 | poll_table *wait) |
161 | { | 167 | { |
162 | unsigned int mask; | 168 | unsigned int mask; |
163 | struct sock *sk = sock->sk; | 169 | struct sock *sk = sock->sk; |
@@ -205,12 +211,16 @@ static unsigned int dccp_poll(struct file *file, struct socket *sock, | |||
205 | return mask; | 211 | return mask; |
206 | } | 212 | } |
207 | 213 | ||
214 | EXPORT_SYMBOL_GPL(dccp_poll); | ||
215 | |||
208 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) | 216 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
209 | { | 217 | { |
210 | dccp_pr_debug("entry\n"); | 218 | dccp_pr_debug("entry\n"); |
211 | return -ENOIOCTLCMD; | 219 | return -ENOIOCTLCMD; |
212 | } | 220 | } |
213 | 221 | ||
222 | EXPORT_SYMBOL_GPL(dccp_ioctl); | ||
223 | |||
214 | static int dccp_setsockopt_service(struct sock *sk, const u32 service, | 224 | static int dccp_setsockopt_service(struct sock *sk, const u32 service, |
215 | char __user *optval, int optlen) | 225 | char __user *optval, int optlen) |
216 | { | 226 | { |
@@ -284,6 +294,8 @@ int dccp_setsockopt(struct sock *sk, int level, int optname, | |||
284 | return err; | 294 | return err; |
285 | } | 295 | } |
286 | 296 | ||
297 | EXPORT_SYMBOL_GPL(dccp_setsockopt); | ||
298 | |||
287 | static int dccp_getsockopt_service(struct sock *sk, int len, | 299 | static int dccp_getsockopt_service(struct sock *sk, int len, |
288 | u32 __user *optval, | 300 | u32 __user *optval, |
289 | int __user *optlen) | 301 | int __user *optlen) |
@@ -357,6 +369,8 @@ int dccp_getsockopt(struct sock *sk, int level, int optname, | |||
357 | return 0; | 369 | return 0; |
358 | } | 370 | } |
359 | 371 | ||
372 | EXPORT_SYMBOL_GPL(dccp_getsockopt); | ||
373 | |||
360 | int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 374 | int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
361 | size_t len) | 375 | size_t len) |
362 | { | 376 | { |
@@ -413,6 +427,8 @@ out_discard: | |||
413 | goto out_release; | 427 | goto out_release; |
414 | } | 428 | } |
415 | 429 | ||
430 | EXPORT_SYMBOL_GPL(dccp_sendmsg); | ||
431 | |||
416 | int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 432 | int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
417 | size_t len, int nonblock, int flags, int *addr_len) | 433 | size_t len, int nonblock, int flags, int *addr_len) |
418 | { | 434 | { |
@@ -510,7 +526,9 @@ out: | |||
510 | return len; | 526 | return len; |
511 | } | 527 | } |
512 | 528 | ||
513 | static int inet_dccp_listen(struct socket *sock, int backlog) | 529 | EXPORT_SYMBOL_GPL(dccp_recvmsg); |
530 | |||
531 | int inet_dccp_listen(struct socket *sock, int backlog) | ||
514 | { | 532 | { |
515 | struct sock *sk = sock->sk; | 533 | struct sock *sk = sock->sk; |
516 | unsigned char old_state; | 534 | unsigned char old_state; |
@@ -546,6 +564,8 @@ out: | |||
546 | return err; | 564 | return err; |
547 | } | 565 | } |
548 | 566 | ||
567 | EXPORT_SYMBOL_GPL(inet_dccp_listen); | ||
568 | |||
549 | static const unsigned char dccp_new_state[] = { | 569 | static const unsigned char dccp_new_state[] = { |
550 | /* current state: new state: action: */ | 570 | /* current state: new state: action: */ |
551 | [0] = DCCP_CLOSED, | 571 | [0] = DCCP_CLOSED, |
@@ -651,11 +671,15 @@ adjudge_to_death: | |||
651 | sock_put(sk); | 671 | sock_put(sk); |
652 | } | 672 | } |
653 | 673 | ||
674 | EXPORT_SYMBOL_GPL(dccp_close); | ||
675 | |||
654 | void dccp_shutdown(struct sock *sk, int how) | 676 | void dccp_shutdown(struct sock *sk, int how) |
655 | { | 677 | { |
656 | dccp_pr_debug("entry\n"); | 678 | dccp_pr_debug("entry\n"); |
657 | } | 679 | } |
658 | 680 | ||
681 | EXPORT_SYMBOL_GPL(dccp_shutdown); | ||
682 | |||
659 | static struct proto_ops inet_dccp_ops = { | 683 | static struct proto_ops inet_dccp_ops = { |
660 | .family = PF_INET, | 684 | .family = PF_INET, |
661 | .owner = THIS_MODULE, | 685 | .owner = THIS_MODULE, |
@@ -763,6 +787,8 @@ MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); | |||
763 | int dccp_debug; | 787 | int dccp_debug; |
764 | module_param(dccp_debug, int, 0444); | 788 | module_param(dccp_debug, int, 0444); |
765 | MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); | 789 | MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); |
790 | |||
791 | EXPORT_SYMBOL_GPL(dccp_debug); | ||
766 | #endif | 792 | #endif |
767 | 793 | ||
768 | static int __init dccp_init(void) | 794 | static int __init dccp_init(void) |