1998-03-11 21:11:04 +00:00
/*
2002-01-30 06:08:46 +00:00
Unix SMB / CIFS implementation .
2005-03-23 23:26:33 +00:00
2005-04-06 03:08:25 +00:00
Copyright ( C ) Andrew Tridgell 1992 - 1997
Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997
Copyright ( C ) Paul Ashton 1997
Copyright ( C ) Gerald ( Jerry ) Carter 2005
1998-03-11 21:11:04 +00:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-09 19:25:36 +00:00
the Free Software Foundation ; either version 3 of the License , or
1998-03-11 21:11:04 +00:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 00:52:41 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
1998-03-11 21:11:04 +00:00
*/
# ifndef _RPC_MISC_H /* _RPC_MISC_H */
# define _RPC_MISC_H
2003-04-28 17:48:48 +00:00
# define SMB_RPC_INTERFACE_VERSION 1
2007-10-18 17:40:25 -07:00
# define PRS_POINTER_CAST bool (*)(const char*, prs_struct*, int, void*)
2005-03-23 23:26:33 +00:00
2005-10-06 17:48:03 +00:00
enum unistr2_term_codes { UNI_FLAGS_NONE = 0 , UNI_STR_TERMINATE = 1 , UNI_MAXLEN_TERMINATE = 2 , UNI_BROKEN_NON_NULL = 3 , UNI_STR_DBLTERMINATE = 4 } ;
2005-04-06 03:08:25 +00:00
2005-03-23 23:26:33 +00:00
2005-04-06 03:08:25 +00:00
/**********************************************************************
* well - known RIDs - Relative IDs
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1998-03-11 21:11:04 +00:00
/* RIDs - Well-known users ... */
# define DOMAIN_USER_RID_ADMIN (0x000001F4L)
# define DOMAIN_USER_RID_GUEST (0x000001F5L)
2002-03-19 13:57:53 +00:00
# define DOMAIN_USER_RID_KRBTGT (0x000001F6L)
1998-03-11 21:11:04 +00:00
/* RIDs - well-known groups ... */
# define DOMAIN_GROUP_RID_ADMINS (0x00000200L)
# define DOMAIN_GROUP_RID_USERS (0x00000201L)
# define DOMAIN_GROUP_RID_GUESTS (0x00000202L)
2002-03-19 13:57:53 +00:00
# define DOMAIN_GROUP_RID_COMPUTERS (0x00000203L)
# define DOMAIN_GROUP_RID_CONTROLLERS (0x00000204L)
# define DOMAIN_GROUP_RID_CERT_ADMINS (0x00000205L)
# define DOMAIN_GROUP_RID_SCHEMA_ADMINS (0x00000206L)
# define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS (0x00000207L)
/* is the following the right number? I bet it is --simo
# define DOMAIN_GROUP_RID_POLICY_ADMINS (0x00000208L)
*/
1998-03-11 21:11:04 +00:00
/* RIDs - well-known aliases ... */
1998-06-09 02:26:26 +00:00
# define BUILTIN_ALIAS_RID_ADMINS (0x00000220L)
# define BUILTIN_ALIAS_RID_USERS (0x00000221L)
# define BUILTIN_ALIAS_RID_GUESTS (0x00000222L)
# define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L)
1999-12-13 13:27:58 +00:00
1998-06-09 02:26:26 +00:00
# define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L)
# define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L)
# define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L)
# define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L)
1999-12-13 13:27:58 +00:00
1998-06-09 02:26:26 +00:00
# define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L)
2002-03-19 13:57:53 +00:00
# define BUILTIN_ALIAS_RID_RAS_SERVERS (0x00000229L)
2003-12-22 21:48:06 +00:00
# define BUILTIN_ALIAS_RID_PRE_2K_ACCESS (0x0000022aL)
1998-03-11 21:11:04 +00:00
2005-04-06 03:08:25 +00:00
/**********************************************************************
1998-06-01 18:50:27 +00:00
* Masks for mappings between unix uid and gid types and
* NT RIDS .
2005-04-06 03:08:25 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2002-03-19 13:57:53 +00:00
# define BASE_RID (0x000003E8L)
1999-12-13 13:27:58 +00:00
/* Take the bottom bit. */
2005-04-06 03:08:25 +00:00
# define RID_TYPE_MASK 1
# define RID_MULTIPLIER 2
1999-04-08 05:35:53 +00:00
1999-12-13 13:27:58 +00:00
/* The two common types. */
2005-04-06 03:08:25 +00:00
# define USER_RID_TYPE 0
# define GROUP_RID_TYPE 1
1999-04-08 05:35:53 +00:00
2005-04-06 03:08:25 +00:00
/**********************************************************************
* RPC policy handle used pretty much everywhere
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2006-09-11 22:02:34 +00:00
typedef struct policy_handle POLICY_HND ;
1998-03-11 21:11:04 +00:00
2006-09-11 22:02:34 +00:00
# define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\
( IVAL ( ( hnd ) - > uuid . node , 2 ) = = ( uint32 ) sys_getpid ( ) ? " OURS " : \
" OTHER " ) ) , ( ( unsigned int ) IVAL ( ( hnd ) - > uuid . node , 2 ) ) , \
( ( unsigned int ) sys_getpid ( ) )
2005-04-06 03:08:25 +00:00
/**********************************************************************
2005-04-07 04:58:38 +00:00
* Buffers use by spoolss ( i might be able to replace it with
* an RPC_DATA_BLOB )
2005-04-06 03:08:25 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
typedef struct {
uint32 buf_len ;
2005-04-07 04:58:38 +00:00
uint16 * buffer ; /* data */
} BUFFER5 ;
2005-04-06 03:08:25 +00:00
/**********************************************************************
* UNICODE string variations
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
typedef struct { /* UNISTR - unicode string size and buffer */
uint16 * buffer ; /* unicode characters. ***MUST*** be
little - endian . * * * MUST * * * be null - terminated */
} UNISTR ;
typedef struct { /* UNISTR2 - unicode string size (in
uint16 unicode chars ) and buffer */
2003-09-22 22:08:53 +00:00
uint32 uni_max_len ;
2003-09-25 21:26:16 +00:00
uint32 offset ;
2003-09-22 22:08:53 +00:00
uint32 uni_str_len ;
2005-04-06 03:08:25 +00:00
uint16 * buffer ; /* unicode characters. ***MUST*** be little-endian.
* * must * * be null - terminated and the uni_str_len
should include the NULL character */
1998-03-11 21:11:04 +00:00
} UNISTR2 ;
2005-05-31 13:46:45 +00:00
/* i think this is the same as a BUFFER5 used in the spoolss code --jerry */
/* not sure about how the termination matches between the uint16 buffers thought */
2005-04-06 03:08:25 +00:00
typedef struct { /* UNISTR3 - XXXX not sure about this structure */
1998-11-10 19:05:00 +00:00
uint32 uni_str_len ;
UNISTR str ;
} UNISTR3 ;
1998-03-11 21:11:04 +00:00
# endif /* _RPC_MISC_H */