Merge with /home/shaggy/git/linus-clean/
[linux-2.6] / net / atm / svc.c
1 /* net/atm/svc.c - ATM SVC sockets */
2
3 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6 #include <linux/string.h>
7 #include <linux/net.h>          /* struct socket, struct proto_ops */
8 #include <linux/errno.h>        /* error codes */
9 #include <linux/kernel.h>       /* printk */
10 #include <linux/skbuff.h>
11 #include <linux/wait.h>
12 #include <linux/sched.h>        /* jiffies and HZ */
13 #include <linux/fcntl.h>        /* O_NONBLOCK */
14 #include <linux/init.h>
15 #include <linux/atm.h>          /* ATM stuff */
16 #include <linux/atmsap.h>
17 #include <linux/atmsvc.h>
18 #include <linux/atmdev.h>
19 #include <linux/bitops.h>
20 #include <net/sock.h>           /* for sock_no_* */
21 #include <asm/uaccess.h>
22
23 #include "resources.h"
24 #include "common.h"             /* common for PVCs and SVCs */
25 #include "signaling.h"
26 #include "addr.h"
27
28
29 #if 0
30 #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
31 #else
32 #define DPRINTK(format,args...)
33 #endif
34
35
36 static int svc_create(struct socket *sock,int protocol);
37
38
39 /*
40  * Note: since all this is still nicely synchronized with the signaling demon,
41  *       there's no need to protect sleep loops with clis. If signaling is
42  *       moved into the kernel, that would change.
43  */
44
45
46 static int svc_shutdown(struct socket *sock,int how)
47 {
48         return 0;
49 }
50
51
52 static void svc_disconnect(struct atm_vcc *vcc)
53 {
54         DEFINE_WAIT(wait);
55         struct sk_buff *skb;
56         struct sock *sk = sk_atm(vcc);
57
58         DPRINTK("svc_disconnect %p\n",vcc);
59         if (test_bit(ATM_VF_REGIS,&vcc->flags)) {
60                 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
61                 sigd_enq(vcc,as_close,NULL,NULL,NULL);
62                 while (!test_bit(ATM_VF_RELEASED,&vcc->flags) && sigd) {
63                         schedule();
64                         prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
65                 }
66                 finish_wait(sk->sk_sleep, &wait);
67         }
68         /* beware - socket is still in use by atmsigd until the last
69            as_indicate has been answered */
70         while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
71                 atm_return(vcc, skb->truesize);
72                 DPRINTK("LISTEN REL\n");
73                 sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0);
74                 dev_kfree_skb(skb);
75         }
76         clear_bit(ATM_VF_REGIS, &vcc->flags);
77         /* ... may retry later */
78 }
79
80
81 static int svc_release(struct socket *sock)
82 {
83         struct sock *sk = sock->sk;
84         struct atm_vcc *vcc;
85
86         if (sk)  {
87                 vcc = ATM_SD(sock);
88                 DPRINTK("svc_release %p\n", vcc);
89                 clear_bit(ATM_VF_READY, &vcc->flags);
90                 /* VCC pointer is used as a reference, so we must not free it
91                    (thereby subjecting it to re-use) before all pending connections
92                    are closed */
93                 svc_disconnect(vcc);
94                 vcc_release(sock);
95         }
96         return 0;
97 }
98
99
100 static int svc_bind(struct socket *sock,struct sockaddr *sockaddr,
101     int sockaddr_len)
102 {
103         DEFINE_WAIT(wait);
104         struct sock *sk = sock->sk;
105         struct sockaddr_atmsvc *addr;
106         struct atm_vcc *vcc;
107         int error;
108
109         if (sockaddr_len != sizeof(struct sockaddr_atmsvc))
110                 return -EINVAL;
111         lock_sock(sk);
112         if (sock->state == SS_CONNECTED) {
113                 error = -EISCONN;
114                 goto out;
115         }
116         if (sock->state != SS_UNCONNECTED) {
117                 error = -EINVAL;
118                 goto out;
119         }
120         vcc = ATM_SD(sock);
121         addr = (struct sockaddr_atmsvc *) sockaddr;
122         if (addr->sas_family != AF_ATMSVC) {
123                 error = -EAFNOSUPPORT;
124                 goto out;
125         }
126         clear_bit(ATM_VF_BOUND,&vcc->flags);
127             /* failing rebind will kill old binding */
128         /* @@@ check memory (de)allocation on rebind */
129         if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) {
130                 error = -EBADFD;
131                 goto out;
132         }
133         vcc->local = *addr;
134         set_bit(ATM_VF_WAITING, &vcc->flags);
135         prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
136         sigd_enq(vcc,as_bind,NULL,NULL,&vcc->local);
137         while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
138                 schedule();
139                 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
140         }
141         finish_wait(sk->sk_sleep, &wait);
142         clear_bit(ATM_VF_REGIS,&vcc->flags); /* doesn't count */
143         if (!sigd) {
144                 error = -EUNATCH;
145                 goto out;
146         }
147         if (!sk->sk_err)
148                 set_bit(ATM_VF_BOUND,&vcc->flags);
149         error = -sk->sk_err;
150 out:
151         release_sock(sk);
152         return error;
153 }
154
155
156 static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
157     int sockaddr_len,int flags)
158 {
159         DEFINE_WAIT(wait);
160         struct sock *sk = sock->sk;
161         struct sockaddr_atmsvc *addr;
162         struct atm_vcc *vcc = ATM_SD(sock);
163         int error;
164
165         DPRINTK("svc_connect %p\n",vcc);
166         lock_sock(sk);
167         if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) {
168                 error = -EINVAL;
169                 goto out;
170         }
171
172         switch (sock->state) {
173         default:
174                 error = -EINVAL;
175                 goto out;
176         case SS_CONNECTED:
177                 error = -EISCONN;
178                 goto out;
179         case SS_CONNECTING:
180                 if (test_bit(ATM_VF_WAITING, &vcc->flags)) {
181                         error = -EALREADY;
182                         goto out;
183                 }
184                 sock->state = SS_UNCONNECTED;
185                 if (sk->sk_err) {
186                         error = -sk->sk_err;
187                         goto out;
188                 }
189                 break;
190         case SS_UNCONNECTED:
191                 addr = (struct sockaddr_atmsvc *) sockaddr;
192                 if (addr->sas_family != AF_ATMSVC) {
193                         error = -EAFNOSUPPORT;
194                         goto out;
195                 }
196                 if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) {
197                         error = -EBADFD;
198                         goto out;
199                 }
200                 if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS ||
201                     vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) {
202                         error = -EINVAL;
203                         goto out;
204                 }
205                 if (!vcc->qos.txtp.traffic_class &&
206                     !vcc->qos.rxtp.traffic_class) {
207                         error = -EINVAL;
208                         goto out;
209                 }
210                 vcc->remote = *addr;
211                 set_bit(ATM_VF_WAITING, &vcc->flags);
212                 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
213                 sigd_enq(vcc,as_connect,NULL,NULL,&vcc->remote);
214                 if (flags & O_NONBLOCK) {
215                         finish_wait(sk->sk_sleep, &wait);
216                         sock->state = SS_CONNECTING;
217                         error = -EINPROGRESS;
218                         goto out;
219                 }
220                 error = 0;
221                 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
222                         schedule();
223                         if (!signal_pending(current)) {
224                                 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
225                                 continue;
226                         }
227                         DPRINTK("*ABORT*\n");
228                         /*
229                          * This is tricky:
230                          *   Kernel ---close--> Demon
231                          *   Kernel <--close--- Demon
232                          * or
233                          *   Kernel ---close--> Demon
234                          *   Kernel <--error--- Demon
235                          * or
236                          *   Kernel ---close--> Demon
237                          *   Kernel <--okay---- Demon
238                          *   Kernel <--close--- Demon
239                          */
240                         sigd_enq(vcc,as_close,NULL,NULL,NULL);
241                         while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
242                                 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
243                                 schedule();
244                         }
245                         if (!sk->sk_err)
246                                 while (!test_bit(ATM_VF_RELEASED,&vcc->flags)
247                                     && sigd) {
248                                         prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
249                                         schedule();
250                                 }
251                         clear_bit(ATM_VF_REGIS,&vcc->flags);
252                         clear_bit(ATM_VF_RELEASED,&vcc->flags);
253                         clear_bit(ATM_VF_CLOSE,&vcc->flags);
254                             /* we're gone now but may connect later */
255                         error = -EINTR;
256                         break;
257                 }
258                 finish_wait(sk->sk_sleep, &wait);
259                 if (error)
260                         goto out;
261                 if (!sigd) {
262                         error = -EUNATCH;
263                         goto out;
264                 }
265                 if (sk->sk_err) {
266                         error = -sk->sk_err;
267                         goto out;
268                 }
269         }
270 /*
271  * Not supported yet
272  *
273  * #ifndef CONFIG_SINGLE_SIGITF
274  */
275         vcc->qos.txtp.max_pcr = SELECT_TOP_PCR(vcc->qos.txtp);
276         vcc->qos.txtp.pcr = 0;
277         vcc->qos.txtp.min_pcr = 0;
278 /*
279  * #endif
280  */
281         if (!(error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci)))
282                 sock->state = SS_CONNECTED;
283         else
284                 (void) svc_disconnect(vcc);
285 out:
286         release_sock(sk);
287         return error;
288 }
289
290
291 static int svc_listen(struct socket *sock,int backlog)
292 {
293         DEFINE_WAIT(wait);
294         struct sock *sk = sock->sk;
295         struct atm_vcc *vcc = ATM_SD(sock);
296         int error;
297
298         DPRINTK("svc_listen %p\n",vcc);
299         lock_sock(sk);
300         /* let server handle listen on unbound sockets */
301         if (test_bit(ATM_VF_SESSION,&vcc->flags)) {
302                 error = -EINVAL;
303                 goto out;
304         }
305         set_bit(ATM_VF_WAITING, &vcc->flags);
306         prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
307         sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local);
308         while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
309                 schedule();
310                 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
311         }
312         finish_wait(sk->sk_sleep, &wait);
313         if (!sigd) {
314                 error = -EUNATCH;
315                 goto out;
316         }
317         set_bit(ATM_VF_LISTEN,&vcc->flags);
318         sk->sk_max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
319         error = -sk->sk_err;
320 out:
321         release_sock(sk);
322         return error;
323 }
324
325
326 static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
327 {
328         struct sock *sk = sock->sk;
329         struct sk_buff *skb;
330         struct atmsvc_msg *msg;
331         struct atm_vcc *old_vcc = ATM_SD(sock);
332         struct atm_vcc *new_vcc;
333         int error;
334
335         lock_sock(sk);
336
337         error = svc_create(newsock,0);
338         if (error)
339                 goto out;
340
341         new_vcc = ATM_SD(newsock);
342
343         DPRINTK("svc_accept %p -> %p\n",old_vcc,new_vcc);
344         while (1) {
345                 DEFINE_WAIT(wait);
346
347                 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
348                 while (!(skb = skb_dequeue(&sk->sk_receive_queue)) &&
349                        sigd) {
350                         if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break;
351                         if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) {
352                                 error = -sk->sk_err;
353                                 break;
354                         }
355                         if (flags & O_NONBLOCK) {
356                                 error = -EAGAIN;
357                                 break;
358                         }
359                         release_sock(sk);
360                         schedule();
361                         lock_sock(sk);
362                         if (signal_pending(current)) {
363                                 error = -ERESTARTSYS;
364                                 break;
365                         }
366                         prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
367                 }
368                 finish_wait(sk->sk_sleep, &wait);
369                 if (error)
370                         goto out;
371                 if (!skb) {
372                         error = -EUNATCH;
373                         goto out;
374                 }
375                 msg = (struct atmsvc_msg *) skb->data;
376                 new_vcc->qos = msg->qos;
377                 set_bit(ATM_VF_HASQOS,&new_vcc->flags);
378                 new_vcc->remote = msg->svc;
379                 new_vcc->local = msg->local;
380                 new_vcc->sap = msg->sap;
381                 error = vcc_connect(newsock, msg->pvc.sap_addr.itf,
382                                     msg->pvc.sap_addr.vpi, msg->pvc.sap_addr.vci);
383                 dev_kfree_skb(skb);
384                 sk->sk_ack_backlog--;
385                 if (error) {
386                         sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL,
387                             &old_vcc->qos,error);
388                         error = error == -EAGAIN ? -EBUSY : error;
389                         goto out;
390                 }
391                 /* wait should be short, so we ignore the non-blocking flag */
392                 set_bit(ATM_VF_WAITING, &new_vcc->flags);
393                 prepare_to_wait(sk_atm(new_vcc)->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
394                 sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL);
395                 while (test_bit(ATM_VF_WAITING, &new_vcc->flags) && sigd) {
396                         release_sock(sk);
397                         schedule();
398                         lock_sock(sk);
399                         prepare_to_wait(sk_atm(new_vcc)->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
400                 }
401                 finish_wait(sk_atm(new_vcc)->sk_sleep, &wait);
402                 if (!sigd) {
403                         error = -EUNATCH;
404                         goto out;
405                 }
406                 if (!sk_atm(new_vcc)->sk_err)
407                         break;
408                 if (sk_atm(new_vcc)->sk_err != ERESTARTSYS) {
409                         error = -sk_atm(new_vcc)->sk_err;
410                         goto out;
411                 }
412         }
413         newsock->state = SS_CONNECTED;
414 out:
415         release_sock(sk);
416         return error;
417 }
418
419
420 static int svc_getname(struct socket *sock,struct sockaddr *sockaddr,
421     int *sockaddr_len,int peer)
422 {
423         struct sockaddr_atmsvc *addr;
424
425         *sockaddr_len = sizeof(struct sockaddr_atmsvc);
426         addr = (struct sockaddr_atmsvc *) sockaddr;
427         memcpy(addr,peer ? &ATM_SD(sock)->remote : &ATM_SD(sock)->local,
428             sizeof(struct sockaddr_atmsvc));
429         return 0;
430 }
431
432
433 int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos)
434 {
435         struct sock *sk = sk_atm(vcc);
436         DEFINE_WAIT(wait);
437
438         set_bit(ATM_VF_WAITING, &vcc->flags);
439         prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
440         sigd_enq2(vcc,as_modify,NULL,NULL,&vcc->local,qos,0);
441         while (test_bit(ATM_VF_WAITING, &vcc->flags) &&
442                !test_bit(ATM_VF_RELEASED, &vcc->flags) && sigd) {
443                 schedule();
444                 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
445         }
446         finish_wait(sk->sk_sleep, &wait);
447         if (!sigd) return -EUNATCH;
448         return -sk->sk_err;
449 }
450
451
452 static int svc_setsockopt(struct socket *sock, int level, int optname,
453                           char __user *optval, int optlen)
454 {
455         struct sock *sk = sock->sk;
456         struct atm_vcc *vcc = ATM_SD(sock);
457         int value, error = 0;
458
459         lock_sock(sk);
460         switch (optname) {
461                 case SO_ATMSAP:
462                         if (level != SOL_ATM || optlen != sizeof(struct atm_sap)) {
463                                 error = -EINVAL;
464                                 goto out;
465                         }
466                         if (copy_from_user(&vcc->sap, optval, optlen)) {
467                                 error = -EFAULT;
468                                 goto out;
469                         }
470                         set_bit(ATM_VF_HASSAP, &vcc->flags);
471                         break;
472                 case SO_MULTIPOINT:
473                         if (level != SOL_ATM || optlen != sizeof(int)) {
474                                 error = -EINVAL;
475                                 goto out;
476                         }
477                         if (get_user(value, (int __user *) optval)) {
478                                 error = -EFAULT;
479                                 goto out;
480                         }
481                         if (value == 1) {
482                                 set_bit(ATM_VF_SESSION, &vcc->flags);
483                         } else if (value == 0) {
484                                 clear_bit(ATM_VF_SESSION, &vcc->flags);
485                         } else {
486                                 error = -EINVAL;
487                         }
488                         break;
489                 default:
490                         error = vcc_setsockopt(sock, level, optname,
491                                                optval, optlen);
492         }
493
494 out:
495         release_sock(sk);
496         return error;
497 }
498
499
500 static int svc_getsockopt(struct socket *sock,int level,int optname,
501     char __user *optval,int __user *optlen)
502 {
503         struct sock *sk = sock->sk;
504         int error = 0, len;
505
506         lock_sock(sk);
507         if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) {
508                 error = vcc_getsockopt(sock, level, optname, optval, optlen);
509                 goto out;
510         }
511         if (get_user(len, optlen)) {
512                 error = -EFAULT;
513                 goto out;
514         }
515         if (len != sizeof(struct atm_sap)) {
516                 error = -EINVAL;
517                 goto out;
518         }
519         if (copy_to_user(optval, &ATM_SD(sock)->sap, sizeof(struct atm_sap))) {
520                 error = -EFAULT;
521                 goto out;
522         }
523 out:
524         release_sock(sk);
525         return error;
526 }
527
528
529 static int svc_addparty(struct socket *sock, struct sockaddr *sockaddr,
530                         int sockaddr_len, int flags)
531 {
532         DEFINE_WAIT(wait);
533         struct sock *sk = sock->sk;
534         struct atm_vcc *vcc = ATM_SD(sock);
535         int error;
536
537         lock_sock(sk);
538         set_bit(ATM_VF_WAITING, &vcc->flags);
539         prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
540         sigd_enq(vcc, as_addparty, NULL, NULL,
541                  (struct sockaddr_atmsvc *) sockaddr);
542         if (flags & O_NONBLOCK) {
543                 finish_wait(sk->sk_sleep, &wait);
544                 error = -EINPROGRESS;
545                 goto out;
546         }
547         DPRINTK("svc_addparty added wait queue\n");
548         while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
549                 schedule();
550                 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
551         }
552         finish_wait(sk->sk_sleep, &wait);
553         error = xchg(&sk->sk_err_soft, 0);
554 out:
555         release_sock(sk);
556         return error;
557 }
558
559
560 static int svc_dropparty(struct socket *sock, int ep_ref)
561 {
562         DEFINE_WAIT(wait);
563         struct sock *sk = sock->sk;
564         struct atm_vcc *vcc = ATM_SD(sock);
565         int error;
566
567         lock_sock(sk);
568         set_bit(ATM_VF_WAITING, &vcc->flags);
569         prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
570         sigd_enq2(vcc, as_dropparty, NULL, NULL, NULL, NULL, ep_ref);
571         while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
572                 schedule();
573                 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
574         }
575         finish_wait(sk->sk_sleep, &wait);
576         if (!sigd) {
577                 error = -EUNATCH;
578                 goto out;
579         }
580         error = xchg(&sk->sk_err_soft, 0);
581 out:
582         release_sock(sk);
583         return error;
584 }
585
586
587 static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
588 {
589         int error, ep_ref;
590         struct sockaddr_atmsvc sa;
591         struct atm_vcc *vcc = ATM_SD(sock);
592   
593         switch (cmd) {
594                 case ATM_ADDPARTY:
595                         if (!test_bit(ATM_VF_SESSION, &vcc->flags))
596                                 return -EINVAL;
597                         if (copy_from_user(&sa, (void __user *) arg, sizeof(sa)))
598                                 return -EFAULT;
599                         error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0);
600                         break;
601                 case ATM_DROPPARTY:
602                         if (!test_bit(ATM_VF_SESSION, &vcc->flags))
603                                 return -EINVAL;
604                         if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int)))
605                                 return -EFAULT;
606                         error = svc_dropparty(sock, ep_ref);
607                         break;
608                 default:
609                         error = vcc_ioctl(sock, cmd, arg);
610         }
611
612         return error;
613 }
614
615 static struct proto_ops svc_proto_ops = {
616         .family =       PF_ATMSVC,
617         .owner =        THIS_MODULE,
618
619         .release =      svc_release,
620         .bind =         svc_bind,
621         .connect =      svc_connect,
622         .socketpair =   sock_no_socketpair,
623         .accept =       svc_accept,
624         .getname =      svc_getname,
625         .poll =         vcc_poll,
626         .ioctl =        svc_ioctl,
627         .listen =       svc_listen,
628         .shutdown =     svc_shutdown,
629         .setsockopt =   svc_setsockopt,
630         .getsockopt =   svc_getsockopt,
631         .sendmsg =      vcc_sendmsg,
632         .recvmsg =      vcc_recvmsg,
633         .mmap =         sock_no_mmap,
634         .sendpage =     sock_no_sendpage,
635 };
636
637
638 static int svc_create(struct socket *sock,int protocol)
639 {
640         int error;
641
642         sock->ops = &svc_proto_ops;
643         error = vcc_create(sock, protocol, AF_ATMSVC);
644         if (error) return error;
645         ATM_SD(sock)->local.sas_family = AF_ATMSVC;
646         ATM_SD(sock)->remote.sas_family = AF_ATMSVC;
647         return 0;
648 }
649
650
651 static struct net_proto_family svc_family_ops = {
652         .family = PF_ATMSVC,
653         .create = svc_create,
654         .owner = THIS_MODULE,
655 };
656
657
658 /*
659  *      Initialize the ATM SVC protocol family
660  */
661
662 int __init atmsvc_init(void)
663 {
664         return sock_register(&svc_family_ops);
665 }
666
667 void atmsvc_exit(void)
668 {
669         sock_unregister(PF_ATMSVC);
670 }