f9a10415a255d3bfcfac4c903017cdd45375592e
[dragonfly.git] / sys / netproto / atalk / at_proto.c
1 /*
2  * Copyright (c) 1990,1991 Regents of The University of Michigan.
3  * All Rights Reserved.
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both that copyright notice and this permission notice appear
9  * in supporting documentation, and that the name of The University
10  * of Michigan not be used in advertising or publicity pertaining to
11  * distribution of the software without specific, written prior
12  * permission. This software is supplied as is without expressed or
13  * implied warranties of any kind.
14  *
15  *      Research Systems Unix Group
16  *      The University of Michigan
17  *      c/o Mike Clark
18  *      535 W. William Street
19  *      Ann Arbor, Michigan
20  *      +1-313-763-0525
21  *      netatalk@itd.umich.edu
22  */
23
24 #include <sys/param.h>
25 #include <sys/protosw.h>
26 #include <sys/domain.h>
27 #include <sys/socket.h>
28
29 #include <sys/kernel.h>
30
31 #include <net/route.h>
32
33 #include "at.h"
34 #include "ddp_var.h"
35 #include "at_extern.h"
36
37 extern int at_inithead(void **, int);
38
39 static struct domain atalkdomain;
40
41 static struct protosw atalksw[] = {
42     {
43         /* Identifiers */
44         .pr_type = SOCK_DGRAM,
45         .pr_domain = &atalkdomain,
46         .pr_protocol = ATPROTO_DDP,
47         .pr_flags = PR_ATOMIC|PR_ADDR,
48
49         /*
50          * protocol-protocol interface.
51          * fields are pr_input, pr_output, pr_ctlinput, and pr_ctloutput.
52          * pr_input can be called from the udp protocol stack for iptalk
53          * packets bound for a local socket.
54          * pr_output can be used by higher level appletalk protocols, should
55          * they be included in the kernel.
56          */
57         .pr_input = NULL,
58         .pr_output = ddp_output,
59         .pr_ctlinput = NULL,
60         .pr_ctloutput = NULL,
61
62         .pr_init = ddp_init,
63         .pr_usrreqs = &ddp_usrreqs
64     }
65 };
66
67 static struct domain atalkdomain = {
68         AF_APPLETALK, "appletalk", NULL, NULL, NULL,
69         atalksw, &atalksw[NELEM(atalksw)],
70         SLIST_ENTRY_INITIALIZER,
71         at_inithead, 8 * offsetof(struct sockaddr_at, sat_addr),
72         sizeof(struct sockaddr_at),
73 };
74
75 DOMAIN_SET(atalk);
76