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