xref: /csrg-svn/sys/netiso/iso_usrreq.c (revision 36394)
1*36394Ssklower /***********************************************************
2*36394Ssklower 		Copyright IBM Corporation 1987
3*36394Ssklower 
4*36394Ssklower                       All Rights Reserved
5*36394Ssklower 
6*36394Ssklower Permission to use, copy, modify, and distribute this software and its
7*36394Ssklower documentation for any purpose and without fee is hereby granted,
8*36394Ssklower provided that the above copyright notice appear in all copies and that
9*36394Ssklower both that copyright notice and this permission notice appear in
10*36394Ssklower supporting documentation, and that the name of IBM not be
11*36394Ssklower used in advertising or publicity pertaining to distribution of the
12*36394Ssklower software without specific, written prior permission.
13*36394Ssklower 
14*36394Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15*36394Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16*36394Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17*36394Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18*36394Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19*36394Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20*36394Ssklower SOFTWARE.
21*36394Ssklower 
22*36394Ssklower ******************************************************************/
23*36394Ssklower 
24*36394Ssklower /*
25*36394Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
26*36394Ssklower  */
27*36394Ssklower /*
28*36394Ssklower  * $Header: iso_usrreq.c,v 4.2 88/06/29 15:00:06 hagens Exp $
29*36394Ssklower  * $Source: /usr/argo/sys/netiso/RCS/iso_usrreq.c,v $
30*36394Ssklower  *
31*36394Ssklower  * iso_usrreq.c : support for iso address family ioctls only.
32*36394Ssklower  * (which support ifconfig, for example)
33*36394Ssklower  */
34*36394Ssklower 
35*36394Ssklower #ifndef lint
36*36394Ssklower static char *rcsid = "$Header: iso_usrreq.c,v 4.2 88/06/29 15:00:06 hagens Exp $";
37*36394Ssklower #endif
38*36394Ssklower 
39*36394Ssklower #ifdef ISO
40*36394Ssklower 
41*36394Ssklower #include "../h/types.h"
42*36394Ssklower #include "../h/param.h"
43*36394Ssklower #include "../h/mbuf.h"
44*36394Ssklower #include "../h/domain.h"
45*36394Ssklower #include "../h/protosw.h"
46*36394Ssklower #include "../h/socket.h"
47*36394Ssklower #include "../h/socketvar.h"
48*36394Ssklower #include "../h/errno.h"
49*36394Ssklower 
50*36394Ssklower #include "../net/if.h"
51*36394Ssklower #include "../net/route.h"
52*36394Ssklower 
53*36394Ssklower #include "../netiso/iso.h"
54*36394Ssklower #include "../netiso/clnp.h"
55*36394Ssklower #include "../netiso/clnp_stat.h"
56*36394Ssklower #include "../netiso/argo_debug.h"
57*36394Ssklower 
58*36394Ssklower 
59*36394Ssklower /*
60*36394Ssklower  * FUNCTION:		iso_usrreq
61*36394Ssklower  *
62*36394Ssklower  * PURPOSE:			Provide a means of getting from soo_ioctl to iso_control
63*36394Ssklower  *
64*36394Ssklower  * RETURNS:			unix error code
65*36394Ssklower  *
66*36394Ssklower  * SIDE EFFECTS:
67*36394Ssklower  *
68*36394Ssklower  * NOTES:			Only PRU_CONTROL causes anything to occur. PRU_ATTACH
69*36394Ssklower  *					and PRU_DETACH are noops so socket and close don't return
70*36394Ssklower  *					an error code.
71*36394Ssklower  */
72*36394Ssklower iso_usrreq(so, req, m, nam, rights)
73*36394Ssklower struct socket	*so;		/* socket: used only to get to this code */
74*36394Ssklower int				req;		/* request */
75*36394Ssklower struct mbuf		*m;			/* data for request */
76*36394Ssklower struct mbuf		*nam;		/* optional name */
77*36394Ssklower struct mbuf		*rights;	/* optional rights */
78*36394Ssklower {
79*36394Ssklower 	int		error;
80*36394Ssklower 
81*36394Ssklower 	switch (req) {
82*36394Ssklower 		case PRU_CONTROL:
83*36394Ssklower 			error = iso_control(so, (int)m, (caddr_t)nam,
84*36394Ssklower 				(struct ifnet *)rights);
85*36394Ssklower 			break;
86*36394Ssklower 
87*36394Ssklower 		case PRU_ATTACH:
88*36394Ssklower 		case PRU_DETACH:
89*36394Ssklower 			error = 0;
90*36394Ssklower 			break;
91*36394Ssklower 
92*36394Ssklower 		default:
93*36394Ssklower 			error = EOPNOTSUPP;
94*36394Ssklower 	}
95*36394Ssklower 
96*36394Ssklower 	return error;
97*36394Ssklower }
98*36394Ssklower 
99*36394Ssklower #endif	ISO
100