Commit | Line | Data |
---|---|---|
8ae0e4b4 | 1 | /* |
0880b18e | 2 | * Copyright (c) 1982, 1986 Regents of the University of California. |
8ae0e4b4 KM |
3 | * All rights reserved. The Berkeley software License Agreement |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
0880b18e | 6 | * @(#)in_proto.c 7.1 (Berkeley) %G% |
8ae0e4b4 | 7 | */ |
c5707736 | 8 | |
20666ad3 JB |
9 | #include "param.h" |
10 | #include "socket.h" | |
11 | #include "protosw.h" | |
12 | #include "domain.h" | |
13 | #include "mbuf.h" | |
59965020 | 14 | |
20666ad3 JB |
15 | #include "in.h" |
16 | #include "in_systm.h" | |
c5707736 BJ |
17 | |
18 | /* | |
19 | * TCP/IP protocol family: IP, ICMP, UDP, TCP. | |
20 | */ | |
65386213 | 21 | int ip_output(),ip_ctloutput(); |
c5707736 BJ |
22 | int ip_init(),ip_slowtimo(),ip_drain(); |
23 | int icmp_input(); | |
24 | int udp_input(),udp_ctlinput(); | |
25 | int udp_usrreq(); | |
26 | int udp_init(); | |
27 | int tcp_input(),tcp_ctlinput(); | |
65386213 | 28 | int tcp_usrreq(),tcp_ctloutput(); |
c5707736 | 29 | int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain(); |
f75daae6 | 30 | int rip_input(),rip_output(),rip_ctloutput(); |
6d45c4ba | 31 | extern int raw_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 | ||
abe04898 | 46 | extern struct domain inetdomain; |
c5707736 BJ |
47 | |
48 | struct protosw inetsw[] = { | |
abe04898 | 49 | { 0, &inetdomain, 0, 0, |
c5707736 BJ |
50 | 0, ip_output, 0, 0, |
51 | 0, | |
52 | ip_init, 0, ip_slowtimo, ip_drain, | |
53 | }, | |
abe04898 | 54 | { SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, |
65386213 | 55 | udp_input, 0, udp_ctlinput, ip_ctloutput, |
c5707736 BJ |
56 | udp_usrreq, |
57 | udp_init, 0, 0, 0, | |
58 | }, | |
abe04898 | 59 | { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, |
65386213 | 60 | tcp_input, 0, tcp_ctlinput, tcp_ctloutput, |
c5707736 BJ |
61 | tcp_usrreq, |
62 | tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, | |
63 | }, | |
abe04898 | 64 | { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, |
f75daae6 | 65 | rip_input, rip_output, 0, rip_ctloutput, |
c5707736 BJ |
66 | raw_usrreq, |
67 | 0, 0, 0, 0, | |
68 | }, | |
279ad67c | 69 | { SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR, |
f75daae6 | 70 | icmp_input, rip_output, 0, rip_ctloutput, |
c49e68cc MK |
71 | raw_usrreq, |
72 | 0, 0, 0, 0, | |
73 | }, | |
279ad67c | 74 | #ifdef NSIP |
707db385 | 75 | { SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR, |
448b28fe | 76 | idpip_input, rip_output, nsip_ctlinput, 0, |
279ad67c MK |
77 | raw_usrreq, |
78 | 0, 0, 0, 0, | |
79 | }, | |
80 | #endif | |
81 | /* raw wildcard */ | |
82 | { SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR, | |
f75daae6 | 83 | rip_input, rip_output, 0, rip_ctloutput, |
dbf57086 MK |
84 | raw_usrreq, |
85 | 0, 0, 0, 0, | |
86 | }, | |
6d45c4ba BJ |
87 | }; |
88 | ||
89 | struct domain inetdomain = | |
abe04898 MK |
90 | { AF_INET, "internet", 0, 0, 0, |
91 | inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; | |
6d45c4ba | 92 | |
c5707736 | 93 | #if NIMP > 0 |
abe04898 MK |
94 | extern struct domain impdomain; |
95 | ||
6d45c4ba | 96 | struct protosw impsw[] = { |
abe04898 | 97 | { SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR, |
c5707736 BJ |
98 | 0, rimp_output, 0, 0, |
99 | raw_usrreq, | |
100 | 0, 0, hostslowtimo, 0, | |
6d45c4ba | 101 | }, |
c5707736 BJ |
102 | }; |
103 | ||
6d45c4ba | 104 | struct domain impdomain = |
abe04898 MK |
105 | { AF_IMPLINK, "imp", 0, 0, 0, |
106 | impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; | |
6d45c4ba | 107 | #endif |
77df9bb7 MK |
108 | |
109 | #include "hy.h" | |
110 | #if NHY > 0 | |
111 | /* | |
112 | * HYPERchannel protocol family: raw interface. | |
113 | */ | |
114 | int rhy_output(); | |
65386213 | 115 | extern struct domain hydomain; |
77df9bb7 MK |
116 | |
117 | struct protosw hysw[] = { | |
65386213 | 118 | { SOCK_RAW, &hydomain, 0, PR_ATOMIC|PR_ADDR, |
77df9bb7 MK |
119 | 0, rhy_output, 0, 0, |
120 | raw_usrreq, | |
121 | 0, 0, 0, 0, | |
122 | }, | |
123 | }; | |
124 | ||
125 | struct domain hydomain = | |
1e7612a6 | 126 | { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] }; |
77df9bb7 | 127 | #endif |