xref: /csrg-svn/sys/kern/uipc_proto.c (revision 33187)
123419Smckusick /*
229125Smckusick  * Copyright (c) 1982, 1986 Regents of the University of California.
3*33187Sbostic  * All rights reserved.
423419Smckusick  *
5*33187Sbostic  * Redistribution and use in source and binary forms are permitted
6*33187Sbostic  * provided that this notice is preserved and that due credit is given
7*33187Sbostic  * to the University of California at Berkeley. The name of the University
8*33187Sbostic  * may not be used to endorse or promote products derived from this
9*33187Sbostic  * software without specific prior written permission. This software
10*33187Sbostic  * is provided ``as is'' without express or implied warranty.
11*33187Sbostic  *
12*33187Sbostic  *	@(#)uipc_proto.c	7.2 (Berkeley) 12/30/87
1323419Smckusick  */
144825Swnj 
1517102Sbloom #include "param.h"
1617102Sbloom #include "socket.h"
1717102Sbloom #include "protosw.h"
1817102Sbloom #include "domain.h"
1917102Sbloom #include "mbuf.h"
204825Swnj 
214787Swnj /*
229009Sroot  * Definitions of protocols supported in the UNIX domain.
234787Swnj  */
244787Swnj 
259009Sroot int	uipc_usrreq();
266585Ssam int	raw_init(),raw_usrreq(),raw_input(),raw_ctlinput();
2716993Skarels extern	struct domain unixdomain;		/* or at least forward */
285621Swnj 
299009Sroot struct protosw unixsw[] = {
3025631Skarels { SOCK_STREAM,	&unixdomain,	0,	PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
314825Swnj   0,		0,		0,		0,
329009Sroot   uipc_usrreq,
334825Swnj   0,		0,		0,		0,
344890Swnj },
3516993Skarels { SOCK_DGRAM,	&unixdomain,	0,		PR_ATOMIC|PR_ADDR|PR_RIGHTS,
364825Swnj   0,		0,		0,		0,
379009Sroot   uipc_usrreq,
384825Swnj   0,		0,		0,		0,
394890Swnj },
404787Swnj { 0,		0,		0,		0,
416585Ssam   raw_input,	0,		raw_ctlinput,	0,
425621Swnj   raw_usrreq,
435621Swnj   raw_init,	0,		0,		0,
444890Swnj }
454787Swnj };
464787Swnj 
4716993Skarels int	unp_externalize(), unp_dispose();
4816993Skarels 
499009Sroot struct domain unixdomain =
5016993Skarels     { AF_UNIX, "unix", 0, unp_externalize, unp_dispose,
5116993Skarels       unixsw, &unixsw[sizeof(unixsw)/sizeof(unixsw[0])] };
52