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 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)uipc_proto.c 7.3 (Berkeley) 06/29/88 18 */ 19 20 #include "param.h" 21 #include "socket.h" 22 #include "protosw.h" 23 #include "domain.h" 24 #include "mbuf.h" 25 26 /* 27 * Definitions of protocols supported in the UNIX domain. 28 */ 29 30 int uipc_usrreq(); 31 int raw_init(),raw_usrreq(),raw_input(),raw_ctlinput(); 32 extern struct domain unixdomain; /* or at least forward */ 33 34 struct protosw unixsw[] = { 35 { SOCK_STREAM, &unixdomain, 0, PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, 36 0, 0, 0, 0, 37 uipc_usrreq, 38 0, 0, 0, 0, 39 }, 40 { SOCK_DGRAM, &unixdomain, 0, PR_ATOMIC|PR_ADDR|PR_RIGHTS, 41 0, 0, 0, 0, 42 uipc_usrreq, 43 0, 0, 0, 0, 44 }, 45 { 0, 0, 0, 0, 46 raw_input, 0, raw_ctlinput, 0, 47 raw_usrreq, 48 raw_init, 0, 0, 0, 49 } 50 }; 51 52 int unp_externalize(), unp_dispose(); 53 54 struct domain unixdomain = 55 { AF_UNIX, "unix", 0, unp_externalize, unp_dispose, 56 unixsw, &unixsw[sizeof(unixsw)/sizeof(unixsw[0])] }; 57