2 * Copyright (c) 1995, Mike Mitchell
3 * Copyright (c) 1984, 1985, 1986, 1987, 1993
4 * The Regents of the University of California. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 4. Neither the name of the University nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * $FreeBSD: src/sys/netipx/ipx_proto.c,v 1.15 1999/08/28 00:49:41 peter Exp $
37 #include <sys/param.h>
38 #include <sys/socket.h>
39 #include <sys/protosw.h>
40 #include <sys/domain.h>
41 #include <sys/kernel.h>
42 #include <sys/queue.h>
43 #include <sys/sysctl.h>
44 #include <sys/globaldata.h>
45 #include <sys/thread.h>
47 #include <net/radix.h>
53 static struct domain ipxdomain
;
54 static struct pr_usrreqs nousrreqs
;
57 * IPX protocol family: IPX, ERR, PXP, SPX, ROUTE.
60 static struct protosw ipxsw
[] = {
63 .pr_domain
= &ipxdomain
,
68 .pr_usrreqs
= &nousrreqs
71 .pr_type
= SOCK_DGRAM
,
72 .pr_domain
= &ipxdomain
,
74 .pr_flags
= PR_ATOMIC
|PR_ADDR
,
78 .pr_ctlinput
= ipx_ctlinput
,
79 .pr_ctloutput
= ipx_ctloutput
,
81 .pr_ctlport
= cpu0_ctlport
,
82 .pr_usrreqs
= &ipx_usrreqs
85 .pr_type
= SOCK_STREAM
,
86 .pr_domain
= &ipxdomain
,
87 .pr_protocol
= IPXPROTO_SPX
,
88 .pr_flags
= PR_CONNREQUIRED
|PR_WANTRCVD
,
92 .pr_ctlinput
= spx_ctlinput
,
93 .pr_ctloutput
= spx_ctloutput
,
94 .pr_ctlport
= cpu0_ctlport
,
97 .pr_fasttimo
= spx_fasttimo
,
98 .pr_slowtimo
= spx_slowtimo
,
100 .pr_usrreqs
= &spx_usrreqs
103 .pr_type
= SOCK_SEQPACKET
,
104 .pr_domain
= &ipxdomain
,
105 .pr_protocol
= IPXPROTO_SPX
,
106 .pr_flags
= PR_CONNREQUIRED
|PR_WANTRCVD
|PR_ATOMIC
,
110 .pr_ctlinput
= spx_ctlinput
,
111 .pr_ctloutput
= spx_ctloutput
,
113 .pr_ctlport
= cpu0_ctlport
,
114 .pr_usrreqs
= &spx_usrreq_sps
118 .pr_domain
= &ipxdomain
,
119 .pr_protocol
= IPXPROTO_RAW
,
120 .pr_flags
= PR_ATOMIC
|PR_ADDR
,
125 .pr_ctloutput
= ipx_ctloutput
,
127 .pr_usrreqs
= &ripx_usrreqs
133 .pr_domain
= &ipxdomain
,
134 .pr_protocol
= IPPROTO_IPX
,
135 .pr_flags
= PR_ATOMIC
|PR_ADDR
,
137 .pr_input
= iptun_input
,
138 .pr_output
= rip_output
,
139 .pr_ctlinput
= iptun_ctlinput
,
142 .pr_ctlport
= cpu0_ctlport
,
143 .pr_usrreqs
= &rip_usrreqs
150 ipx_inithead(void **head
, int off
)
152 return rn_inithead(head
, rn_cpumaskhead(mycpuid
), off
);
155 static struct domain ipxdomain
=
156 { AF_IPX
, "network systems", 0, 0, 0,
157 ipxsw
, &ipxsw
[NELEM(ipxsw
)], SLIST_ENTRY_INITIALIZER
,
158 ipx_inithead
, 16, sizeof(struct sockaddr_ipx
)};
161 SYSCTL_NODE(_net
, PF_IPX
, ipx
, CTLFLAG_RW
, 0,
164 SYSCTL_NODE(_net_ipx
, IPXPROTO_RAW
, ipx
, CTLFLAG_RW
, 0, "IPX");
165 SYSCTL_NODE(_net_ipx
, IPXPROTO_SPX
, spx
, CTLFLAG_RW
, 0, "SPX");