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_CONTRACT_H 270Sstevel@tonic-gate #define _SYS_CONTRACT_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #include <sys/types.h> 320Sstevel@tonic-gate 330Sstevel@tonic-gate #ifdef __cplusplus 340Sstevel@tonic-gate extern "C" { 350Sstevel@tonic-gate #endif 360Sstevel@tonic-gate 370Sstevel@tonic-gate typedef uint64_t ctevid_t; 380Sstevel@tonic-gate 390Sstevel@tonic-gate /* 400Sstevel@tonic-gate * Common event types 410Sstevel@tonic-gate */ 420Sstevel@tonic-gate #define CT_EV_NEGEND 0 430Sstevel@tonic-gate 440Sstevel@tonic-gate /* 450Sstevel@tonic-gate * Level of status detail requested 460Sstevel@tonic-gate */ 470Sstevel@tonic-gate #define CTD_COMMON 0 /* No additional detail */ 480Sstevel@tonic-gate #define CTD_FIXED 1 /* O(1) info */ 490Sstevel@tonic-gate #define CTD_ALL 2 /* O(n) info */ 500Sstevel@tonic-gate 510Sstevel@tonic-gate /* 520Sstevel@tonic-gate * Values for ctev_flags. 530Sstevel@tonic-gate */ 540Sstevel@tonic-gate #define CTE_ACK 0x1 550Sstevel@tonic-gate #define CTE_INFO 0x2 560Sstevel@tonic-gate #define CTE_NEG 0x4 570Sstevel@tonic-gate 580Sstevel@tonic-gate #define CTP_EV_CRITICAL 100 590Sstevel@tonic-gate #define CTP_EV_INFO 101 600Sstevel@tonic-gate #define CTP_COOKIE 102 610Sstevel@tonic-gate 620Sstevel@tonic-gate #define CTS_NEWCT "cts_newct" 630Sstevel@tonic-gate #define CTS_NEVID "cts_nevid" 640Sstevel@tonic-gate 650Sstevel@tonic-gate typedef enum ctstate { 660Sstevel@tonic-gate CTS_OWNED, /* contract is owned by a process */ 670Sstevel@tonic-gate CTS_INHERITED, /* contract has been inherited by its parent */ 680Sstevel@tonic-gate CTS_ORPHAN, /* contract has no parent */ 690Sstevel@tonic-gate CTS_DEAD /* contract has been destroyed */ 700Sstevel@tonic-gate } ctstate_t; 710Sstevel@tonic-gate 720Sstevel@tonic-gate typedef enum ct_typeid { 730Sstevel@tonic-gate CTT_PROCESS, /* process contract */ 74*4845Svikram CTT_DEVICE, /* device contract */ 750Sstevel@tonic-gate CTT_MAXTYPE 760Sstevel@tonic-gate } ct_typeid_t; 770Sstevel@tonic-gate 780Sstevel@tonic-gate typedef struct ct_event { 790Sstevel@tonic-gate ctid_t ctev_id; 800Sstevel@tonic-gate uint32_t ctev_pad1; 810Sstevel@tonic-gate ctevid_t ctev_evid; 820Sstevel@tonic-gate ct_typeid_t ctev_cttype; 830Sstevel@tonic-gate uint32_t ctev_flags; 840Sstevel@tonic-gate uint32_t ctev_type; 850Sstevel@tonic-gate uint32_t ctev_nbytes; 860Sstevel@tonic-gate uint32_t ctev_goffset; 870Sstevel@tonic-gate uint32_t ctev_pad2; 880Sstevel@tonic-gate char *ctev_buffer; 890Sstevel@tonic-gate } ct_event_t; 900Sstevel@tonic-gate 910Sstevel@tonic-gate typedef struct ct_status { 920Sstevel@tonic-gate ctid_t ctst_id; 930Sstevel@tonic-gate zoneid_t ctst_zoneid; 940Sstevel@tonic-gate ct_typeid_t ctst_type; 950Sstevel@tonic-gate pid_t ctst_holder; 960Sstevel@tonic-gate ctstate_t ctst_state; 970Sstevel@tonic-gate int ctst_nevents; 980Sstevel@tonic-gate int ctst_ntime; 990Sstevel@tonic-gate int ctst_qtime; 1000Sstevel@tonic-gate uint64_t ctst_nevid; 1010Sstevel@tonic-gate uint_t ctst_detail; 1020Sstevel@tonic-gate size_t ctst_nbytes; 1030Sstevel@tonic-gate uint_t ctst_critical; 1040Sstevel@tonic-gate uint_t ctst_informative; 1050Sstevel@tonic-gate uint64_t ctst_cookie; 1060Sstevel@tonic-gate char *ctst_buffer; 1070Sstevel@tonic-gate } ct_status_t; 1080Sstevel@tonic-gate 1090Sstevel@tonic-gate typedef struct ct_param { 1100Sstevel@tonic-gate uint32_t ctpm_id; 1110Sstevel@tonic-gate uint32_t ctpm_pad; 1120Sstevel@tonic-gate uint64_t ctpm_value; 1130Sstevel@tonic-gate } ct_param_t; 1140Sstevel@tonic-gate 1150Sstevel@tonic-gate #ifdef __cplusplus 1160Sstevel@tonic-gate } 1170Sstevel@tonic-gate #endif 1180Sstevel@tonic-gate 1190Sstevel@tonic-gate #endif /* _SYS_CONTRACT_H */ 120