xref: /csrg-svn/sys/netinet/in_proto.c (revision 7620)
1*7620Sroot /*	in_proto.c	5.2	82/08/01	*/
27618Sroot 
37618Sroot #include "../h/param.h"
47618Sroot #include "../h/socket.h"
57618Sroot #include "../h/protosw.h"
6*7620Sroot #include "../h/domain.h"
77618Sroot #include "../h/mbuf.h"
87618Sroot #include "../net/in.h"
97618Sroot #include "../net/in_systm.h"
107618Sroot 
117618Sroot /*
127618Sroot  * TCP/IP protocol family: IP, ICMP, UDP, TCP.
137618Sroot  */
147618Sroot int	ip_output();
157618Sroot int	ip_init(),ip_slowtimo(),ip_drain();
167618Sroot int	icmp_input();
177618Sroot int	udp_input(),udp_ctlinput();
187618Sroot int	udp_usrreq();
197618Sroot int	udp_init();
207618Sroot int	tcp_input(),tcp_ctlinput();
217618Sroot int	tcp_usrreq();
227618Sroot int	tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
237618Sroot int	rip_input(),rip_output();
24*7620Sroot extern	int raw_usrreq();
257618Sroot /*
267618Sroot  * IMP protocol family: raw interface.
277618Sroot  * Using the raw interface entry to get the timer routine
287618Sroot  * in is a kludge.
297618Sroot  */
307618Sroot #include "imp.h"
317618Sroot #if NIMP > 0
327618Sroot int	rimp_output(), hostslowtimo();
337618Sroot #endif
347618Sroot 
357618Sroot struct protosw inetsw[] = {
36*7620Sroot { 0,		PF_INET,	0,		0,
377618Sroot   0,		ip_output,	0,		0,
387618Sroot   0,
397618Sroot   ip_init,	0,		ip_slowtimo,	ip_drain,
407618Sroot },
417618Sroot { 0,		PF_INET,	IPPROTO_ICMP,	0,
427618Sroot   icmp_input,	0,		0,		0,
437618Sroot   0,
447618Sroot   0,		0,		0,		0,
457618Sroot },
467618Sroot { SOCK_DGRAM,	PF_INET,	IPPROTO_UDP,	PR_ATOMIC|PR_ADDR,
477618Sroot   udp_input,	0,		udp_ctlinput,	0,
487618Sroot   udp_usrreq,
497618Sroot   udp_init,	0,		0,		0,
507618Sroot },
517618Sroot { SOCK_STREAM,	PF_INET,	IPPROTO_TCP,	PR_CONNREQUIRED|PR_WANTRCVD,
527618Sroot   tcp_input,	0,		tcp_ctlinput,	0,
537618Sroot   tcp_usrreq,
547618Sroot   tcp_init,	tcp_fasttimo,	tcp_slowtimo,	tcp_drain,
557618Sroot },
567618Sroot { SOCK_RAW,	PF_INET,	IPPROTO_RAW,	PR_ATOMIC|PR_ADDR,
577618Sroot   rip_input,	rip_output,	0,	0,
587618Sroot   raw_usrreq,
597618Sroot   0,		0,		0,		0,
607618Sroot },
61*7620Sroot };
62*7620Sroot 
63*7620Sroot struct domain inetdomain =
64*7620Sroot     { AF_INET, "internet", inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] };
65*7620Sroot 
667618Sroot #if NIMP > 0
67*7620Sroot struct protosw impsw[] = {
687618Sroot { SOCK_RAW,	PF_IMPLINK,	0,		PR_ATOMIC|PR_ADDR,
697618Sroot   0,		rimp_output,	0,		0,
707618Sroot   raw_usrreq,
717618Sroot   0,		0,		hostslowtimo,	0,
72*7620Sroot },
737618Sroot };
747618Sroot 
75*7620Sroot struct domain impdomain =
76*7620Sroot     { AF_IMPLINK, "imp", impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] };
77*7620Sroot #endif
78