1 /* in_proto.c 5.1 82/07/31 */ 2 3 #include "../h/param.h" 4 #include "../h/socket.h" 5 #include "../h/protosw.h" 6 #include "../h/mbuf.h" 7 #include "../net/in.h" 8 #include "../net/in_systm.h" 9 10 /* 11 * TCP/IP protocol family: IP, ICMP, UDP, TCP. 12 */ 13 int ip_output(); 14 int ip_init(),ip_slowtimo(),ip_drain(); 15 int icmp_input(); 16 int udp_input(),udp_ctlinput(); 17 int udp_usrreq(); 18 int udp_init(); 19 int tcp_input(),tcp_ctlinput(); 20 int tcp_usrreq(); 21 int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain(); 22 int rip_input(),rip_output(); 23 /* 24 * IMP protocol family: raw interface. 25 * Using the raw interface entry to get the timer routine 26 * in is a kludge. 27 */ 28 #include "imp.h" 29 #if NIMP > 0 30 int rimp_output(), hostslowtimo(); 31 #endif 32 33 struct protosw inetsw[] = { 34 { 0, 0, 0, 0, 35 0, ip_output, 0, 0, 36 0, 37 ip_init, 0, ip_slowtimo, ip_drain, 38 }, 39 { 0, PF_INET, IPPROTO_ICMP, 0, 40 icmp_input, 0, 0, 0, 41 0, 42 0, 0, 0, 0, 43 }, 44 { SOCK_DGRAM, PF_INET, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, 45 udp_input, 0, udp_ctlinput, 0, 46 udp_usrreq, 47 udp_init, 0, 0, 0, 48 }, 49 { SOCK_STREAM, PF_INET, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, 50 tcp_input, 0, tcp_ctlinput, 0, 51 tcp_usrreq, 52 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, 53 }, 54 { SOCK_RAW, PF_INET, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, 55 rip_input, rip_output, 0, 0, 56 raw_usrreq, 57 0, 0, 0, 0, 58 }, 59 #if NIMP > 0 60 { SOCK_RAW, PF_IMPLINK, 0, PR_ATOMIC|PR_ADDR, 61 0, rimp_output, 0, 0, 62 raw_usrreq, 63 0, 0, hostslowtimo, 0, 64 } 65 #endif 66 }; 67 68 struct domain inetdomain = 69 { AF_INET, "internet", inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; 70