fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
ba3594ba9b5dd4c846c472a8d657edcb7c8109acGarrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org>
ba3594ba9b5dd4c846c472a8d657edcb7c8109acGarrett D'Amore *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _NSCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/nsctl.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * External file descriptor.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _LIBNSCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _KMEMUSER
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct nsc_fd_s { int x; } nsc_fd_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Runtime Solaris release checking.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * nsc_check_release() is called with the string build release
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (BUILD_REV_STR) and an optional array of nsc_release_t. The array
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * defines a map of build release to acceptable runtime release for the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * component. The build release is always an acceptable runtime
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * release and need not be included in the map.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * build - the build release (e.g. "5.7")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * runtime - comma &/or space separated list of acceptable runtime
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * releases (e.g. "5.7, 5.8")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct nsc_release {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const char *build; /* build release */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const char *runtime; /* runtime release(s) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} nsc_release_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void _nsc_nocheck(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern nsc_fd_t *nsc_open(char *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern nsc_fd_t *nsc_fdopen(int, char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_close(nsc_fd_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_fileno(nsc_fd_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_reserve(nsc_fd_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_release(nsc_fd_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_partsize(nsc_fd_t *, nsc_size_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_freeze(char *path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_unfreeze(char *path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_isfrozen(char *path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_getsystemid(int *id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_name_to_id(char *name, int *id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_id_to_name(char **name, int id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nsc_check_release(const char *, nsc_release_t *, char **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _NSCTL_H */