xref: /original-bsd/sys/kern/uipc_proto.c (revision 56c13d2e)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted provided
6  * that: (1) source distributions retain this entire copyright notice and
7  * comment, and (2) distributions including binaries display the following
8  * acknowledgement:  ``This product includes software developed by the
9  * University of California, Berkeley and its contributors'' in the
10  * documentation or other materials provided with the distribution and in
11  * all advertising materials mentioning features or use of this software.
12  * Neither the name of the University nor the names of its contributors may
13  * be used to endorse or promote products derived from this software without
14  * specific prior written permission.
15  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
16  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
17  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  *	@(#)uipc_proto.c	7.4 (Berkeley) 6/28/90
20  */
21 
22 #include "param.h"
23 #include "socket.h"
24 #include "protosw.h"
25 #include "domain.h"
26 #include "mbuf.h"
27 
28 /*
29  * Definitions of protocols supported in the UNIX domain.
30  */
31 
32 int	uipc_usrreq();
33 int	raw_init(),raw_usrreq(),raw_input(),raw_ctlinput();
34 extern	struct domain unixdomain;		/* or at least forward */
35 
36 struct protosw unixsw[] = {
37 { SOCK_STREAM,	&unixdomain,	0,	PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
38   0,		0,		0,		0,
39   uipc_usrreq,
40   0,		0,		0,		0,
41 },
42 { SOCK_DGRAM,	&unixdomain,	0,		PR_ATOMIC|PR_ADDR|PR_RIGHTS,
43   0,		0,		0,		0,
44   uipc_usrreq,
45   0,		0,		0,		0,
46 },
47 { 0,		0,		0,		0,
48   raw_input,	0,		raw_ctlinput,	0,
49   raw_usrreq,
50   raw_init,	0,		0,		0,
51 }
52 };
53 
54 int	unp_externalize(), unp_dispose();
55 
56 struct domain unixdomain =
57     { AF_UNIX, "unix", 0, unp_externalize, unp_dispose,
58       unixsw, &unixsw[sizeof(unixsw)/sizeof(unixsw[0])] };
59