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