19acbbeafSnn35248 /* 29acbbeafSnn35248 * CDDL HEADER START 39acbbeafSnn35248 * 49acbbeafSnn35248 * The contents of this file are subject to the terms of the 59acbbeafSnn35248 * Common Development and Distribution License (the "License"). 69acbbeafSnn35248 * You may not use this file except in compliance with the License. 79acbbeafSnn35248 * 89acbbeafSnn35248 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 99acbbeafSnn35248 * or http://www.opensolaris.org/os/licensing. 109acbbeafSnn35248 * See the License for the specific language governing permissions 119acbbeafSnn35248 * and limitations under the License. 129acbbeafSnn35248 * 139acbbeafSnn35248 * When distributing Covered Code, include this CDDL HEADER in each 149acbbeafSnn35248 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 159acbbeafSnn35248 * If applicable, add the following below this CDDL HEADER, with the 169acbbeafSnn35248 * fields enclosed by brackets "[]" replaced with your own identifying 179acbbeafSnn35248 * information: Portions Copyright [yyyy] [name of copyright owner] 189acbbeafSnn35248 * 199acbbeafSnn35248 * CDDL HEADER END 209acbbeafSnn35248 */ 219acbbeafSnn35248 229acbbeafSnn35248 /* 23a20ee416SGlenn Faden * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 24*bafd1f14SJerry Jelinek * Copyright (c) 2011, Joyent, Inc. All rights reserved. 253c7284bdSAlexander Eremin * Copyright 2014 Nexenta Systems, Inc. All rights reserved. 269acbbeafSnn35248 */ 279acbbeafSnn35248 289acbbeafSnn35248 #ifndef _LIBBRAND_H 299acbbeafSnn35248 #define _LIBBRAND_H 309acbbeafSnn35248 319acbbeafSnn35248 #ifdef __cplusplus 329acbbeafSnn35248 extern "C" { 339acbbeafSnn35248 #endif 349acbbeafSnn35248 359acbbeafSnn35248 #include <sys/types.h> 369acbbeafSnn35248 37123807fbSedp typedef struct __brand_handle *brand_handle_t; 389acbbeafSnn35248 39bf1d7e28Sdh155122 typedef struct priv_iter_s { 40bf1d7e28Sdh155122 char *pi_name; 41bf1d7e28Sdh155122 char *pi_set; 42bf1d7e28Sdh155122 char *pi_iptype; 43bf1d7e28Sdh155122 } priv_iter_t; 44bf1d7e28Sdh155122 45123807fbSedp extern brand_handle_t brand_open(const char *); 46123807fbSedp extern void brand_close(brand_handle_t); 479acbbeafSnn35248 48f4b3ec61Sdh155122 extern boolean_t brand_allow_exclusive_ip(brand_handle_t); 49f4b3ec61Sdh155122 50ff17c8bfSgjelinek extern int brand_get_attach(brand_handle_t, const char *, const char *, 51ff17c8bfSgjelinek char *, size_t); 52123807fbSedp extern int brand_get_boot(brand_handle_t, const char *, const char *, 53ff17c8bfSgjelinek char *, size_t); 54123807fbSedp extern int brand_get_brandname(brand_handle_t, char *, size_t); 55ff17c8bfSgjelinek extern int brand_get_clone(brand_handle_t, const char *, const char *, 56ff17c8bfSgjelinek char *, size_t); 57ff17c8bfSgjelinek extern int brand_get_detach(brand_handle_t, const char *, const char *, 58ff17c8bfSgjelinek char *, size_t); 593c7284bdSAlexander Eremin extern int brand_get_shutdown(brand_handle_t, const char *, const char *, 603c7284bdSAlexander Eremin char *, size_t); 61123807fbSedp extern int brand_get_halt(brand_handle_t, const char *, const char *, 62ff17c8bfSgjelinek char *, size_t); 63123807fbSedp extern int brand_get_initname(brand_handle_t, char *, size_t); 64*bafd1f14SJerry Jelinek extern boolean_t brand_restartinit(brand_handle_t); 65123807fbSedp extern int brand_get_install(brand_handle_t, const char *, const char *, 66ff17c8bfSgjelinek char *, size_t); 67123807fbSedp extern int brand_get_installopts(brand_handle_t, char *, size_t); 68123807fbSedp extern int brand_get_login_cmd(brand_handle_t, const char *, char *, size_t); 69cb8a054bSGlenn Faden extern int brand_get_forcedlogin_cmd(brand_handle_t, const char *, 70cb8a054bSGlenn Faden char *, size_t); 71123807fbSedp extern int brand_get_modname(brand_handle_t, char *, size_t); 7237774979Sgjelinek extern int brand_get_postattach(brand_handle_t, const char *, const char *, 73ff17c8bfSgjelinek char *, size_t); 74123807fbSedp extern int brand_get_postclone(brand_handle_t, const char *, const char *, 75ff17c8bfSgjelinek char *, size_t); 7637774979Sgjelinek extern int brand_get_postinstall(brand_handle_t, const char *, const char *, 77ff17c8bfSgjelinek char *, size_t); 78ff17c8bfSgjelinek extern int brand_get_postsnap(brand_handle_t, const char *, const char *, 79ff17c8bfSgjelinek char *, size_t); 80c5cd6260S extern int brand_get_poststatechange(brand_handle_t, const char *, const char *, 81c5cd6260S char *, size_t); 8237774979Sgjelinek extern int brand_get_predetach(brand_handle_t, const char *, const char *, 83ff17c8bfSgjelinek char *, size_t); 84ff17c8bfSgjelinek extern int brand_get_presnap(brand_handle_t, const char *, const char *, 85ff17c8bfSgjelinek char *, size_t); 86c5cd6260S extern int brand_get_prestatechange(brand_handle_t, const char *, const char *, 87c5cd6260S char *, size_t); 8837774979Sgjelinek extern int brand_get_preuninstall(brand_handle_t, const char *, const char *, 89ff17c8bfSgjelinek char *, size_t); 90c5cd6260S extern int brand_get_query(brand_handle_t, const char *, const char *, 91c5cd6260S char *, size_t); 92ff17c8bfSgjelinek extern int brand_get_uninstall(brand_handle_t, const char *, const char *, 93ff17c8bfSgjelinek char *, size_t); 94ff17c8bfSgjelinek extern int brand_get_validatesnap(brand_handle_t, const char *, const char *, 95ff17c8bfSgjelinek char *, size_t); 96858a4b99Ssl108498 extern int brand_get_user_cmd(brand_handle_t, const char *, char *, size_t); 97123807fbSedp extern int brand_get_verify_cfg(brand_handle_t, char *, size_t); 98123807fbSedp extern int brand_get_verify_adm(brand_handle_t, const char *, const char *, 99ff17c8bfSgjelinek char *, size_t); 100fbbfbc6eSjv227347 extern int brand_get_sysboot(brand_handle_t, const char *, const char *, char *, 101fbbfbc6eSjv227347 size_t); 1029acbbeafSnn35248 103123807fbSedp extern int brand_config_iter_privilege(brand_handle_t, 104bf1d7e28Sdh155122 int (*func)(void *, priv_iter_t *), void *); 1059acbbeafSnn35248 106123807fbSedp extern int brand_platform_iter_devices(brand_handle_t, const char *, 107f4b3ec61Sdh155122 int (*)(void *, const char *, const char *), void *, const char *); 108123807fbSedp extern int brand_platform_iter_gmounts(brand_handle_t, const char *, 1099acbbeafSnn35248 int (*)(void *, const char *, const char *, const char *, const char *), 1109acbbeafSnn35248 void *); 111123807fbSedp extern int brand_platform_iter_link(brand_handle_t, int (*)(void *, 1129acbbeafSnn35248 const char *, const char *), void *); 113123807fbSedp extern int brand_platform_iter_mounts(brand_handle_t, int (*)(void *, 1149acbbeafSnn35248 const char *, const char *, const char *, const char *), void *); 1159acbbeafSnn35248 1169acbbeafSnn35248 #ifdef __cplusplus 1179acbbeafSnn35248 } 1189acbbeafSnn35248 #endif 1199acbbeafSnn35248 1209acbbeafSnn35248 #endif /* _LIBBRAND_H */ 121