Commit | Line | Data |
---|---|---|
20666ad3 | 1 | /* in_proto.c 6.6 84/08/29 */ |
c5707736 | 2 | |
20666ad3 JB |
3 | #include "param.h" |
4 | #include "socket.h" | |
5 | #include "protosw.h" | |
6 | #include "domain.h" | |
7 | #include "mbuf.h" | |
59965020 | 8 | |
20666ad3 JB |
9 | #include "in.h" |
10 | #include "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 | |
abe04898 MK |
35 | |
36 | extern struct domain inetdomain; | |
c5707736 BJ |
37 | |
38 | struct protosw inetsw[] = { | |
abe04898 | 39 | { 0, &inetdomain, 0, 0, |
c5707736 BJ |
40 | 0, ip_output, 0, 0, |
41 | 0, | |
42 | ip_init, 0, ip_slowtimo, ip_drain, | |
43 | }, | |
abe04898 | 44 | { SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, |
c5707736 BJ |
45 | udp_input, 0, udp_ctlinput, 0, |
46 | udp_usrreq, | |
47 | udp_init, 0, 0, 0, | |
48 | }, | |
abe04898 | 49 | { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, |
c5707736 BJ |
50 | tcp_input, 0, tcp_ctlinput, 0, |
51 | tcp_usrreq, | |
52 | tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, | |
53 | }, | |
abe04898 | 54 | { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, |
c5707736 BJ |
55 | rip_input, rip_output, 0, 0, |
56 | raw_usrreq, | |
57 | 0, 0, 0, 0, | |
58 | }, | |
abe04898 | 59 | { SOCK_RAW, &inetdomain, IPPROTO_EGP, PR_ATOMIC|PR_ADDR, |
c49e68cc MK |
60 | rip_input, rip_output, 0, 0, |
61 | raw_usrreq, | |
62 | 0, 0, 0, 0, | |
63 | }, | |
abe04898 | 64 | { SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR, |
dbf57086 MK |
65 | icmp_input, rip_output, 0, 0, |
66 | raw_usrreq, | |
67 | 0, 0, 0, 0, | |
68 | }, | |
6d45c4ba BJ |
69 | }; |
70 | ||
71 | struct domain inetdomain = | |
abe04898 MK |
72 | { AF_INET, "internet", 0, 0, 0, |
73 | inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; | |
6d45c4ba | 74 | |
c5707736 | 75 | #if NIMP > 0 |
abe04898 MK |
76 | extern struct domain impdomain; |
77 | ||
6d45c4ba | 78 | struct protosw impsw[] = { |
abe04898 | 79 | { SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR, |
c5707736 BJ |
80 | 0, rimp_output, 0, 0, |
81 | raw_usrreq, | |
82 | 0, 0, hostslowtimo, 0, | |
6d45c4ba | 83 | }, |
c5707736 BJ |
84 | }; |
85 | ||
6d45c4ba | 86 | struct domain impdomain = |
abe04898 MK |
87 | { AF_IMPLINK, "imp", 0, 0, 0, |
88 | impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; | |
6d45c4ba | 89 | #endif |