2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
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,
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
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
55 * @(#)in_proto.c 7.5 (Berkeley) 6/28/90
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>
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
87 int rimp_output(), hostslowtimo();
91 int idpip_input(), nsip_ctlinput();
95 int tpip_input(), tpip_ctlinput(), tp_ctloutput(), tp_usrreq();
96 int tp_init(), tp_slowtimo(), tp_drain();
100 int eoninput(), eonctlinput(), eonprotoinit();
103 extern struct domain inetdomain
;
105 struct protosw inetsw
[] = {
106 { 0, &inetdomain
, 0, 0,
107 NULL
, ip_output
, NULL
, NULL
,
109 ip_init
, NULL
, ip_slowtimo
, ip_drain
,
111 { SOCK_DGRAM
, &inetdomain
, IPPROTO_UDP
, PR_ATOMIC
|PR_ADDR
,
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
,
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
,
127 NULL
, NULL
, NULL
, NULL
,
129 { SOCK_RAW
, &inetdomain
, IPPROTO_ICMP
, PR_ATOMIC
|PR_ADDR
,
135 NULL
, NULL
, NULL
, NULL
,
138 { SOCK_SEQPACKET
,&inetdomain
, IPPROTO_TP
, PR_CONNREQUIRED
|PR_WANTRCVD
,
139 tpip_input
, NULL
, tpip_ctlinput
, tp_ctloutput
,
141 tp_init
, NULL
, tp_slowtimo
, tp_drain
,
144 /* EON (ISO CLNL over IP) */
146 { SOCK_RAW
, &inetdomain
, IPPROTO_EON
, 0,
147 eoninput
, NULL
, eonctlinput
, NULL
,
149 eonprotoinit
, NULL
, NULL
, NULL
,
153 { SOCK_RAW
, &inetdomain
, IPPROTO_IDP
, PR_ATOMIC
|PR_ADDR
,
154 idpip_input
, rip_output
, nsip_ctlinput
, NULL
,
156 NULL
, NULL
, NULL
, NULL
,
160 { SOCK_RAW
, &inetdomain
, 0, PR_ATOMIC
|PR_ADDR
,
161 rip_input
, rip_output
, NULL
, rip_ctloutput
,
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
};
172 extern struct domain impdomain
;
174 struct protosw impsw
[] = {
175 { SOCK_RAW
, &impdomain
, 0, PR_ATOMIC
|PR_ADDR
,
176 0, rimp_output
, 0, 0,
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
};
189 * HYPERchannel protocol family: raw interface.
192 extern struct domain hydomain
;
194 struct protosw hysw
[] = {
195 { SOCK_RAW
, &hydomain
, 0, PR_ATOMIC
|PR_ADDR
,
202 struct domain hydomain
=
203 { AF_HYLINK
, "hy", NULL
, NULL
, NULL
,
204 hysw
, &hysw
[sizeof (hysw
)/sizeof(hysw
[0])], NULL
};