1 /* in_proto.c 5.3 82/11/03 */ 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 struct protosw inetsw[] = { 37 { 0, PF_INET, 0, 0, 38 0, ip_output, 0, 0, 39 0, 40 ip_init, 0, ip_slowtimo, ip_drain, 41 }, 42 { 0, PF_INET, IPPROTO_ICMP, 0, 43 icmp_input, 0, 0, 0, 44 0, 45 0, 0, 0, 0, 46 }, 47 { SOCK_DGRAM, PF_INET, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, 48 udp_input, 0, udp_ctlinput, 0, 49 udp_usrreq, 50 udp_init, 0, 0, 0, 51 }, 52 { SOCK_STREAM, PF_INET, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, 53 tcp_input, 0, tcp_ctlinput, 0, 54 tcp_usrreq, 55 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, 56 }, 57 { SOCK_RAW, PF_INET, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, 58 rip_input, rip_output, 0, 0, 59 raw_usrreq, 60 0, 0, 0, 0, 61 }, 62 }; 63 64 struct domain inetdomain = 65 { AF_INET, "internet", inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; 66 67 #if NIMP > 0 68 struct protosw impsw[] = { 69 { SOCK_RAW, PF_IMPLINK, 0, PR_ATOMIC|PR_ADDR, 70 0, rimp_output, 0, 0, 71 raw_usrreq, 72 0, 0, hostslowtimo, 0, 73 }, 74 }; 75 76 struct domain impdomain = 77 { AF_IMPLINK, "imp", impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; 78 #endif 79