1dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States /* 2dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * CDDL HEADER START 3dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * 4dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * The contents of this file are subject to the terms of the 5dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * Common Development and Distribution License (the "License"). 6dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * You may not use this file except in compliance with the License. 7dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * 8dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * or http://www.opensolaris.org/os/licensing. 10dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * See the License for the specific language governing permissions 11dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * and limitations under the License. 12dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * 13dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * When distributing Covered Code, include this CDDL HEADER in each 14dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * If applicable, add the following below this CDDL HEADER, with the 16dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * fields enclosed by brackets "[]" replaced with your own identifying 17dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * information: Portions Copyright [yyyy] [name of copyright owner] 18dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * 19dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * CDDL HEADER END 20dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States */ 21dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States /* 22dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 23dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States */ 24dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 25dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #ifndef _SMFCFG_H 26dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define _SMFCFG_H 27dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 28dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <stdio.h> 29dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <stdlib.h> 30dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <syslog.h> 31dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <stdarg.h> 32dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <rpc/rpc.h> 33dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <synch.h> 34dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <thread.h> 35dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <libintl.h> 36dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <strings.h> 37dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <inttypes.h> 38dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <limits.h> 39dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <assert.h> 40dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <libscf.h> 41dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <libshare.h> 42dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <locale.h> 43dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <errno.h> 44dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #include <sys/types.h> 45dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 46dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #ifdef __cplusplus 47dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern "C" { 48dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #endif 49dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 50dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States typedef enum { 51dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States NFS_SMF = 1, 52dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States AUTOFS_SMF 53dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States } smf_fstype_t; 54dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 55dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States typedef struct fs_smfhandle { 56dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_handle_t *fs_handle; 57dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_service_t *fs_service; 58dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_scope_t *fs_scope; 59dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_instance_t *fs_instance; 60dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_propertygroup_t *fs_pg; 61dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_property_t *fs_property; 62dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States scf_value_t *fs_value; 63dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States } fs_smfhandle_t; 64dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 65dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define DEFAULT_INSTANCE "default" 66dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 67dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States /* 68dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * NFS Property Group names. 69dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States */ 70dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SMF_PG_NFSPROPS ((const char *)"com.oracle.nfs,props") 71dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define NFS_PROPS_PGNAME ((const char *)"nfs-props") 72dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SVC_NFS_CLIENT "svc:/network/nfs/client" 73dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 74dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States /* 75dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * AUTOFS Property Group Names. 76dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States */ 77dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SMF_PG_AUTOFS ((const char *)"com.oracle.autofs,props") 78dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define AUTOFS_PROPS_PGNAME ((const char *)"autofs-props") 79dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 80dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define AUTOFS_FMRI "svc:/system/filesystem/autofs" 81dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define AUTOFS_DEFAULT_FMRI "svc:/system/filesystem/autofs:default" 82dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define MAXDIGITS 32 83dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 84dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States /* 85dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States * ERRORS 86dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States */ 87dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SMF_OK 0 88dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SMF_SYSTEM_ERR -1 89dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define STATE_INITIALIZING 1 90dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SMF_NO_PERMISSION 2 91dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #define SMF_NO_PGTYPE 3 92dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 93*bbaa8b60SDan Kruchinin extern int nfs_smf_get_iprop(char *, int *, char *, scf_type_t, char *); 94dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern int nfs_smf_get_prop(char *, char *, char *, scf_type_t, char *, int *); 95dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern int fs_smf_get_prop(smf_fstype_t, char *, char *, char *, scf_type_t, 96dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States char *, int *); 97dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern int nfs_smf_set_prop(char *, char *, char *, scf_type_t, char *); 98dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern int fs_smf_set_prop(smf_fstype_t, char *, char *, 99dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States char *, scf_type_t, char *); 100dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern int autofs_smf_set_prop(char *, char *, char *, scf_type_t, char *); 101dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern int autofs_smf_get_prop(char *, char *, char *, scf_type_t, 102dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States char *, int *); 103dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern void fs_smf_fini(fs_smfhandle_t *); 104dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States extern boolean_t string_to_boolean(const char *); 105dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 106dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #ifdef __cplusplus 107dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States } 108dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #endif 109dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States 110dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States #endif /* _SMFCFG_H */ 111