xref: /onnv-gate/usr/src/uts/common/sys/ctfs.h (revision 4845:357e8e7542af)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*4845Svikram  * Common Development and Distribution License (the "License").
6*4845Svikram  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*4845Svikram  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_SYS_CTFS_H
270Sstevel@tonic-gate #define	_SYS_CTFS_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #include <sys/contract.h>
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifdef	__cplusplus
340Sstevel@tonic-gate extern "C" {
350Sstevel@tonic-gate #endif
360Sstevel@tonic-gate 
370Sstevel@tonic-gate /*
380Sstevel@tonic-gate  * Location of the contract filesystem.
390Sstevel@tonic-gate  */
400Sstevel@tonic-gate #define	CTFS_ROOT	"/system/contract"
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate  * CTFS ioctl constants
440Sstevel@tonic-gate  */
450Sstevel@tonic-gate #define	CTFS_PREFIX	('c' << 24 | 't' << 16)
460Sstevel@tonic-gate #define	CTFS_IOC(x, y)	(CTFS_PREFIX | (x) << 8 | (y))
470Sstevel@tonic-gate 
480Sstevel@tonic-gate /*
490Sstevel@tonic-gate  * Control codes for messages written to template files.
500Sstevel@tonic-gate  */
510Sstevel@tonic-gate #define	CTFS_TMPL(x)	CTFS_IOC('t', x)
520Sstevel@tonic-gate #define	CT_TACTIVATE	CTFS_TMPL(0)	/* Activate template */
530Sstevel@tonic-gate #define	CT_TCLEAR	CTFS_TMPL(1)	/* Clear active template */
540Sstevel@tonic-gate #define	CT_TCREATE	CTFS_TMPL(2)	/* Create contract from template */
550Sstevel@tonic-gate #define	CT_TSET		CTFS_TMPL(3)	/* Set parameter */
560Sstevel@tonic-gate #define	CT_TGET		CTFS_TMPL(4)	/* Get parameter */
570Sstevel@tonic-gate 
580Sstevel@tonic-gate /*
590Sstevel@tonic-gate  * Control codes for messages written to ctl files.
600Sstevel@tonic-gate  */
610Sstevel@tonic-gate #define	CTFS_CTL(x)	CTFS_IOC('c', x)
620Sstevel@tonic-gate #define	CT_CABANDON	CTFS_CTL(0)	/* Abandon contract */
630Sstevel@tonic-gate #define	CT_CACK		CTFS_CTL(1)	/* Ack a message */
640Sstevel@tonic-gate #define	CT_CQREQ	CTFS_CTL(2)	/* Request an additional quantum */
650Sstevel@tonic-gate #define	CT_CADOPT	CTFS_CTL(3)	/* Adopt a contract */
660Sstevel@tonic-gate #define	CT_CNEWCT	CTFS_CTL(4)	/* Define new contract */
67*4845Svikram #define	CT_CNACK	CTFS_CTL(5)	/* nack a negotiation */
680Sstevel@tonic-gate 
690Sstevel@tonic-gate /*
700Sstevel@tonic-gate  * Control codes for messages written to status files.
710Sstevel@tonic-gate  */
720Sstevel@tonic-gate #define	CTFS_STAT(x)	CTFS_IOC('s', x)
730Sstevel@tonic-gate #define	CT_SSTATUS	CTFS_STAT(0)	/* Obtain contract status */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /*
760Sstevel@tonic-gate  * Control codes for messages written to event endpoints.
770Sstevel@tonic-gate  */
780Sstevel@tonic-gate #define	CTFS_EVT(x)	CTFS_IOC('e', x)
790Sstevel@tonic-gate #define	CT_ERESET	CTFS_EVT(0)	/* Reset event queue pointer */
800Sstevel@tonic-gate #define	CT_ERECV	CTFS_EVT(1)	/* Read next event */
810Sstevel@tonic-gate #define	CT_ECRECV	CTFS_EVT(2)	/* Read next critical event */
820Sstevel@tonic-gate #define	CT_ENEXT	CTFS_EVT(3)	/* Skip current event */
830Sstevel@tonic-gate #define	CT_ERELIABLE	CTFS_EVT(4)	/* Request reliable event receipt */
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #ifdef	__cplusplus
860Sstevel@tonic-gate }
870Sstevel@tonic-gate #endif
880Sstevel@tonic-gate 
890Sstevel@tonic-gate #endif	/* _SYS_CTFS_H */
90