tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / netinet / in_proto.c
blob40295e8c4dce95ee4188f8f971eafc93fce36e01
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
24 * Copyright (c) 1982, 1986 Regents of the University of California.
25 * All rights reserved.
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
55 * @(#)in_proto.c 7.5 (Berkeley) 6/28/90
58 #include <conf.h>
60 #include <sys/param.h>
61 #include <sys/socket.h>
62 #include <sys/protosw.h>
63 #include <sys/domain.h>
64 #include <sys/malloc.h>
65 #include <sys/mbuf.h>
67 #include <netinet/in.h>
68 #include <netinet/in_systm.h>
70 #include <netinet/in_proto_protos.h>
73 * TCP/IP protocol family: IP, ICMP, UDP, TCP.
75 #include <netinet/tcp.h>
76 #include <netinet/ip_icmp_protos.h>
77 #include <netinet/ip_input_protos.h>
78 #include <netinet/ip_output_protos.h>
79 #include <netinet/raw_ip_protos.h>
82 * IMP protocol family: raw interface.
83 * Using the raw interface entry to get the timer routine
84 * in is a kludge.
86 #if NIMP > 0
87 int rimp_output(), hostslowtimo();
88 #endif
90 #if NSIP
91 int idpip_input(), nsip_ctlinput();
92 #endif
94 #if TPIP
95 int tpip_input(), tpip_ctlinput(), tp_ctloutput(), tp_usrreq();
96 int tp_init(), tp_slowtimo(), tp_drain();
97 #endif
99 #if EON
100 int eoninput(), eonctlinput(), eonprotoinit();
101 #endif /* EON */
103 extern struct domain inetdomain;
105 struct protosw inetsw[] = {
106 { 0, &inetdomain, 0, 0,
107 NULL, ip_output, NULL, NULL,
108 NULL,
109 ip_init, NULL, ip_slowtimo, ip_drain,
111 { SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
112 udp_input,
113 NULL,
114 udp_ctlinput,
115 ip_ctloutput,
116 udp_usrreq,
117 udp_init, NULL, NULL, NULL,
119 { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD,
120 tcp_input, NULL, tcp_ctlinput, tcp_ctloutput,
121 tcp_usrreq,
122 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
124 { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
125 rip_input, rip_output, NULL, rip_ctloutput,
126 rip_usrreq,
127 NULL, NULL, NULL, NULL,
129 { SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
130 icmp_input,
131 rip_output,
132 NULL,
133 rip_ctloutput,
134 rip_usrreq,
135 NULL, NULL, NULL, NULL,
137 #if TPIP
138 { SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
139 tpip_input, NULL, tpip_ctlinput, tp_ctloutput,
140 tp_usrreq,
141 tp_init, NULL, tp_slowtimo, tp_drain,
143 #endif
144 /* EON (ISO CLNL over IP) */
145 #if EON
146 { SOCK_RAW, &inetdomain, IPPROTO_EON, 0,
147 eoninput, NULL, eonctlinput, NULL,
148 NULL,
149 eonprotoinit, NULL, NULL, NULL,
151 #endif
152 #if NSIP
153 { SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
154 idpip_input, rip_output, nsip_ctlinput, NULL,
155 rip_usrreq,
156 NULL, NULL, NULL, NULL,
158 #endif
159 /* raw wildcard */
160 { SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
161 rip_input, rip_output, NULL, rip_ctloutput,
162 rip_usrreq,
163 NULL, NULL, NULL, NULL,
167 struct domain inetdomain =
168 { AF_INET, "internet", NULL, NULL, NULL,
169 inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], NULL };
171 #if NIMP > 0
172 extern struct domain impdomain;
174 struct protosw impsw[] = {
175 { SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR,
176 0, rimp_output, 0, 0,
177 rip_usrreq,
178 0, 0, hostslowtimo, 0,
182 struct domain impdomain =
183 { AF_IMPLINK, "imp", NULL, NULL, NULL,
184 impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])], NULL };
185 #endif
187 #if NHY > 0
189 * HYPERchannel protocol family: raw interface.
191 int rhy_output();
192 extern struct domain hydomain;
194 struct protosw hysw[] = {
195 { SOCK_RAW, &hydomain, 0, PR_ATOMIC|PR_ADDR,
196 0, rhy_output, 0, 0,
197 rip_usrreq,
198 0, 0, 0, 0,
202 struct domain hydomain =
203 { AF_HYLINK, "hy", NULL, NULL, NULL,
204 hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])], NULL };
205 #endif