1*5331Samw /* 2*5331Samw * CDDL HEADER START 3*5331Samw * 4*5331Samw * The contents of this file are subject to the terms of the 5*5331Samw * Common Development and Distribution License (the "License"). 6*5331Samw * You may not use this file except in compliance with the License. 7*5331Samw * 8*5331Samw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*5331Samw * or http://www.opensolaris.org/os/licensing. 10*5331Samw * See the License for the specific language governing permissions 11*5331Samw * and limitations under the License. 12*5331Samw * 13*5331Samw * When distributing Covered Code, include this CDDL HEADER in each 14*5331Samw * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*5331Samw * If applicable, add the following below this CDDL HEADER, with the 16*5331Samw * fields enclosed by brackets "[]" replaced with your own identifying 17*5331Samw * information: Portions Copyright [yyyy] [name of copyright owner] 18*5331Samw * 19*5331Samw * CDDL HEADER END 20*5331Samw */ 21*5331Samw /* 22*5331Samw * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23*5331Samw * Use is subject to license terms. 24*5331Samw */ 25*5331Samw 26*5331Samw #ifndef _SMBSRV_SVRAPI_H 27*5331Samw #define _SMBSRV_SVRAPI_H 28*5331Samw 29*5331Samw #pragma ident "%Z%%M% %I% %E% SMI" 30*5331Samw 31*5331Samw /* 32*5331Samw * This file provides definitions for the SMB Net interface. On Windows 33*5331Samw * this would be NetAccess, NetConnection, NetFile, NetServer, 34*5331Samw * NetSession, NetShare and NetSecurity but here things are a limited. 35*5331Samw * This stuff should be described in Windows 9x LanMan documentation. 36*5331Samw * 37*5331Samw * Notes: 38*5331Samw * Lengths of ASCIIZ strings are given as the maximum strlen() value. 39*5331Samw * This does not include space for the terminating 0-byte. When 40*5331Samw * allocating space for such an item, use the form: 41*5331Samw * 42*5331Samw * char username[LM20_UNLEN+1]; 43*5331Samw * 44*5331Samw * An exception to this is PATHLEN, which does include space for the 45*5331Samw * terminating 0-byte. 46*5331Samw * 47*5331Samw * User names, computer names and share names should be upper-cased 48*5331Samw * by the caller and drawn from the ANSI character set. 49*5331Samw */ 50*5331Samw 51*5331Samw #ifdef __cplusplus 52*5331Samw extern "C" { 53*5331Samw #endif 54*5331Samw 55*5331Samw 56*5331Samw /* 57*5331Samw * Server Class (NetServerGetInfo, NetServerEnum2) 58*5331Samw */ 59*5331Samw 60*5331Samw struct server_info_0 { 61*5331Samw char sv0_name[CNLEN + 1]; /* Server name */ 62*5331Samw }; /* server_info_0 */ 63*5331Samw 64*5331Samw 65*5331Samw struct server_info_1 { 66*5331Samw char sv1_name[CNLEN + 1]; /* Server name */ 67*5331Samw unsigned char sv1_version_major; /* Major version # of net */ 68*5331Samw unsigned char sv1_version_minor; /* Minor version # of net */ 69*5331Samw uint32_t sv1_type; /* Server type */ 70*5331Samw char *sv1_comment; /* Exported server comment */ 71*5331Samw }; /* server_info_1 */ 72*5331Samw 73*5331Samw 74*5331Samw /* NOTE struct prefix must equal server_info_1 format */ 75*5331Samw 76*5331Samw struct server_info_50 { 77*5331Samw char sv50_name[CNLEN + 1]; 78*5331Samw unsigned char sv50_version_major; /* Major version # of net */ 79*5331Samw unsigned char sv50_version_minor; /* Minor version # of net */ 80*5331Samw uint32_t sv50_type; /* Server type */ 81*5331Samw char *sv50_comment; /* Exported server comment */ 82*5331Samw unsigned short sv50_security; /* SV_SECURITY_* (see below) */ 83*5331Samw unsigned short sv50_auditing; /* 0 = no auditing; !0 = auditing */ 84*5331Samw char *sv50_container; /* Security server/domain */ 85*5331Samw char *sv50_ab_server; /* Address book server */ 86*5331Samw char *sv50_ab_dll; /* Address book provider DLL */ 87*5331Samw }; /* server_info_50 */ 88*5331Samw 89*5331Samw 90*5331Samw struct server_info_2 { 91*5331Samw char sv2_name[CNLEN + 1]; 92*5331Samw unsigned char sv2_version_major; 93*5331Samw unsigned char sv2_version_minor; 94*5331Samw uint32_t sv2_type; 95*5331Samw char *sv2_comment; 96*5331Samw uint32_t sv2_ulist_mtime; /* User list, last modification time */ 97*5331Samw uint32_t sv2_glist_mtime; /* Group list, last modification time */ 98*5331Samw uint32_t sv2_alist_mtime; /* Access list, last modification time */ 99*5331Samw uint16_t sv2_users; /* max number of users allowed */ 100*5331Samw uint16_t sv2_disc; /* auto-disconnect timeout(in minutes) */ 101*5331Samw char *sv2_alerts; /* alert names (semicolon separated) */ 102*5331Samw uint16_t sv2_security; /* SV_USERSECURITY or SV_SHARESECURITY */ 103*5331Samw uint16_t sv2_auditing; /* 0 = no auditing; nonzero = auditing */ 104*5331Samw 105*5331Samw uint16_t sv2_numadmin; /* max number of administrators allowed */ 106*5331Samw uint16_t sv2_lanmask; /* bit mask representing the srv'd nets */ 107*5331Samw uint16_t sv2_hidden; /* 0 = visible; nonzero = hidden */ 108*5331Samw uint16_t sv2_announce; /* visible server announce rate (sec) */ 109*5331Samw uint16_t sv2_anndelta; /* announce randomize interval (sec) */ 110*5331Samw /* name of guest account */ 111*5331Samw char sv2_guestacct[LM20_UNLEN + 1]; 112*5331Samw unsigned char sv2_pad1; /* Word alignment pad byte */ 113*5331Samw char *sv2_userpath; /* ASCIIZ path to user directories */ 114*5331Samw uint16_t sv2_chdevs; /* max # shared character devices */ 115*5331Samw uint16_t sv2_chdevq; /* max # character device queues */ 116*5331Samw uint16_t sv2_chdevjobs; /* max # character device jobs */ 117*5331Samw uint16_t sv2_connections; /* max # of connections */ 118*5331Samw uint16_t sv2_shares; /* max # of shares */ 119*5331Samw uint16_t sv2_openfiles; /* max # of open files */ 120*5331Samw uint16_t sv2_sessopens; /* max # of open files per session */ 121*5331Samw uint16_t sv2_sessvcs; /* max # of virtual circuits per client */ 122*5331Samw uint16_t sv2_sessreqs; /* max # of simul. reqs. from a client */ 123*5331Samw uint16_t sv2_opensearch; /* max # of open searches */ 124*5331Samw uint16_t sv2_activelocks; /* max # of active file locks */ 125*5331Samw uint16_t sv2_numreqbuf; /* number of server (standard) buffers */ 126*5331Samw uint16_t sv2_sizreqbuf; /* size of svr (standard) bufs (bytes) */ 127*5331Samw uint16_t sv2_numbigbuf; /* number of big (64K) buffers */ 128*5331Samw uint16_t sv2_numfiletasks; /* number of file worker processes */ 129*5331Samw uint16_t sv2_alertsched; /* alert counting interval (minutes) */ 130*5331Samw uint16_t sv2_erroralert; /* error log alerting threshold */ 131*5331Samw uint16_t sv2_logonalert; /* logon violation alerting threshold */ 132*5331Samw uint16_t sv2_accessalert; /* access violation alerting threshold */ 133*5331Samw uint16_t sv2_diskalert; /* low disk space alert threshold (KB) */ 134*5331Samw uint16_t sv2_netioalert; /* net I/O error ratio alert threshold */ 135*5331Samw /* (tenths of a percent) */ 136*5331Samw uint16_t sv2_maxauditsz; /* Maximum audit file size (KB) */ 137*5331Samw char *sv2_srvheuristics; /* performance related server switches */ 138*5331Samw }; /* server_info_2 */ 139*5331Samw 140*5331Samw 141*5331Samw struct server_info_3 { 142*5331Samw char sv3_name[CNLEN + 1]; 143*5331Samw unsigned char sv3_version_major; 144*5331Samw unsigned char sv3_version_minor; 145*5331Samw uint32_t sv3_type; 146*5331Samw char *sv3_comment; 147*5331Samw uint32_t sv3_ulist_mtime; /* User list, last modification time */ 148*5331Samw uint32_t sv3_glist_mtime; /* Group list, last modification time */ 149*5331Samw uint32_t sv3_alist_mtime; /* Access list, last modification time */ 150*5331Samw uint16_t sv3_users; /* max number of users allowed */ 151*5331Samw uint16_t sv3_disc; /* auto-disconnect timeout(in minutes) */ 152*5331Samw char *sv3_alerts; /* alert names (semicolon separated) */ 153*5331Samw uint16_t sv3_security; /* SV_USERSECURITY or SV_SHARESECURITY */ 154*5331Samw uint16_t sv3_auditing; /* 0 = no auditing; nonzero = auditing */ 155*5331Samw 156*5331Samw uint16_t sv3_numadmin; /* max number of administrators allowed */ 157*5331Samw uint16_t sv3_lanmask; /* bit mask representing the srv'd nets */ 158*5331Samw uint16_t sv3_hidden; /* 0 = visible; nonzero = hidden */ 159*5331Samw uint16_t sv3_announce; /* visible server announce rate (sec) */ 160*5331Samw uint16_t sv3_anndelta; /* announce randomize interval (sec) */ 161*5331Samw /* name of guest account */ 162*5331Samw char sv3_guestacct[LM20_UNLEN + 1]; 163*5331Samw unsigned char sv3_pad1; /* Word alignment pad byte */ 164*5331Samw char *sv3_userpath; /* ASCIIZ path to user directories */ 165*5331Samw uint16_t sv3_chdevs; /* max # shared character devices */ 166*5331Samw uint16_t sv3_chdevq; /* max # character device queues */ 167*5331Samw uint16_t sv3_chdevjobs; /* max # character device jobs */ 168*5331Samw uint16_t sv3_connections; /* max # of connections */ 169*5331Samw uint16_t sv3_shares; /* max # of shares */ 170*5331Samw uint16_t sv3_openfiles; /* max # of open files */ 171*5331Samw uint16_t sv3_sessopens; /* max # of open files per session */ 172*5331Samw uint16_t sv3_sessvcs; /* max # of virtual circuits per client */ 173*5331Samw uint16_t sv3_sessreqs; /* max # of simul. reqs. from a client */ 174*5331Samw uint16_t sv3_opensearch; /* max # of open searches */ 175*5331Samw uint16_t sv3_activelocks; /* max # of active file locks */ 176*5331Samw uint16_t sv3_numreqbuf; /* number of server (standard) buffers */ 177*5331Samw uint16_t sv3_sizreqbuf; /* size of svr (standard) bufs (bytes) */ 178*5331Samw uint16_t sv3_numbigbuf; /* number of big (64K) buffers */ 179*5331Samw uint16_t sv3_numfiletasks; /* number of file worker processes */ 180*5331Samw uint16_t sv3_alertsched; /* alert counting interval (minutes) */ 181*5331Samw uint16_t sv3_erroralert; /* error log alerting threshold */ 182*5331Samw uint16_t sv3_logonalert; /* logon violation alerting threshold */ 183*5331Samw uint16_t sv3_accessalert; /* access violation alerting threshold */ 184*5331Samw uint16_t sv3_diskalert; /* low disk space alert threshold (KB) */ 185*5331Samw uint16_t sv3_netioalert; /* net I/O error ratio alert threshold */ 186*5331Samw /* (tenths of a percent) */ 187*5331Samw uint16_t sv3_maxauditsz; /* Maximum audit file size (KB) */ 188*5331Samw char *sv3_srvheuristics; /* performance related server switches */ 189*5331Samw uint32_t sv3_auditedevents; /* Audit event control mask */ 190*5331Samw uint16_t sv3_autoprofile; /* (0,1,2,3) = (NONE,LOAD,SAVE,or BOTH) */ 191*5331Samw char *sv3_autopath; /* file pathname (where to load & save) */ 192*5331Samw }; /* server_info_3 */ 193*5331Samw 194*5331Samw 195*5331Samw /* 196*5331Samw * Mask to be applied to svX_version_major in order to obtain 197*5331Samw * the major version number. 198*5331Samw */ 199*5331Samw #define MAJOR_VERSION_MASK 0x0F 200*5331Samw 201*5331Samw 202*5331Samw /* 203*5331Samw * Bit-mapped values for svX_type fields. X = 1, 2, 3 etc. 204*5331Samw * 205*5331Samw * SV_TYPE_WORKSTATION 0x00000001 All workstations 206*5331Samw * SV_TYPE_SERVER 0x00000002 All servers 207*5331Samw * SV_TYPE_SQLSERVER 0x00000004 Any server running with SQL 208*5331Samw * server 209*5331Samw * SV_TYPE_DOMAIN_CTRL 0x00000008 Primary domain controller 210*5331Samw * SV_TYPE_DOMAIN_BAKCTRL 0x00000010 Backup domain controller 211*5331Samw * SV_TYPE_TIME_SOURCE 0x00000020 Server running the timesource 212*5331Samw * service 213*5331Samw * SV_TYPE_AFP 0x00000040 Apple File Protocol servers 214*5331Samw * SV_TYPE_NOVELL 0x00000080 Novell servers 215*5331Samw * SV_TYPE_DOMAIN_MEMBER 0x00000100 Domain Member 216*5331Samw * SV_TYPE_PRINTQ_SERVER 0x00000200 Server sharing print queue 217*5331Samw * SV_TYPE_DIALIN_SERVER 0x00000400 Server running dialin service. 218*5331Samw * SV_TYPE_XENIX_SERVER 0x00000800 Xenix server 219*5331Samw * SV_TYPE_NT 0x00001000 NT server 220*5331Samw * SV_TYPE_WFW 0x00002000 Server running Windows for 221*5331Samw * Workgroups 222*5331Samw * SV_TYPE_SERVER_NT 0x00008000 Windows NT non DC server 223*5331Samw * SV_TYPE_POTENTIAL_BROWSER 0x00010000 Server that can run the browser 224*5331Samw * service 225*5331Samw * SV_TYPE_BACKUP_BROWSER 0x00020000 Backup browser server 226*5331Samw * SV_TYPE_MASTER_BROWSER 0x00040000 Master browser server 227*5331Samw * SV_TYPE_DOMAIN_MASTER 0x00080000 Domain Master Browser server 228*5331Samw * SV_TYPE_LOCAL_LIST_ONLY 0x40000000 Enumerate only entries marked 229*5331Samw * "local" 230*5331Samw * SV_TYPE_DOMAIN_ENUM 0x80000000 Enumerate Domains. The pszDomain 231*5331Samw * parameter must be NULL. 232*5331Samw */ 233*5331Samw #define SV_TYPE_WORKSTATION 0x00000001 234*5331Samw #define SV_TYPE_SERVER 0x00000002 235*5331Samw #define SV_TYPE_SQLSERVER 0x00000004 236*5331Samw #define SV_TYPE_DOMAIN_CTRL 0x00000008 237*5331Samw #define SV_TYPE_DOMAIN_BAKCTRL 0x00000010 238*5331Samw #define SV_TYPE_TIME_SOURCE 0x00000020 239*5331Samw #define SV_TYPE_AFP 0x00000040 240*5331Samw /* Also set by Win95 NWSERVER */ 241*5331Samw #define SV_TYPE_NOVELL 0x00000080 242*5331Samw #define SV_TYPE_DOMAIN_MEMBER 0x00000100 243*5331Samw #define SV_TYPE_PRINTQ_SERVER 0x00000200 244*5331Samw #define SV_TYPE_DIALIN_SERVER 0x00000400 245*5331Samw #define SV_TYPE_XENIX_SERVER 0x00000800 246*5331Samw #define SV_TYPE_NT 0x00001000 247*5331Samw #define SV_TYPE_WFW 0x00002000 248*5331Samw #define SV_TYPE_SERVER_NT 0x00008000 249*5331Samw #define SV_TYPE_POTENTIAL_BROWSER 0x00010000 250*5331Samw #define SV_TYPE_BACKUP_BROWSER 0x00020000 251*5331Samw #define SV_TYPE_MASTER_BROWSER 0x00040000 252*5331Samw #define SV_TYPE_DOMAIN_MASTER 0x00080000 253*5331Samw #define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 254*5331Samw #define SV_TYPE_DOMAIN_ENUM 0x80000000 255*5331Samw /* Handy for NetServerEnum2 */ 256*5331Samw #define SV_TYPE_ALL 0xFFFFFFFF 257*5331Samw 258*5331Samw 259*5331Samw #ifdef __cplusplus 260*5331Samw } 261*5331Samw #endif 262*5331Samw 263*5331Samw #endif /* _SMBSRV_SVRAPI_H */ 264