Commit | Line | Data |
---|---|---|
8ae0e4b4 | 1 | /* |
0880b18e | 2 | * Copyright (c) 1982, 1986 Regents of the University of California. |
2b6b6284 | 3 | * All rights reserved. |
8ae0e4b4 | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
2b6b6284 | 6 | * |
5548a02f | 7 | * @(#)in_proto.c 7.8 (Berkeley) %G% |
8ae0e4b4 | 8 | */ |
c5707736 | 9 | |
5548a02f KB |
10 | #include <sys/param.h> |
11 | #include <sys/socket.h> | |
12 | #include <sys/protosw.h> | |
13 | #include <sys/domain.h> | |
14 | #include <sys/mbuf.h> | |
59965020 | 15 | |
5548a02f KB |
16 | #include <netinet/in.h> |
17 | #include <netinet/in_systm.h> | |
c5707736 | 18 | |
5548a02f | 19 | #include <net/radix.h> |
5c48f39f | 20 | |
c5707736 BJ |
21 | /* |
22 | * TCP/IP protocol family: IP, ICMP, UDP, TCP. | |
23 | */ | |
65386213 | 24 | int ip_output(),ip_ctloutput(); |
c5707736 BJ |
25 | int ip_init(),ip_slowtimo(),ip_drain(); |
26 | int icmp_input(); | |
d6fa15c2 KS |
27 | #ifdef MULTICAST |
28 | int igmp_init(),igmp_input(),igmp_fasttimo(); | |
29 | #endif | |
c5707736 BJ |
30 | int udp_input(),udp_ctlinput(); |
31 | int udp_usrreq(); | |
32 | int udp_init(); | |
33 | int tcp_input(),tcp_ctlinput(); | |
65386213 | 34 | int tcp_usrreq(),tcp_ctloutput(); |
c5707736 | 35 | int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain(); |
d6fa15c2 | 36 | int rip_init(),rip_input(),rip_output(),rip_ctloutput(), rip_usrreq(); |
c5707736 BJ |
37 | /* |
38 | * IMP protocol family: raw interface. | |
39 | * Using the raw interface entry to get the timer routine | |
40 | * in is a kludge. | |
41 | */ | |
42 | #include "imp.h" | |
43 | #if NIMP > 0 | |
44 | int rimp_output(), hostslowtimo(); | |
45 | #endif | |
abe04898 | 46 | |
279ad67c | 47 | #ifdef NSIP |
448b28fe | 48 | int idpip_input(), nsip_ctlinput(); |
279ad67c MK |
49 | #endif |
50 | ||
b4dc7708 KS |
51 | #ifdef TPIP |
52 | int tpip_input(), tpip_ctlinput(), tp_ctloutput(), tp_usrreq(); | |
53 | int tp_init(), tp_slowtimo(), tp_drain(); | |
54 | #endif | |
55 | ||
56 | #ifdef EON | |
57 | int eoninput(), eonctlinput(), eonprotoinit(); | |
58 | #endif EON | |
59 | ||
abe04898 | 60 | extern struct domain inetdomain; |
c5707736 BJ |
61 | |
62 | struct protosw inetsw[] = { | |
abe04898 | 63 | { 0, &inetdomain, 0, 0, |
c5707736 BJ |
64 | 0, ip_output, 0, 0, |
65 | 0, | |
66 | ip_init, 0, ip_slowtimo, ip_drain, | |
67 | }, | |
abe04898 | 68 | { SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, |
65386213 | 69 | udp_input, 0, udp_ctlinput, ip_ctloutput, |
c5707736 BJ |
70 | udp_usrreq, |
71 | udp_init, 0, 0, 0, | |
72 | }, | |
abe04898 | 73 | { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, |
65386213 | 74 | tcp_input, 0, tcp_ctlinput, tcp_ctloutput, |
c5707736 BJ |
75 | tcp_usrreq, |
76 | tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, | |
77 | }, | |
abe04898 | 78 | { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, |
f75daae6 | 79 | rip_input, rip_output, 0, rip_ctloutput, |
b4dc7708 | 80 | rip_usrreq, |
c5707736 BJ |
81 | 0, 0, 0, 0, |
82 | }, | |
279ad67c | 83 | { SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR, |
f75daae6 | 84 | icmp_input, rip_output, 0, rip_ctloutput, |
b4dc7708 | 85 | rip_usrreq, |
c49e68cc MK |
86 | 0, 0, 0, 0, |
87 | }, | |
b4dc7708 KS |
88 | #ifdef TPIP |
89 | { SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD, | |
d6fa15c2 | 90 | tpip_input, 0, tpip_ctlinput, tp_ctloutput, |
b4dc7708 KS |
91 | tp_usrreq, |
92 | tp_init, 0, tp_slowtimo, tp_drain, | |
93 | }, | |
94 | #endif | |
95 | /* EON (ISO CLNL over IP) */ | |
96 | #ifdef EON | |
97 | { SOCK_RAW, &inetdomain, IPPROTO_EON, 0, | |
98 | eoninput, 0, eonctlinput, 0, | |
99 | 0, | |
100 | eonprotoinit, 0, 0, 0, | |
101 | }, | |
102 | #endif | |
d6fa15c2 KS |
103 | #ifdef MULTICAST |
104 | { SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR, | |
105 | igmp_input, rip_output, 0, rip_ctloutput, | |
106 | rip_usrreq, | |
107 | igmp_init, igmp_fasttimo, 0, 0, | |
108 | }, | |
109 | #endif | |
279ad67c | 110 | #ifdef NSIP |
707db385 | 111 | { SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR, |
448b28fe | 112 | idpip_input, rip_output, nsip_ctlinput, 0, |
b4dc7708 | 113 | rip_usrreq, |
279ad67c MK |
114 | 0, 0, 0, 0, |
115 | }, | |
116 | #endif | |
117 | /* raw wildcard */ | |
118 | { SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR, | |
f75daae6 | 119 | rip_input, rip_output, 0, rip_ctloutput, |
b4dc7708 | 120 | rip_usrreq, |
d6fa15c2 | 121 | rip_init, 0, 0, 0, |
dbf57086 | 122 | }, |
6d45c4ba BJ |
123 | }; |
124 | ||
125 | struct domain inetdomain = | |
abe04898 | 126 | { AF_INET, "internet", 0, 0, 0, |
5c48f39f KS |
127 | inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0, |
128 | rn_inithead, 32, sizeof(struct sockaddr_in) }; | |
6d45c4ba | 129 | |
c5707736 | 130 | #if NIMP > 0 |
abe04898 MK |
131 | extern struct domain impdomain; |
132 | ||
6d45c4ba | 133 | struct protosw impsw[] = { |
abe04898 | 134 | { SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR, |
c5707736 | 135 | 0, rimp_output, 0, 0, |
b4dc7708 | 136 | rip_usrreq, |
c5707736 | 137 | 0, 0, hostslowtimo, 0, |
6d45c4ba | 138 | }, |
c5707736 BJ |
139 | }; |
140 | ||
6d45c4ba | 141 | struct domain impdomain = |
abe04898 MK |
142 | { AF_IMPLINK, "imp", 0, 0, 0, |
143 | impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; | |
6d45c4ba | 144 | #endif |
77df9bb7 MK |
145 | |
146 | #include "hy.h" | |
147 | #if NHY > 0 | |
148 | /* | |
149 | * HYPERchannel protocol family: raw interface. | |
150 | */ | |
151 | int rhy_output(); | |
65386213 | 152 | extern struct domain hydomain; |
77df9bb7 MK |
153 | |
154 | struct protosw hysw[] = { | |
65386213 | 155 | { SOCK_RAW, &hydomain, 0, PR_ATOMIC|PR_ADDR, |
77df9bb7 | 156 | 0, rhy_output, 0, 0, |
b4dc7708 | 157 | rip_usrreq, |
77df9bb7 MK |
158 | 0, 0, 0, 0, |
159 | }, | |
160 | }; | |
161 | ||
162 | struct domain hydomain = | |
1e7612a6 | 163 | { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] }; |
77df9bb7 | 164 | #endif |