xref: /original-bsd/sys/kern/uipc_proto.c (revision e0c0d005)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)uipc_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 /*
17  * Definitions of protocols supported in the UNIX domain.
18  */
19 
20 int	uipc_usrreq();
21 int	raw_init(),raw_usrreq(),raw_input(),raw_ctlinput();
22 extern	struct domain unixdomain;		/* or at least forward */
23 
24 struct protosw unixsw[] = {
25 { SOCK_STREAM,	&unixdomain,	0,	PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
26   0,		0,		0,		0,
27   uipc_usrreq,
28   0,		0,		0,		0,
29 },
30 { SOCK_DGRAM,	&unixdomain,	0,		PR_ATOMIC|PR_ADDR|PR_RIGHTS,
31   0,		0,		0,		0,
32   uipc_usrreq,
33   0,		0,		0,		0,
34 },
35 { 0,		0,		0,		0,
36   raw_input,	0,		raw_ctlinput,	0,
37   raw_usrreq,
38   raw_init,	0,		0,		0,
39 }
40 };
41 
42 int	unp_externalize(), unp_dispose();
43 
44 struct domain unixdomain =
45     { AF_UNIX, "unix", 0, unp_externalize, unp_dispose,
46       unixsw, &unixsw[sizeof(unixsw)/sizeof(unixsw[0])] };
47