diff options
| author | casper <none@none> | 2008-03-03 07:48:05 -0800 |
|---|---|---|
| committer | casper <none@none> | 2008-03-03 07:48:05 -0800 |
| commit | ddf7fe95b8ad67aa16deb427a0b78f4dd4ff22b1 (patch) | |
| tree | d61fb6e84331e6682c0c2fbd86826fc05b4edee1 /usr/src/uts/common/sys/klpd.h | |
| parent | ea4b186bb8308ae1daf547212cb90881570ff943 (diff) | |
| download | illumos-joyent-ddf7fe95b8ad67aa16deb427a0b78f4dd4ff22b1.tar.gz | |
PSARC 2008/109 Fine Grained Access Permissions (FGAP)
6664443 Implement PSARC/2008/109
Diffstat (limited to 'usr/src/uts/common/sys/klpd.h')
| -rw-r--r-- | usr/src/uts/common/sys/klpd.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/klpd.h b/usr/src/uts/common/sys/klpd.h new file mode 100644 index 0000000000..535af85f89 --- /dev/null +++ b/usr/src/uts/common/sys/klpd.h @@ -0,0 +1,102 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_KLPD_H +#define _SYS_KLPD_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <sys/types.h> +#include <sys/priv.h> +#include <sys/procset.h> + +#ifdef _KERNEL +#include <sys/cred.h> +#include <sys/sysmacros.h> +#include <sys/varargs.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define KLPDCALL_VERS 1 + +#define KLPDARG_NOMORE 0 /* End of argument List */ +#define KLPDARG_NONE 0 /* No argument */ +#define KLPDARG_VNODE 1 /* vnode_t * */ +#define KLPDARG_INT 2 /* int */ +#define KLPDARG_PORT 3 /* int, port number */ +#define KLPDARG_TCPPORT 4 /* int, tcp port number */ +#define KLPDARG_UDPPORT 5 /* int, udp port number */ +#define KLPDARG_SCTPPORT 6 /* int, sctp port number */ +#define KLPDARG_SDPPORT 7 /* int, sdp port number */ + +#ifdef _KERNEL + +struct klpd_reg; +struct credklpd; + +int klpd_reg(int, idtype_t, id_t, priv_set_t *); +int klpd_unreg(int, idtype_t, id_t); +void klpd_remove(struct klpd_reg **); +void klpd_rele(struct klpd_reg *); +int klpd_call(const cred_t *, const priv_set_t *, va_list); +void crklpd_hold(struct credklpd *); +void crklpd_rele(struct credklpd *); + +#endif /* _KERNEL */ + +typedef struct klpd_head { + uint32_t klh_vers; /* Version */ + uint32_t klh_len; /* Length of full packet */ + uint32_t klh_argoff; /* Offset of argument */ + uint32_t klh_privoff; /* Offset of privilege set */ +} klpd_head_t; + +#define KLH_PRIVSET(kh) ((priv_set_t *)(((kh)->klh_privoff == 0 ? NULL : \ + (char *)(kh) + (kh)->klh_privoff))) +#define KLH_ARG(kh) ((void *)((kh)->klh_argoff != 0 ? \ + (char *)(kh) + (kh)->klh_argoff : NULL)) + +typedef struct klpd_arg { + uint_t kla_type; + uint_t kla_dlen; + union { + char __cdata[1]; + int __idata; + uint_t __uidata; + } kla_data; +} klpd_arg_t; + +#define kla_str kla_data.__cdata +#define kla_int kla_data.__idata +#define kla_uint kla_data.__uidata + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_KLPD_H */ |
