bootesym should be #ifdef'd KADB
[unix-history] / usr / src / sys / netinet / in_proto.c
CommitLineData
8ae0e4b4 1/*
0880b18e 2 * Copyright (c) 1982, 1986 Regents of the University of California.
2b6b6284 3 * All rights reserved.
8ae0e4b4 4 *
2b6b6284 5 * Redistribution and use in source and binary forms are permitted
616d42db
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2b6b6284 16 *
616d42db 17 * @(#)in_proto.c 7.3 (Berkeley) %G%
8ae0e4b4 18 */
c5707736 19
20666ad3
JB
20#include "param.h"
21#include "socket.h"
22#include "protosw.h"
23#include "domain.h"
24#include "mbuf.h"
59965020 25
20666ad3
JB
26#include "in.h"
27#include "in_systm.h"
c5707736
BJ
28
29/*
30 * TCP/IP protocol family: IP, ICMP, UDP, TCP.
31 */
65386213 32int ip_output(),ip_ctloutput();
c5707736
BJ
33int ip_init(),ip_slowtimo(),ip_drain();
34int icmp_input();
35int udp_input(),udp_ctlinput();
36int udp_usrreq();
37int udp_init();
38int tcp_input(),tcp_ctlinput();
65386213 39int tcp_usrreq(),tcp_ctloutput();
c5707736 40int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
f75daae6 41int rip_input(),rip_output(),rip_ctloutput();
6d45c4ba 42extern int raw_usrreq();
c5707736
BJ
43/*
44 * IMP protocol family: raw interface.
45 * Using the raw interface entry to get the timer routine
46 * in is a kludge.
47 */
48#include "imp.h"
49#if NIMP > 0
50int rimp_output(), hostslowtimo();
51#endif
abe04898 52
279ad67c 53#ifdef NSIP
448b28fe 54int idpip_input(), nsip_ctlinput();
279ad67c
MK
55#endif
56
abe04898 57extern struct domain inetdomain;
c5707736
BJ
58
59struct protosw inetsw[] = {
abe04898 60{ 0, &inetdomain, 0, 0,
c5707736
BJ
61 0, ip_output, 0, 0,
62 0,
63 ip_init, 0, ip_slowtimo, ip_drain,
64},
abe04898 65{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
65386213 66 udp_input, 0, udp_ctlinput, ip_ctloutput,
c5707736
BJ
67 udp_usrreq,
68 udp_init, 0, 0, 0,
69},
abe04898 70{ SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD,
65386213 71 tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
c5707736
BJ
72 tcp_usrreq,
73 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
74},
abe04898 75{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
f75daae6 76 rip_input, rip_output, 0, rip_ctloutput,
c5707736
BJ
77 raw_usrreq,
78 0, 0, 0, 0,
79},
279ad67c 80{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
f75daae6 81 icmp_input, rip_output, 0, rip_ctloutput,
c49e68cc
MK
82 raw_usrreq,
83 0, 0, 0, 0,
84},
279ad67c 85#ifdef NSIP
707db385 86{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
448b28fe 87 idpip_input, rip_output, nsip_ctlinput, 0,
279ad67c
MK
88 raw_usrreq,
89 0, 0, 0, 0,
90},
91#endif
92 /* raw wildcard */
93{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
f75daae6 94 rip_input, rip_output, 0, rip_ctloutput,
dbf57086
MK
95 raw_usrreq,
96 0, 0, 0, 0,
97},
6d45c4ba
BJ
98};
99
100struct domain inetdomain =
abe04898
MK
101 { AF_INET, "internet", 0, 0, 0,
102 inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] };
6d45c4ba 103
c5707736 104#if NIMP > 0
abe04898
MK
105extern struct domain impdomain;
106
6d45c4ba 107struct protosw impsw[] = {
abe04898 108{ SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR,
c5707736
BJ
109 0, rimp_output, 0, 0,
110 raw_usrreq,
111 0, 0, hostslowtimo, 0,
6d45c4ba 112},
c5707736
BJ
113};
114
6d45c4ba 115struct domain impdomain =
abe04898
MK
116 { AF_IMPLINK, "imp", 0, 0, 0,
117 impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] };
6d45c4ba 118#endif
77df9bb7
MK
119
120#include "hy.h"
121#if NHY > 0
122/*
123 * HYPERchannel protocol family: raw interface.
124 */
125int rhy_output();
65386213 126extern struct domain hydomain;
77df9bb7
MK
127
128struct protosw hysw[] = {
65386213 129{ SOCK_RAW, &hydomain, 0, PR_ATOMIC|PR_ADDR,
77df9bb7
MK
130 0, rhy_output, 0, 0,
131 raw_usrreq,
132 0, 0, 0, 0,
133},
134};
135
136struct domain hydomain =
1e7612a6 137 { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] };
77df9bb7 138#endif