Commit | Line | Data |
---|---|---|
8c58db17 | 1 | /* in_proto.c 5.4 83/01/17 */ |
c5707736 BJ |
2 | |
3 | #include "../h/param.h" | |
4 | #include "../h/socket.h" | |
5 | #include "../h/protosw.h" | |
6d45c4ba | 6 | #include "../h/domain.h" |
c5707736 | 7 | #include "../h/mbuf.h" |
59965020 BJ |
8 | |
9 | #include "../netinet/in.h" | |
10 | #include "../netinet/in_systm.h" | |
c5707736 BJ |
11 | |
12 | /* | |
13 | * TCP/IP protocol family: IP, ICMP, UDP, TCP. | |
14 | */ | |
15 | int ip_output(); | |
16 | int ip_init(),ip_slowtimo(),ip_drain(); | |
17 | int icmp_input(); | |
18 | int udp_input(),udp_ctlinput(); | |
19 | int udp_usrreq(); | |
20 | int udp_init(); | |
21 | int tcp_input(),tcp_ctlinput(); | |
22 | int tcp_usrreq(); | |
23 | int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain(); | |
24 | int rip_input(),rip_output(); | |
6d45c4ba | 25 | extern int raw_usrreq(); |
c5707736 BJ |
26 | /* |
27 | * IMP protocol family: raw interface. | |
28 | * Using the raw interface entry to get the timer routine | |
29 | * in is a kludge. | |
30 | */ | |
31 | #include "imp.h" | |
32 | #if NIMP > 0 | |
33 | int rimp_output(), hostslowtimo(); | |
34 | #endif | |
8c58db17 SL |
35 | /* |
36 | * Network disk protocol: runs on top of IP | |
37 | */ | |
38 | #include "nd.h" | |
39 | #if NND > 0 | |
40 | int nd_input(), nd_slowtimo(), nd_init(); | |
41 | #endif | |
c5707736 BJ |
42 | |
43 | struct protosw inetsw[] = { | |
6d45c4ba | 44 | { 0, PF_INET, 0, 0, |
c5707736 BJ |
45 | 0, ip_output, 0, 0, |
46 | 0, | |
47 | ip_init, 0, ip_slowtimo, ip_drain, | |
48 | }, | |
49 | { 0, PF_INET, IPPROTO_ICMP, 0, | |
50 | icmp_input, 0, 0, 0, | |
51 | 0, | |
52 | 0, 0, 0, 0, | |
53 | }, | |
54 | { SOCK_DGRAM, PF_INET, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, | |
55 | udp_input, 0, udp_ctlinput, 0, | |
56 | udp_usrreq, | |
57 | udp_init, 0, 0, 0, | |
58 | }, | |
59 | { SOCK_STREAM, PF_INET, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, | |
60 | tcp_input, 0, tcp_ctlinput, 0, | |
61 | tcp_usrreq, | |
62 | tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, | |
63 | }, | |
64 | { SOCK_RAW, PF_INET, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, | |
65 | rip_input, rip_output, 0, 0, | |
66 | raw_usrreq, | |
67 | 0, 0, 0, 0, | |
68 | }, | |
8c58db17 SL |
69 | #if NND > 0 |
70 | { 0, PF_INET, IPPROTO_ND, 0, | |
71 | nd_input, 0, 0, 0, | |
72 | 0, | |
73 | nd_init, 0, nd_slowtimo, 0, | |
74 | }, | |
75 | #endif | |
6d45c4ba BJ |
76 | }; |
77 | ||
78 | struct domain inetdomain = | |
79 | { AF_INET, "internet", inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; | |
80 | ||
c5707736 | 81 | #if NIMP > 0 |
6d45c4ba | 82 | struct protosw impsw[] = { |
c5707736 BJ |
83 | { SOCK_RAW, PF_IMPLINK, 0, PR_ATOMIC|PR_ADDR, |
84 | 0, rimp_output, 0, 0, | |
85 | raw_usrreq, | |
86 | 0, 0, hostslowtimo, 0, | |
6d45c4ba | 87 | }, |
c5707736 BJ |
88 | }; |
89 | ||
6d45c4ba BJ |
90 | struct domain impdomain = |
91 | { AF_IMPLINK, "imp", impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; | |
92 | #endif |