include/rpc_misc.h

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003 
00004    Copyright (C) Andrew Tridgell                1992-1997
00005    Copyright (C) Luke Kenneth Casson Leighton   1996-1997
00006    Copyright (C) Paul Ashton                    1997
00007    Copyright (C) Gerald (Jerry) Carter          2005
00008    
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; either version 2 of the License, or
00012    (at your option) any later version.
00013    
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018    
00019    You should have received a copy of the GNU General Public License
00020    along with this program; if not, write to the Free Software
00021    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022 */
00023 
00024 #ifndef _RPC_MISC_H /* _RPC_MISC_H */
00025 #define _RPC_MISC_H 
00026 
00027 #define SMB_RPC_INTERFACE_VERSION 1
00028 #define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*)
00029 
00030 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 };
00031 
00032 
00033 
00034 /********************************************************************** 
00035  * well-known RIDs - Relative IDs
00036  **********************************************************************/
00037 
00038 /* RIDs - Well-known users ... */
00039 #define DOMAIN_USER_RID_ADMIN          (0x000001F4L)
00040 #define DOMAIN_USER_RID_GUEST          (0x000001F5L)
00041 #define DOMAIN_USER_RID_KRBTGT         (0x000001F6L)
00042 
00043 /* RIDs - well-known groups ... */
00044 #define DOMAIN_GROUP_RID_ADMINS        (0x00000200L)
00045 #define DOMAIN_GROUP_RID_USERS         (0x00000201L)
00046 #define DOMAIN_GROUP_RID_GUESTS        (0x00000202L)
00047 #define DOMAIN_GROUP_RID_COMPUTERS     (0x00000203L)
00048 
00049 #define DOMAIN_GROUP_RID_CONTROLLERS   (0x00000204L)
00050 #define DOMAIN_GROUP_RID_CERT_ADMINS   (0x00000205L)
00051 #define DOMAIN_GROUP_RID_SCHEMA_ADMINS (0x00000206L)
00052 #define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS (0x00000207L)
00053 
00054 /* is the following the right number? I bet it is  --simo
00055 #define DOMAIN_GROUP_RID_POLICY_ADMINS (0x00000208L)
00056 */
00057 
00058 /* RIDs - well-known aliases ... */
00059 #define BUILTIN_ALIAS_RID_ADMINS        (0x00000220L)
00060 #define BUILTIN_ALIAS_RID_USERS         (0x00000221L)
00061 #define BUILTIN_ALIAS_RID_GUESTS        (0x00000222L)
00062 #define BUILTIN_ALIAS_RID_POWER_USERS   (0x00000223L)
00063 
00064 #define BUILTIN_ALIAS_RID_ACCOUNT_OPS   (0x00000224L)
00065 #define BUILTIN_ALIAS_RID_SYSTEM_OPS    (0x00000225L)
00066 #define BUILTIN_ALIAS_RID_PRINT_OPS     (0x00000226L)
00067 #define BUILTIN_ALIAS_RID_BACKUP_OPS    (0x00000227L)
00068 
00069 #define BUILTIN_ALIAS_RID_REPLICATOR    (0x00000228L)
00070 #define BUILTIN_ALIAS_RID_RAS_SERVERS   (0x00000229L)
00071 #define BUILTIN_ALIAS_RID_PRE_2K_ACCESS (0x0000022aL)
00072 
00073 
00074 /********************************************************************** 
00075  * Masks for mappings between unix uid and gid types and
00076  * NT RIDS.
00077  **********************************************************************/
00078 
00079 #define BASE_RID (0x000003E8L)
00080 
00081 /* Take the bottom bit. */
00082 #define RID_TYPE_MASK           1
00083 #define RID_MULTIPLIER          2
00084 
00085 /* The two common types. */
00086 #define USER_RID_TYPE           0
00087 #define GROUP_RID_TYPE          1
00088 
00089 
00090 
00091 /********************************************************************** 
00092  * RPC policy handle used pretty much everywhere
00093  **********************************************************************/
00094  
00095 typedef struct policy_handle POLICY_HND;
00096 typedef struct {
00097         uint32 ptr_hnd;          /* pointer to enumeration handle */
00098         uint32 handle;           /* enumeration handle */
00099 } ENUM_HND;
00100 
00101 #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\
00102         ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \
00103                 "OTHER")), ((unsigned int)IVAL((hnd)->uuid.node,2)),\
00104                 ((unsigned int)sys_getpid() )
00105 
00106 
00107 /********************************************************************** 
00108  * Buffer Headers -- use by SEC_DESC_BUF in winreg and netlogon code
00109  **********************************************************************/
00110  
00111 /* TODO: replace this with an encompassing buffer structure */
00112 typedef struct {
00113         uint32 buf_max_len;
00114         uint32 buf_len;
00115 } BUFHDR;
00116 
00117 /* this is a BUFHDR + a pointer to a buffer */
00118 typedef struct {
00119         uint32 info_level;
00120         uint32 length;          /* uint8 chars */
00121         uint32 buffer;
00122 } BUFHDR2;
00123 
00124 /* generic buffer ?  wrapped around void*? */
00125 typedef struct {
00126         uint32 size;
00127         uint32 buffer;
00128 } BUFHDR4;
00129 
00130 
00131 /********************************************************************** 
00132  * Buffers 
00133  **********************************************************************/
00134 
00135 /* buffer used by \winreg\ calls to fill in arbitrary REG_XXX values.
00136    It *may* look like a UNISTR2 but it is *not*.  This is not a goof
00137    by the winreg developers.  It is a generic buffer.  buffer length
00138    is stored in bytes (not # of uint16's) */
00139 
00140 typedef struct {
00141         uint32 buf_max_len;
00142         uint32 offset;
00143         uint32 buf_len;
00144         uint16 *buffer;
00145 } REGVAL_BUFFER;
00146 
00147 /* generic rpc version of the DATA_BLOB.  Just a length and uint8 array */
00148 
00149 typedef struct {
00150         uint32 buf_len;
00151         uint8 *buffer;
00152 } RPC_DATA_BLOB;
00153 
00154 /********************************************************************** 
00155  * Buffers use by spoolss (i might be able to replace it with
00156  * an RPC_DATA_BLOB)
00157  **********************************************************************/
00158 
00159 typedef struct {
00160         uint32 buf_len;
00161         uint16 *buffer; /* data */
00162 } BUFFER5;
00163 
00164 
00165 /********************************************************************** 
00166  * Unicode and basic string headers 
00167  **********************************************************************/
00168  
00169 typedef struct {
00170         uint16 str_str_len;
00171         uint16 str_max_len;
00172         uint32 buffer; /* non-zero */
00173 } STRHDR;
00174 
00175 typedef struct {
00176         uint16 uni_str_len;
00177         uint16 uni_max_len;
00178         uint32 buffer; 
00179 } UNIHDR;
00180 
00181 /********************************************************************** 
00182  * UNICODE string variations
00183  **********************************************************************/
00184 
00185 
00186 typedef struct {                /* UNISTR - unicode string size and buffer */
00187         uint16 *buffer;         /* unicode characters. ***MUST*** be 
00188                                    little-endian. ***MUST*** be null-terminated */
00189 } UNISTR;
00190 
00191 typedef struct {                /* UNISTR2 - unicode string size (in 
00192                                    uint16 unicode chars) and buffer */
00193         uint32 uni_max_len;
00194         uint32 offset;
00195         uint32 uni_str_len;
00196         uint16 *buffer;         /* unicode characters. ***MUST*** be little-endian. 
00197                                   **must** be null-terminated and the uni_str_len 
00198                                   should include the NULL character */
00199 } UNISTR2;
00200 
00201 /* i think this is the same as a BUFFER5 used in the spoolss code --jerry */
00202 /* not sure about how the termination matches between the uint16 buffers thought */
00203 
00204 typedef struct {                /* UNISTR3 - XXXX not sure about this structure */
00205         uint32 uni_str_len;
00206         UNISTR str;
00207 } UNISTR3;
00208 
00209 typedef struct {                /* Buffer wrapped around a UNISTR2 */
00210         uint16 length;          /* number of bytes not counting NULL terminatation */
00211         uint16 size;            /* number of bytes including NULL terminatation */
00212         UNISTR2 *string;
00213 } UNISTR4;
00214 
00215 typedef struct {
00216         uint32 count;
00217         UNISTR4 *strings;
00218 } UNISTR4_ARRAY;
00219 
00220 
00221 /********************************************************************** 
00222  * String variations
00223  **********************************************************************/
00224 
00225 typedef struct {                /* STRING2 - string size (in uint8 chars) and buffer */
00226         uint32 str_max_len;
00227         uint32 offset;
00228         uint32 str_str_len;
00229         uint8  *buffer;         /* uint8 characters. **NOT** necessarily null-terminated */
00230 } STRING2;
00231 
00232 
00233 
00234 
00235 /********************************************************************** 
00236  * Domain SID structures
00237  **********************************************************************/
00238 
00239 typedef struct {
00240         uint32 num_auths; /* length, bytes, including length of len :-) */
00241         DOM_SID sid;
00242 } DOM_SID2;
00243 
00244 
00245 /********************************************************************** 
00246  * Domain SID structures
00247  **********************************************************************/
00248 
00249 /* DOM_RID - domain RID structure for ntlsa pipe */
00250 typedef struct {
00251         uint16 type; /* value is SID_NAME_USE enum */
00252         uint32 rid;
00253         uint32 rid_idx; /* referenced domain index */
00254 } DOM_RID;
00255 
00256 /* DOM_RID2 - second domain RID structure for ntlsa pipe */
00257 typedef struct {
00258         uint16 type; /* value is SID_NAME_USE enum */
00259         uint32 rid;
00260         uint32 rid_idx; /* referenced domain index */
00261         uint32 unknown;
00262 } DOM_RID2;
00263 
00264 typedef struct {                /* DOM_RID3 - domain RID structure for samr pipe */
00265         uint32 rid;        /* domain-relative (to a SID) id */
00266         uint32 type1;      /* value is 0x1 */
00267         uint32 ptr_type;   /* undocumented pointer */
00268         uint32 type2;      /* value is 0x1 */
00269         uint32 unk; /* value is 0x2 */
00270 } DOM_RID3;
00271 
00272 /* DOM_RID4 - rid + user attributes */
00273 typedef struct domrid4_info
00274 {
00275         uint32 unknown;
00276         uint16 attr;
00277         uint32 rid;  /* user RID */
00278 } DOM_RID4;
00279 
00280 /* DOM_GID - group id + user attributes */
00281 typedef struct {
00282         uint32 g_rid;  /* a group RID */
00283         uint32 attr;
00284 } DOM_GID;
00285 
00286 /********************************************************************** 
00287  * ????
00288  **********************************************************************/
00289 
00290 /* DOM_CLNT_SRV - client / server names */
00291 typedef struct clnt_srv_info {
00292         uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
00293         UNISTR2 uni_logon_srv; /* logon server name */
00294         uint32  undoc_buffer2; /* undocumented 32 bit buffer pointer */
00295         UNISTR2 uni_comp_name; /* client machine name */
00296 } DOM_CLNT_SRV;
00297 
00298 /* DOM_LOG_INFO - login info */
00299 typedef struct log_info {
00300         uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
00301         UNISTR2 uni_logon_srv; /* logon server name */
00302         UNISTR2 uni_acct_name; /* account name */
00303         uint16  sec_chan;      /* secure channel type */
00304         UNISTR2 uni_comp_name; /* client machine name */
00305 } DOM_LOG_INFO;
00306 
00307 /* DOM_CHAL - challenge info */
00308 typedef struct chal_info {
00309         unsigned char data[8]; /* credentials */
00310 } DOM_CHAL;
00311  
00312 /* DOM_CREDs - timestamped client or server credentials */
00313 typedef struct cred_info {
00314         DOM_CHAL challenge; /* credentials */
00315         UTIME timestamp;    /* credential time-stamp */
00316 } DOM_CRED;
00317 
00318 /* DOM_CLNT_INFO - client info */
00319 typedef struct clnt_info {
00320         DOM_LOG_INFO login;
00321         DOM_CRED     cred;
00322 } DOM_CLNT_INFO;
00323 
00324 /* DOM_CLNT_INFO2 - client info */
00325 typedef struct clnt_info2 {
00326         DOM_CLNT_SRV login;
00327         uint32        ptr_cred;
00328         DOM_CRED      cred;
00329 } DOM_CLNT_INFO2;
00330 
00331 /* DOM_LOGON_ID - logon id */
00332 typedef struct logon_info {
00333         uint32 low;
00334         uint32 high;
00335 } DOM_LOGON_ID;
00336 
00337 /* OWF INFO */
00338 typedef struct owf_info {
00339         uint8 data[16];
00340 } OWF_INFO;
00341 
00342 
00343 #endif /* _RPC_MISC_H */

Sambaに対してSat Aug 29 21:22:55 2009に生成されました。  doxygen 1.4.7