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