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