Remove advertising clause from all that isn't contrib or userland bin.
[dragonfly.git] / sys / netproto / ipx / ipx_proto.c
blobc3e1c1b23a7111d3d9ad2acfa25269ff34903059
1 /*
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
8 * are met:
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
28 * SUCH DAMAGE.
30 * @(#)ipx_proto.c
32 * $FreeBSD: src/sys/netipx/ipx_proto.c,v 1.15 1999/08/28 00:49:41 peter Exp $
35 #include "opt_ipx.h"
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>
49 #include "ipx.h"
50 #include "ipx_var.h"
51 #include "spx.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[] = {
62 .pr_type = 0,
63 .pr_domain = &ipxdomain,
64 .pr_protocol = 0,
65 .pr_flags = 0,
67 .pr_init = ipx_init,
68 .pr_usrreqs = &nousrreqs
71 .pr_type = SOCK_DGRAM,
72 .pr_domain = &ipxdomain,
73 .pr_protocol = 0,
74 .pr_flags = PR_ATOMIC|PR_ADDR,
76 .pr_input = NULL,
77 .pr_output = NULL,
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,
90 .pr_input = NULL,
91 .pr_output = NULL,
92 .pr_ctlinput = spx_ctlinput,
93 .pr_ctloutput = spx_ctloutput,
94 .pr_ctlport = cpu0_ctlport,
96 .pr_init = spx_init,
97 .pr_fasttimo = spx_fasttimo,
98 .pr_slowtimo = spx_slowtimo,
99 .pr_drain = NULL,
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,
108 .pr_input = NULL,
109 .pr_output = NULL,
110 .pr_ctlinput = spx_ctlinput,
111 .pr_ctloutput = spx_ctloutput,
113 .pr_ctlport = cpu0_ctlport,
114 .pr_usrreqs = &spx_usrreq_sps
117 .pr_type = SOCK_RAW,
118 .pr_domain = &ipxdomain,
119 .pr_protocol = IPXPROTO_RAW,
120 .pr_flags = PR_ATOMIC|PR_ADDR,
122 .pr_input = NULL,
123 .pr_output = NULL,
124 .pr_ctlinput = NULL,
125 .pr_ctloutput = ipx_ctloutput,
127 .pr_usrreqs = &ripx_usrreqs
129 #ifdef IPTUNNEL
130 #if 0
132 .pr_type = SOCK_RAW,
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,
140 .pr_ctloutput = 0,
142 .pr_ctlport = cpu0_ctlport,
143 .pr_usrreqs = &rip_usrreqs
145 #endif
146 #endif
149 static int
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)};
160 DOMAIN_SET(ipx);
161 SYSCTL_NODE(_net, PF_IPX, ipx, CTLFLAG_RW, 0,
162 "IPX/SPX");
164 SYSCTL_NODE(_net_ipx, IPXPROTO_RAW, ipx, CTLFLAG_RW, 0, "IPX");
165 SYSCTL_NODE(_net_ipx, IPXPROTO_SPX, spx, CTLFLAG_RW, 0, "SPX");