some quite important bug-fixes i missed because i transferred the wrong
[tprouty/samba.git] / source / include / ntdomain.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    Copyright (C) Paul Ashton 1997
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */
25 #define _NT_DOMAIN_H 
26
27
28 /* dce/rpc support */
29 #include "rpc_dce.h"
30
31 /* miscellaneous structures / defines */
32 #include "rpc_misc.h"
33
34 /* different dce/rpc pipes */
35 #include "rpc_lsa.h"
36 #include "rpc_netlogon.h"
37 #include "rpc_reg.h"
38 #include "rpc_samr.h"
39 #include "rpc_srvsvc.h"
40 #include "rpc_wkssvc.h"
41
42 /* 
43  * A bunch of stuff that was put into smb.h
44  * in the NTDOM branch - it didn't belong there.
45  */
46  
47 typedef struct
48 {
49         struct mem_buf *data; /* memory buffer */
50         uint32 offset; /* offset currently being accessed in memory buffer */
51         uint8 align; /* data alignment */
52         BOOL io; /* parsing in or out of data stream */
53
54 } prs_struct;
55
56 typedef struct pipes_struct
57 {
58         struct pipes_struct *next, *prev;
59         int pnum;
60         connection_struct *conn;
61         uint16 vuid;
62         BOOL open; /* open connection */
63         uint16 device_state;
64         uint16 priority;
65         fstring name;
66         fstring pipe_srv_name;
67
68         prs_struct rhdr; /* output header */
69         prs_struct rdata; /* output data */
70         prs_struct rdata_i; /* output data (intermediate, for fragments) */
71         prs_struct rauth; /* output authentication verifier */
72         prs_struct rverf; /* output verifier */
73         prs_struct rntlm; /* output ntlmssp */
74
75         RPC_HDR     hdr;
76         RPC_HDR_BA  hdr_ba;
77         RPC_HDR_RB  hdr_rb;
78         RPC_HDR_REQ  hdr_req;
79         RPC_HDR_RESP hdr_resp;
80         RPC_HDR_AUTH  auth_info;
81         RPC_HDR_AUTHA autha_info;
82
83         RPC_AUTH_VERIFIER     auth_verifier;
84         RPC_AUTH_NTLMSSP_NEG  ntlmssp_neg;
85         RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal;
86         RPC_AUTH_NTLMSSP_RESP ntlmssp_resp;
87         RPC_AUTH_NTLMSSP_CHK  ntlmssp_chk;
88
89         BOOL ntlmssp_auth;
90         BOOL ntlmssp_validated;
91         unsigned char ntlmssp_hash[258];
92         uint32 ntlmssp_seq_num;
93         fstring user_name;
94         fstring domain;
95         fstring wks;
96
97         uint32 file_offset;
98         uint32 hdr_offsets;
99         uint32 frag_len_left;
100         uint32 next_frag_start;
101
102 } pipes_struct;
103
104 struct api_struct
105 {  
106   char *name;
107   uint8 opnum;
108   void (*fn) (uint16 vuid, prs_struct*, prs_struct*);
109 };
110
111 struct mem_desc
112 {  
113         /* array memory offsets */
114         uint32 start; 
115         uint32 end;
116 };
117    
118 struct mem_buf
119 {  
120         BOOL dynamic; /* True iff data has been dynamically allocated
121                                          (and therefore can be freed) */
122         char *data;
123         uint32 data_size;
124         uint32 data_used;
125
126         uint32 margin; /* safety margin when reallocing. */
127                                    /* this can be abused quite nicely */
128         uint8 align;   /* alignment of data structures (smb, dce/rpc, udp etc) */
129
130         struct mem_desc offset;
131
132         struct mem_buf *next;
133 };
134
135 typedef struct
136 {  
137         uint32 rid;
138         char *name;
139
140 } rid_name;
141
142 struct acct_info
143 {
144     fstring acct_name; /* account name */
145     uint32 smb_userid; /* domain-relative RID */
146 };
147
148 #endif /* _NT_DOMAIN_H */
149