PERFORCE change 164345 for review
Robert Watson
rwatson at FreeBSD.org
Sun Jun 14 15:19:51 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=164345
Change 164345 by rwatson at rwatson_freebsd_capabilities on 2009/06/14 15:19:29
Define '_rights' versions of libcapability IPC interfaces in order
to send file descriptor rights with messages or RPCs.
Affected files ...
.. //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability.h#14 edit
Differences ...
==== //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability.h#14 (text+ko) ====
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability.h#13 $
+ * $P4: //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability.h#14 $
*/
#ifndef _LIBCAPABILITY_H_
@@ -70,27 +70,52 @@
int lch_getprocdesc(struct lc_sandbox *lcsp, int *fdp);
/*
- * I/O interfaces for the host environment.
+ * Message-passing APIs for the host environment.
*/
struct iovec;
ssize_t lch_recv(struct lc_sandbox *lcsp, void *buf, size_t len, int flags);
+ssize_t lch_recv_rights(struct lc_sandbox *lcsp, void *buf, size_t len,
+ int flags, int *fdp, int *fdcountp);
+ssize_t lch_send(struct lc_sandbox *lcsp, const void *msg, size_t len,
+ int flags);
+ssize_t lch_send_rights(struct lc_sandbox *lcsp, const void *msg, size_t len,
+ int flags, int *fdp, int fdcount);
+
+/*
+ * RPC APIs for the host environment.
+ */
int lch_rpc(struct lc_sandbox *lcsp, u_int32_t opno, struct iovec *req,
int reqcount, struct iovec *rep, int repcount, size_t *replenp);
-ssize_t lch_send(struct lc_sandbox *lcsp, const void *msg, size_t len,
- int flags);
+int lch_rpc_rights(struct lc_sandbox *lcsp, u_int32_t opno,
+ struct iovec *req, int reqcount, int *req_fdp, int *req_fdcount,
+ struct iovec *rep, int repcount, int *rep_fdp, int *rep_fdcount);
/*
- * Capability mode sandbox APIs.
+ * Interfaces to query state from within capability mode sandboxes.
*/
int lcs_get(struct lc_host **lchpp);
int lcs_getsock(struct lc_host *lchp, int *fdp);
+
+/*
+ * Message-passing APIs for the sandbox environment.
+ */
ssize_t lcs_recv(struct lc_host *lchp, void *buf, size_t len, int flags);
+ssize_t lcs_send(struct lc_host *lchp, const void *msg, size_t len,
+ int flags);
+
+/*
+ * RPC APIs for the sandbox environment.
+ */
int lcs_recvrpc(struct lc_host *lchp, u_int32_t *opnop,
u_int32_t *seqnop, u_char **bufferp, size_t *lenp);
-ssize_t lcs_send(struct lc_host *lchp, const void *msg, size_t len,
- int flags);
+int lcs_recvrpc_rights(struct lc_host *lchp, u_int32_t *opnop,
+ u_int32_t *seqnop, u_char **bufferp, size_t *lenp, int *fdp,
+ int *fdcountp);
int lcs_sendrpc(struct lc_host *lchp, u_int32_t opno, u_int32_t seqno,
struct iovec *rep, int repcount);
+int lcs_sendrpc_rights(struct lc_host *lchp, u_int32_t opno,
+ u_int32_t seqno, struct iovec *rep, int repcount, int *fdp,
+ int *fdcountp);
/*
* Actually an rtld-elf-cap symbol, but declared here so it is available to
More information about the p4-projects
mailing list