17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*25e8c5aaSvikram * Common Development and Distribution License (the "License"). 6*25e8c5aaSvikram * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*25e8c5aaSvikram * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_CTFS_H 277c478bd9Sstevel@tonic-gate #define _SYS_CTFS_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #include <sys/contract.h> 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #ifdef __cplusplus 347c478bd9Sstevel@tonic-gate extern "C" { 357c478bd9Sstevel@tonic-gate #endif 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /* 387c478bd9Sstevel@tonic-gate * Location of the contract filesystem. 397c478bd9Sstevel@tonic-gate */ 407c478bd9Sstevel@tonic-gate #define CTFS_ROOT "/system/contract" 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate /* 437c478bd9Sstevel@tonic-gate * CTFS ioctl constants 447c478bd9Sstevel@tonic-gate */ 457c478bd9Sstevel@tonic-gate #define CTFS_PREFIX ('c' << 24 | 't' << 16) 467c478bd9Sstevel@tonic-gate #define CTFS_IOC(x, y) (CTFS_PREFIX | (x) << 8 | (y)) 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate /* 497c478bd9Sstevel@tonic-gate * Control codes for messages written to template files. 507c478bd9Sstevel@tonic-gate */ 517c478bd9Sstevel@tonic-gate #define CTFS_TMPL(x) CTFS_IOC('t', x) 527c478bd9Sstevel@tonic-gate #define CT_TACTIVATE CTFS_TMPL(0) /* Activate template */ 537c478bd9Sstevel@tonic-gate #define CT_TCLEAR CTFS_TMPL(1) /* Clear active template */ 547c478bd9Sstevel@tonic-gate #define CT_TCREATE CTFS_TMPL(2) /* Create contract from template */ 557c478bd9Sstevel@tonic-gate #define CT_TSET CTFS_TMPL(3) /* Set parameter */ 567c478bd9Sstevel@tonic-gate #define CT_TGET CTFS_TMPL(4) /* Get parameter */ 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate /* 597c478bd9Sstevel@tonic-gate * Control codes for messages written to ctl files. 607c478bd9Sstevel@tonic-gate */ 617c478bd9Sstevel@tonic-gate #define CTFS_CTL(x) CTFS_IOC('c', x) 627c478bd9Sstevel@tonic-gate #define CT_CABANDON CTFS_CTL(0) /* Abandon contract */ 637c478bd9Sstevel@tonic-gate #define CT_CACK CTFS_CTL(1) /* Ack a message */ 647c478bd9Sstevel@tonic-gate #define CT_CQREQ CTFS_CTL(2) /* Request an additional quantum */ 657c478bd9Sstevel@tonic-gate #define CT_CADOPT CTFS_CTL(3) /* Adopt a contract */ 667c478bd9Sstevel@tonic-gate #define CT_CNEWCT CTFS_CTL(4) /* Define new contract */ 67*25e8c5aaSvikram #define CT_CNACK CTFS_CTL(5) /* nack a negotiation */ 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate /* 707c478bd9Sstevel@tonic-gate * Control codes for messages written to status files. 717c478bd9Sstevel@tonic-gate */ 727c478bd9Sstevel@tonic-gate #define CTFS_STAT(x) CTFS_IOC('s', x) 737c478bd9Sstevel@tonic-gate #define CT_SSTATUS CTFS_STAT(0) /* Obtain contract status */ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate /* 767c478bd9Sstevel@tonic-gate * Control codes for messages written to event endpoints. 777c478bd9Sstevel@tonic-gate */ 787c478bd9Sstevel@tonic-gate #define CTFS_EVT(x) CTFS_IOC('e', x) 797c478bd9Sstevel@tonic-gate #define CT_ERESET CTFS_EVT(0) /* Reset event queue pointer */ 807c478bd9Sstevel@tonic-gate #define CT_ERECV CTFS_EVT(1) /* Read next event */ 817c478bd9Sstevel@tonic-gate #define CT_ECRECV CTFS_EVT(2) /* Read next critical event */ 827c478bd9Sstevel@tonic-gate #define CT_ENEXT CTFS_EVT(3) /* Skip current event */ 837c478bd9Sstevel@tonic-gate #define CT_ERELIABLE CTFS_EVT(4) /* Request reliable event receipt */ 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate #ifdef __cplusplus 867c478bd9Sstevel@tonic-gate } 877c478bd9Sstevel@tonic-gate #endif 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate #endif /* _SYS_CTFS_H */ 90