aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/proto.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/proto.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/proto.c')
-rw-r--r--net/dccp/proto.c32
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
42DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics) __read_mostly; 42DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics) __read_mostly;
43 43
44EXPORT_SYMBOL_GPL(dccp_statistics);
45
44atomic_t dccp_orphan_count = ATOMIC_INIT(0); 46atomic_t dccp_orphan_count = ATOMIC_INIT(0);
45 47
48EXPORT_SYMBOL_GPL(dccp_orphan_count);
49
46static struct net_protocol dccp_protocol = { 50static 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
156EXPORT_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 */
159static unsigned int dccp_poll(struct file *file, struct socket *sock, 165unsigned 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
214EXPORT_SYMBOL_GPL(dccp_poll);
215
208int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) 216int 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
222EXPORT_SYMBOL_GPL(dccp_ioctl);
223
214static int dccp_setsockopt_service(struct sock *sk, const u32 service, 224static 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
297EXPORT_SYMBOL_GPL(dccp_setsockopt);
298
287static int dccp_getsockopt_service(struct sock *sk, int len, 299static 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
372EXPORT_SYMBOL_GPL(dccp_getsockopt);
373
360int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 374int 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
430EXPORT_SYMBOL_GPL(dccp_sendmsg);
431
416int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 432int 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
513static int inet_dccp_listen(struct socket *sock, int backlog) 529EXPORT_SYMBOL_GPL(dccp_recvmsg);
530
531int 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
567EXPORT_SYMBOL_GPL(inet_dccp_listen);
568
549static const unsigned char dccp_new_state[] = { 569static 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
674EXPORT_SYMBOL_GPL(dccp_close);
675
654void dccp_shutdown(struct sock *sk, int how) 676void 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
681EXPORT_SYMBOL_GPL(dccp_shutdown);
682
659static struct proto_ops inet_dccp_ops = { 683static 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");
763int dccp_debug; 787int dccp_debug;
764module_param(dccp_debug, int, 0444); 788module_param(dccp_debug, int, 0444);
765MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); 789MODULE_PARM_DESC(dccp_debug, "Enable debug messages");
790
791EXPORT_SYMBOL_GPL(dccp_debug);
766#endif 792#endif
767 793
768static int __init dccp_init(void) 794static int __init dccp_init(void)