xref: /csrg-svn/sys/netns/ns_proto.c (revision 26056)
1 /*
2  * Copyright (c) 1984, 1985 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)ns_proto.c	6.5 (Berkeley) 02/03/86
7  */
8 
9 #include "param.h"
10 #include "socket.h"
11 #include "protosw.h"
12 #include "domain.h"
13 #include "mbuf.h"
14 
15 #include "ns.h"
16 
17 /*
18  * NS protocol family: IDP, ERR, PE, SPP, ROUTE.
19  */
20 int	ns_init(), ns_ctlinput();
21 int	idp_input(), idp_output(), idp_ctlinput(), idp_usrreq();
22 int	idp_raw_usrreq();
23 int	idp_init(), idp_slowtimo(), idp_drain(), 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(), spp_drain();
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