14bff34e3Sthurlow /* 24bff34e3Sthurlow * CDDL HEADER START 34bff34e3Sthurlow * 44bff34e3Sthurlow * The contents of this file are subject to the terms of the 54bff34e3Sthurlow * Common Development and Distribution License (the "License"). 64bff34e3Sthurlow * You may not use this file except in compliance with the License. 74bff34e3Sthurlow * 84bff34e3Sthurlow * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 94bff34e3Sthurlow * or http://www.opensolaris.org/os/licensing. 104bff34e3Sthurlow * See the License for the specific language governing permissions 114bff34e3Sthurlow * and limitations under the License. 124bff34e3Sthurlow * 134bff34e3Sthurlow * When distributing Covered Code, include this CDDL HEADER in each 144bff34e3Sthurlow * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 154bff34e3Sthurlow * If applicable, add the following below this CDDL HEADER, with the 164bff34e3Sthurlow * fields enclosed by brackets "[]" replaced with your own identifying 174bff34e3Sthurlow * information: Portions Copyright [yyyy] [name of copyright owner] 184bff34e3Sthurlow * 194bff34e3Sthurlow * CDDL HEADER END 204bff34e3Sthurlow */ 214bff34e3Sthurlow 224bff34e3Sthurlow /* 234bff34e3Sthurlow * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 244bff34e3Sthurlow * Use is subject to license terms. 254bff34e3Sthurlow */ 264bff34e3Sthurlow 274bff34e3Sthurlow /* 284bff34e3Sthurlow * basic API declarations for share management 294bff34e3Sthurlow */ 304bff34e3Sthurlow 314bff34e3Sthurlow #ifndef _LIBSHARE_SMBFS_H 324bff34e3Sthurlow #define _LIBSHARE_SMBFS_H 334bff34e3Sthurlow 344bff34e3Sthurlow #ifdef __cplusplus 354bff34e3Sthurlow extern "C" { 364bff34e3Sthurlow #endif 374bff34e3Sthurlow 384bff34e3Sthurlow struct smbclnt_proto_option_defs { 394bff34e3Sthurlow char *name; /* display name -- remove protocol identifier */ 404bff34e3Sthurlow char *value; 414bff34e3Sthurlow int index; 424bff34e3Sthurlow int flags; 434bff34e3Sthurlow int32_t minval; 444bff34e3Sthurlow int32_t maxval; /* In case of length of string this should be max */ 454bff34e3Sthurlow int (*validator)(int, char *, char *); 464bff34e3Sthurlow }; 474bff34e3Sthurlow 484bff34e3Sthurlow extern struct smbclnt_proto_option_defs smbclnt_proto_options[]; 494bff34e3Sthurlow 504bff34e3Sthurlow #define PROTO_OPT_SECTION 0 514bff34e3Sthurlow #define PROTO_OPT_ADDR 1 524bff34e3Sthurlow #define PROTO_OPT_MINAUTH 2 534bff34e3Sthurlow #define PROTO_OPT_NBNS_BROADCAST 3 544bff34e3Sthurlow #define PROTO_OPT_NBNS_ENABLE 4 554bff34e3Sthurlow #define PROTO_OPT_NBNSADDR 5 564bff34e3Sthurlow #define PROTO_OPT_PASSWORD 6 574bff34e3Sthurlow #define PROTO_OPT_TIMEOUT 7 584bff34e3Sthurlow #define PROTO_OPT_USER 8 594bff34e3Sthurlow #define PROTO_OPT_DOMAIN 9 604bff34e3Sthurlow #define PROTO_OPT_WORKGROUP 10 61*9c9af259SGordon Ross #define PROTO_OPT_SIGNING 11 624bff34e3Sthurlow 63*9c9af259SGordon Ross #define SMBC_OPT_MAX PROTO_OPT_SIGNING 644bff34e3Sthurlow 654bff34e3Sthurlow /* 664bff34e3Sthurlow * Flags values 674bff34e3Sthurlow */ 684bff34e3Sthurlow #define SMBC_MODIFIED 0x01 694bff34e3Sthurlow 704bff34e3Sthurlow /* Max value length of all SMB properties */ 714bff34e3Sthurlow #define MAX_VALUE_BUFLEN 600 724bff34e3Sthurlow 734bff34e3Sthurlow /* 744bff34e3Sthurlow * SMF access 754bff34e3Sthurlow */ 764bff34e3Sthurlow 774bff34e3Sthurlow #define SMBC_FMRI_PREFIX "network/smb/client" 784bff34e3Sthurlow #define SMBC_DEFAULT_INSTANCE_FMRI "svc:/network/smb/client:default" 794bff34e3Sthurlow #define SMBC_PG_PREFIX "S-" 804bff34e3Sthurlow #define SMBC_PG_PREFIX_LEN 2 814bff34e3Sthurlow #define SMBC_PG_INSTANCE "default" 824bff34e3Sthurlow 834bff34e3Sthurlow #define SMBC_SMF_OK 0 844bff34e3Sthurlow #define SMBC_SMF_NO_MEMORY 1 /* no memory for data structures */ 854bff34e3Sthurlow #define SMBC_SMF_SYSTEM_ERR 2 /* system error, use errno */ 864bff34e3Sthurlow #define SMBC_SMF_NO_PERMISSION 3 /* no permission for operation */ 874bff34e3Sthurlow 884bff34e3Sthurlow #define SCH_STATE_UNINIT 0 894bff34e3Sthurlow #define SCH_STATE_INITIALIZING 1 904bff34e3Sthurlow #define SCH_STATE_INIT 2 914bff34e3Sthurlow 924bff34e3Sthurlow typedef struct smb_scfhandle { 934bff34e3Sthurlow scf_handle_t *scf_handle; 944bff34e3Sthurlow int scf_state; 954bff34e3Sthurlow scf_service_t *scf_service; 964bff34e3Sthurlow scf_scope_t *scf_scope; 974bff34e3Sthurlow scf_transaction_t *scf_trans; 984bff34e3Sthurlow scf_transaction_entry_t *scf_entry; 994bff34e3Sthurlow scf_propertygroup_t *scf_pg; 1004bff34e3Sthurlow scf_instance_t *scf_instance; 1014bff34e3Sthurlow scf_iter_t *scf_inst_iter; 1024bff34e3Sthurlow scf_iter_t *scf_pg_iter; 1034bff34e3Sthurlow } smb_scfhandle_t; 1044bff34e3Sthurlow 1054bff34e3Sthurlow extern void smb_smf_scf_fini(smb_scfhandle_t *); 1064bff34e3Sthurlow extern smb_scfhandle_t *smb_smf_scf_init(char *); 1074bff34e3Sthurlow extern int smb_smf_get_instance(smb_scfhandle_t *, char *); 1084bff34e3Sthurlow extern int smb_smf_create_instance(smb_scfhandle_t *, char *); 1094bff34e3Sthurlow extern int smb_smf_start_transaction(smb_scfhandle_t *); 1104bff34e3Sthurlow extern int smb_smf_end_transaction(smb_scfhandle_t *); 1114bff34e3Sthurlow 1124bff34e3Sthurlow extern int smb_smf_set_string_property(smb_scfhandle_t *, char *, char *); 1134bff34e3Sthurlow extern int smb_smf_get_string_property(smb_scfhandle_t *, char *, 1144bff34e3Sthurlow char *, size_t); 1154bff34e3Sthurlow extern int smb_smf_set_integer_property(smb_scfhandle_t *, char *, int64_t); 1164bff34e3Sthurlow extern int smb_smf_get_integer_property(smb_scfhandle_t *, char *, int64_t *); 1174bff34e3Sthurlow extern int smb_smf_set_boolean_property(smb_scfhandle_t *, char *, uint8_t); 1184bff34e3Sthurlow extern int smb_smf_get_boolean_property(smb_scfhandle_t *, char *, uint8_t *); 1194bff34e3Sthurlow extern int smb_smf_set_opaque_property(smb_scfhandle_t *, char *, 1204bff34e3Sthurlow void *, size_t); 1214bff34e3Sthurlow extern int smb_smf_get_opaque_property(smb_scfhandle_t *, char *, 1224bff34e3Sthurlow void *, size_t); 1234bff34e3Sthurlow 1244bff34e3Sthurlow extern int smb_smf_create_service_pgroup(smb_scfhandle_t *, char *); 1254bff34e3Sthurlow extern int smb_smf_delete_service_pgroup(smb_scfhandle_t *, char *); 1264bff34e3Sthurlow extern int smb_smf_create_instance_pgroup(smb_scfhandle_t *, char *); 1274bff34e3Sthurlow extern int smb_smf_delete_instance_pgroup(smb_scfhandle_t *, char *); 1284bff34e3Sthurlow extern int smb_smf_delete_property(smb_scfhandle_t *, char *); 1294bff34e3Sthurlow extern int smb_smf_instance_exists(smb_scfhandle_t *, char *); 1304bff34e3Sthurlow extern int smb_smf_instance_create(smb_scfhandle_t *, char *, char *); 1314bff34e3Sthurlow extern int smb_smf_instance_delete(smb_scfhandle_t *, char *); 1324bff34e3Sthurlow extern smb_scfhandle_t *smb_smf_get_iterator(char *); 1334bff34e3Sthurlow 1344bff34e3Sthurlow #ifdef __cplusplus 1354bff34e3Sthurlow } 1364bff34e3Sthurlow #endif 1374bff34e3Sthurlow 1384bff34e3Sthurlow #endif /* _LIBSHARE_SMBFS_H */ 139