| 1 | /* in_proto.c 6.1 83/07/29 */ |
| 2 | |
| 3 | #include "../h/param.h" |
| 4 | #include "../h/socket.h" |
| 5 | #include "../h/protosw.h" |
| 6 | #include "../h/domain.h" |
| 7 | #include "../h/mbuf.h" |
| 8 | |
| 9 | #include "../netinet/in.h" |
| 10 | #include "../netinet/in_systm.h" |
| 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(); |
| 25 | extern int raw_usrreq(); |
| 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 |
| 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 |
| 42 | |
| 43 | struct protosw inetsw[] = { |
| 44 | { 0, PF_INET, 0, 0, |
| 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 | }, |
| 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 |
| 76 | }; |
| 77 | |
| 78 | struct domain inetdomain = |
| 79 | { AF_INET, "internet", inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; |
| 80 | |
| 81 | #if NIMP > 0 |
| 82 | struct protosw impsw[] = { |
| 83 | { SOCK_RAW, PF_IMPLINK, 0, PR_ATOMIC|PR_ADDR, |
| 84 | 0, rimp_output, 0, 0, |
| 85 | raw_usrreq, |
| 86 | 0, 0, hostslowtimo, 0, |
| 87 | }, |
| 88 | }; |
| 89 | |
| 90 | struct domain impdomain = |
| 91 | { AF_IMPLINK, "imp", impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; |
| 92 | #endif |