xref: /original-bsd/sys/netns/ns_proto.c (revision 9b5efc43)
1 /*
2  * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ns_proto.c	7.4 (Berkeley) 06/28/90
8  */
9 
10 #include "param.h"
11 #include "socket.h"
12 #include "protosw.h"
13 #include "domain.h"
14 #include "mbuf.h"
15 
16 #include "ns.h"
17 
18 /*
19  * NS protocol family: IDP, ERR, PE, SPP, ROUTE.
20  */
21 int	ns_init();
22 int	idp_input(), idp_output(), idp_ctlinput(), idp_usrreq();
23 int	idp_raw_usrreq(), idp_ctloutput();
24 int	spp_input(), spp_ctlinput();
25 int	spp_usrreq(), spp_usrreq_sp(), spp_ctloutput();
26 int	spp_init(), spp_fasttimo(), spp_slowtimo();
27 extern	int raw_usrreq();
28 
29 extern	struct domain nsdomain;
30 
31 struct protosw nssw[] = {
32 { 0,		&nsdomain,	0,		0,
33   0,		idp_output,	0,		0,
34   0,
35   ns_init,	0,		0,		0,
36 },
37 { SOCK_DGRAM,	&nsdomain,	0,		PR_ATOMIC|PR_ADDR,
38   0,		0,		idp_ctlinput,	idp_ctloutput,
39   idp_usrreq,
40   0,		0,		0,		0,
41 },
42 { SOCK_STREAM,	&nsdomain,	NSPROTO_SPP,	PR_CONNREQUIRED|PR_WANTRCVD,
43   spp_input,	0,		spp_ctlinput,	spp_ctloutput,
44   spp_usrreq,
45   spp_init,	spp_fasttimo,	spp_slowtimo,	0,
46 },
47 { SOCK_SEQPACKET,&nsdomain,	NSPROTO_SPP,	PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC,
48   spp_input,	0,		spp_ctlinput,	spp_ctloutput,
49   spp_usrreq_sp,
50   0,		0,		0,		0,
51 },
52 { SOCK_RAW,	&nsdomain,	NSPROTO_RAW,	PR_ATOMIC|PR_ADDR,
53   idp_input,	idp_output,	0,		idp_ctloutput,
54   idp_raw_usrreq,
55   0,		0,		0,		0,
56 },
57 { SOCK_RAW,	&nsdomain,	NSPROTO_ERROR,	PR_ATOMIC|PR_ADDR,
58   idp_ctlinput,	idp_output,	0,		idp_ctloutput,
59   idp_raw_usrreq,
60   0,		0,		0,		0,
61 },
62 };
63 
64 struct domain nsdomain =
65     { AF_NS, "network systems", 0, 0, 0,
66       nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])] };
67 
68