1*7836SJohn.Forte@Sun.COM /* 2*7836SJohn.Forte@Sun.COM * CDDL HEADER START 3*7836SJohn.Forte@Sun.COM * 4*7836SJohn.Forte@Sun.COM * The contents of this file are subject to the terms of the 5*7836SJohn.Forte@Sun.COM * Common Development and Distribution License (the "License"). 6*7836SJohn.Forte@Sun.COM * You may not use this file except in compliance with the License. 7*7836SJohn.Forte@Sun.COM * 8*7836SJohn.Forte@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*7836SJohn.Forte@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*7836SJohn.Forte@Sun.COM * See the License for the specific language governing permissions 11*7836SJohn.Forte@Sun.COM * and limitations under the License. 12*7836SJohn.Forte@Sun.COM * 13*7836SJohn.Forte@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*7836SJohn.Forte@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*7836SJohn.Forte@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*7836SJohn.Forte@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*7836SJohn.Forte@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*7836SJohn.Forte@Sun.COM * 19*7836SJohn.Forte@Sun.COM * CDDL HEADER END 20*7836SJohn.Forte@Sun.COM */ 21*7836SJohn.Forte@Sun.COM /* 22*7836SJohn.Forte@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23*7836SJohn.Forte@Sun.COM * Use is subject to license terms. 24*7836SJohn.Forte@Sun.COM */ 25*7836SJohn.Forte@Sun.COM 26*7836SJohn.Forte@Sun.COM #ifndef _NSCTL_H 27*7836SJohn.Forte@Sun.COM #define _NSCTL_H 28*7836SJohn.Forte@Sun.COM 29*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 30*7836SJohn.Forte@Sun.COM extern "C" { 31*7836SJohn.Forte@Sun.COM #endif 32*7836SJohn.Forte@Sun.COM 33*7836SJohn.Forte@Sun.COM #include <sys/nsctl/nsctl.h> 34*7836SJohn.Forte@Sun.COM 35*7836SJohn.Forte@Sun.COM 36*7836SJohn.Forte@Sun.COM /* 37*7836SJohn.Forte@Sun.COM * External file descriptor. 38*7836SJohn.Forte@Sun.COM */ 39*7836SJohn.Forte@Sun.COM 40*7836SJohn.Forte@Sun.COM #ifndef _LIBNSCTL_H 41*7836SJohn.Forte@Sun.COM #ifndef _KMEMUSER 42*7836SJohn.Forte@Sun.COM typedef struct nsc_fd_s { int x; } nsc_fd_t; 43*7836SJohn.Forte@Sun.COM #endif 44*7836SJohn.Forte@Sun.COM #endif 45*7836SJohn.Forte@Sun.COM 46*7836SJohn.Forte@Sun.COM 47*7836SJohn.Forte@Sun.COM /* 48*7836SJohn.Forte@Sun.COM * Runtime Solaris release checking. 49*7836SJohn.Forte@Sun.COM * 50*7836SJohn.Forte@Sun.COM * nsc_check_release() is called with the string build release 51*7836SJohn.Forte@Sun.COM * (BUILD_REV_STR) and an optional array of nsc_release_t. The array 52*7836SJohn.Forte@Sun.COM * defines a map of build release to acceptable runtime release for the 53*7836SJohn.Forte@Sun.COM * component. The build release is always an acceptable runtime 54*7836SJohn.Forte@Sun.COM * release and need not be included in the map. 55*7836SJohn.Forte@Sun.COM * 56*7836SJohn.Forte@Sun.COM * build - the build release (e.g. "5.7") 57*7836SJohn.Forte@Sun.COM * runtime - comma &/or space separated list of acceptable runtime 58*7836SJohn.Forte@Sun.COM * releases (e.g. "5.7, 5.8") 59*7836SJohn.Forte@Sun.COM */ 60*7836SJohn.Forte@Sun.COM 61*7836SJohn.Forte@Sun.COM typedef struct nsc_release { 62*7836SJohn.Forte@Sun.COM const char *build; /* build release */ 63*7836SJohn.Forte@Sun.COM const char *runtime; /* runtime release(s) */ 64*7836SJohn.Forte@Sun.COM } nsc_release_t; 65*7836SJohn.Forte@Sun.COM 66*7836SJohn.Forte@Sun.COM #ifdef __STDC__ 67*7836SJohn.Forte@Sun.COM extern void _nsc_nocheck(void); 68*7836SJohn.Forte@Sun.COM extern nsc_fd_t *nsc_open(char *, int, int); 69*7836SJohn.Forte@Sun.COM extern nsc_fd_t *nsc_fdopen(int, char *, int); 70*7836SJohn.Forte@Sun.COM extern int nsc_close(nsc_fd_t *); 71*7836SJohn.Forte@Sun.COM extern int nsc_fileno(nsc_fd_t *); 72*7836SJohn.Forte@Sun.COM extern int nsc_reserve(nsc_fd_t *); 73*7836SJohn.Forte@Sun.COM extern int nsc_release(nsc_fd_t *); 74*7836SJohn.Forte@Sun.COM extern int nsc_partsize(nsc_fd_t *, nsc_size_t *); 75*7836SJohn.Forte@Sun.COM extern int nsc_freeze(char *path); 76*7836SJohn.Forte@Sun.COM extern int nsc_unfreeze(char *path); 77*7836SJohn.Forte@Sun.COM extern int nsc_isfrozen(char *path); 78*7836SJohn.Forte@Sun.COM extern int nsc_getsystemid(int *id); 79*7836SJohn.Forte@Sun.COM extern int nsc_name_to_id(char *name, int *id); 80*7836SJohn.Forte@Sun.COM extern int nsc_id_to_name(char **name, int id); 81*7836SJohn.Forte@Sun.COM extern int nsc_check_release(const char *, nsc_release_t *, char **); 82*7836SJohn.Forte@Sun.COM #else 83*7836SJohn.Forte@Sun.COM extern void _nsc_nocheck(); 84*7836SJohn.Forte@Sun.COM extern nsc_fd_t *nsc_open(); 85*7836SJohn.Forte@Sun.COM extern nsc_fd_t *nsc_fdopen(); 86*7836SJohn.Forte@Sun.COM extern int nsc_close(); 87*7836SJohn.Forte@Sun.COM extern int nsc_fileno(); 88*7836SJohn.Forte@Sun.COM extern int nsc_reserve(); 89*7836SJohn.Forte@Sun.COM extern int nsc_release(); 90*7836SJohn.Forte@Sun.COM extern int nsc_partsize(); 91*7836SJohn.Forte@Sun.COM extern int nsc_freeze(); 92*7836SJohn.Forte@Sun.COM extern int nsc_unfreeze(); 93*7836SJohn.Forte@Sun.COM extern int nsc_isfrozen(); 94*7836SJohn.Forte@Sun.COM extern int nsc_getsystemid(); 95*7836SJohn.Forte@Sun.COM extern int nsc_name_to_id(); 96*7836SJohn.Forte@Sun.COM extern int nsc_id_to_name(); 97*7836SJohn.Forte@Sun.COM extern int nsc_check_release(); 98*7836SJohn.Forte@Sun.COM #endif 99*7836SJohn.Forte@Sun.COM 100*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 101*7836SJohn.Forte@Sun.COM } 102*7836SJohn.Forte@Sun.COM #endif 103*7836SJohn.Forte@Sun.COM 104*7836SJohn.Forte@Sun.COM #endif /* _NSCTL_H */ 105