xref: /csrg-svn/sys/netns/ns_proto.c (revision 21491)
1 /*      ns_proto.c     6.1     85/05/30     */
2 
3 #include "param.h"
4 #include "socket.h"
5 #include "protosw.h"
6 #include "domain.h"
7 #include "mbuf.h"
8 
9 #include "ns.h"
10 
11 /*
12  * NS protocol family: IDP, ERR, PE, SPP, ROUTE.
13  */
14 int	ns_init(), ns_ctlinput();
15 int	idp_input(), idp_output(), idp_ctlinput(), idp_usrreq();
16 int	idp_raw_usrreq();
17 int	idp_init(), idp_slowtimo(), idp_drain(), idp_ctloutput();
18 int	spp_input(), spp_ctlinput();
19 int	spp_usrreq(), spp_usrreq_sp(), spp_ctloutput();
20 int	spp_init(), spp_fasttimo(), spp_slowtimo(), spp_drain();
21 extern	int raw_usrreq();
22 
23 extern	struct domain nsdomain;
24 
25 struct protosw nssw[] = {
26 { 0,		&nsdomain,	0,		0,
27   0,		idp_output,	0,		0,
28   0,
29   ns_init,	0,		0,		0,
30 },
31 { SOCK_DGRAM,	&nsdomain,	0,		PR_ATOMIC|PR_ADDR,
32   0,		0,		idp_ctlinput,	idp_ctloutput,
33   idp_usrreq,
34   0,		0,		0,		0,
35 },
36 { SOCK_STREAM,	&nsdomain,	NSPROTO_SPP,	PR_CONNREQUIRED|PR_WANTRCVD,
37   spp_input,	0,		spp_ctlinput,	spp_ctloutput,
38   spp_usrreq,
39   spp_init,	spp_fasttimo,	spp_slowtimo,	0,
40 },
41 { SOCK_SEQPACKET,&nsdomain,	NSPROTO_SPP,	PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC,
42   spp_input,	0,		spp_ctlinput,	spp_ctloutput,
43   spp_usrreq_sp,
44   0,		0,		0,		0,
45 },
46 { SOCK_RAW,	&nsdomain,	NSPROTO_RAW,	PR_ATOMIC|PR_ADDR,
47   idp_input,	idp_output,	0,		idp_ctloutput,
48   idp_raw_usrreq,
49   0,		0,		0,		0,
50 },
51 { SOCK_RAW,	&nsdomain,	NSPROTO_ERROR,	PR_ATOMIC|PR_ADDR,
52   idp_ctlinput,	idp_output,	0,		idp_ctloutput,
53   idp_raw_usrreq,
54   0,		0,		0,		0,
55 },
56 };
57 
58 struct domain nsdomain =
59     { AF_NS, "network systems", 0, 0, 0,
60       nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])] };
61 
62