2 * Copyright (c) 1984, 1985, 1986, 1987, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 4. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * Copyright (c) 1995, Mike Mitchell
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
34 * 1. Redistributions of source code must retain the above copyright
35 * notice, this list of conditions and the following disclaimer.
36 * 2. Redistributions in binary form must reproduce the above copyright
37 * notice, this list of conditions and the following disclaimer in the
38 * documentation and/or other materials provided with the distribution.
39 * 3. All advertising materials mentioning features or use of this software
40 * must display the following acknowledgement:
41 * This product includes software developed by the University of
42 * California, Berkeley and its contributors.
43 * 4. Neither the name of the University nor the names of its contributors
44 * may be used to endorse or promote products derived from this software
45 * without specific prior written permission.
47 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 #include <sys/cdefs.h>
63 __FBSDID("$FreeBSD$");
67 #include <sys/param.h>
68 #include <sys/systm.h>
69 #include <sys/socket.h>
70 #include <sys/protosw.h>
71 #include <sys/domain.h>
72 #include <sys/kernel.h>
73 #include <sys/queue.h>
74 #include <sys/sysctl.h>
76 #include <net/radix.h>
78 #include <netipx/ipx.h>
79 #include <netipx/ipx_var.h>
80 #include <netipx/spx.h>
82 static struct pr_usrreqs nousrreqs;
85 * IPX protocol family: IPX, ERR, PXP, SPX, ROUTE.
88 static struct domain ipxdomain;
90 static struct protosw ipxsw[] = {
92 .pr_domain = &ipxdomain,
94 .pr_usrreqs = &nousrreqs
97 .pr_type = SOCK_DGRAM,
98 .pr_domain = &ipxdomain,
99 .pr_flags = PR_ATOMIC|PR_ADDR,
100 .pr_ctlinput = ipx_ctlinput,
101 .pr_ctloutput = ipx_ctloutput,
102 .pr_usrreqs = &ipx_usrreqs
105 .pr_type = SOCK_STREAM,
106 .pr_domain = &ipxdomain,
107 .pr_protocol = IPXPROTO_SPX,
108 .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD,
109 .pr_ctlinput = spx_ctlinput,
110 .pr_ctloutput = spx_ctloutput,
112 .pr_fasttimo = spx_fasttimo,
113 .pr_slowtimo = spx_slowtimo,
114 .pr_usrreqs = &spx_usrreqs
117 .pr_type = SOCK_SEQPACKET,
118 .pr_domain = &ipxdomain,
119 .pr_protocol = IPXPROTO_SPX,
120 .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC,
121 .pr_ctlinput = spx_ctlinput,
122 .pr_ctloutput = spx_ctloutput,
123 .pr_usrreqs = &spx_usrreq_sps
127 .pr_domain = &ipxdomain,
128 .pr_protocol = IPXPROTO_RAW,
129 .pr_flags = PR_ATOMIC|PR_ADDR,
130 .pr_ctloutput = ipx_ctloutput,
131 .pr_usrreqs = &ripx_usrreqs
135 extern int ipx_inithead(void **, int);
137 static struct domain ipxdomain = {
138 .dom_family = AF_IPX,
139 .dom_name = "network systems",
140 .dom_protosw = ipxsw,
141 .dom_protoswNPROTOSW = &ipxsw[sizeof(ipxsw)/sizeof(ipxsw[0])],
142 .dom_rtattach = ipx_inithead,
144 .dom_maxrtkey = sizeof(struct sockaddr_ipx)
148 /* shim to adapt arguments */
150 ipx_inithead(void **head, int offset)
152 return rn_inithead(head, offset);
156 SYSCTL_NODE(_net, PF_IPX, ipx, CTLFLAG_RW, 0,
159 SYSCTL_NODE(_net_ipx, IPXPROTO_RAW, ipx, CTLFLAG_RW, 0, "IPX");
160 static SYSCTL_NODE(_net_ipx, IPXPROTO_SPX, spx, CTLFLAG_RW, 0, "SPX");