multiple dce/rpc PDUs failed to work after ntlmssp update was added.
[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 /* security descriptor structures */
35 #include "rpc_secdes.h" 
36
37 /* different dce/rpc pipes */
38 #include "rpc_lsa.h"
39 #include "rpc_netlogon.h"
40 #include "rpc_reg.h"
41 #include "rpc_samr.h"
42 #include "rpc_srvsvc.h"
43 #include "rpc_svcctl.h"
44 #include "rpc_wkssvc.h"
45
46 /* 
47  * A bunch of stuff that was put into smb.h
48  * in the NTDOM branch - it didn't belong there.
49  */
50  
51 typedef struct
52 {
53         struct mem_buf *data; /* memory buffer */
54         uint32 offset; /* offset currently being accessed in memory buffer */
55         uint8 align; /* data alignment */
56         BOOL io; /* parsing in or out of data stream */
57
58 } prs_struct;
59
60 typedef struct pipes_struct
61 {
62         struct pipes_struct *next, *prev;
63         int pnum;
64         connection_struct *conn;
65         uint16 vuid;
66         BOOL open; /* open connection */
67         uint16 device_state;
68         uint16 priority;
69         fstring name;
70         fstring pipe_srv_name;
71
72         prs_struct rhdr; /* output header */
73         prs_struct rdata; /* output data */
74         prs_struct rdata_i; /* output data (intermediate, for fragments) */
75         prs_struct rauth; /* output authentication verifier */
76         prs_struct rverf; /* output verifier */
77         prs_struct rntlm; /* output ntlmssp */
78
79         RPC_HDR     hdr;
80         RPC_HDR_BA  hdr_ba;
81         RPC_HDR_RB  hdr_rb;
82         RPC_HDR_REQ  hdr_req;
83         RPC_HDR_RESP hdr_resp;
84         RPC_HDR_AUTH  auth_info;
85         RPC_HDR_AUTHA autha_info;
86
87         RPC_AUTH_VERIFIER     auth_verifier;
88         RPC_AUTH_NTLMSSP_NEG  ntlmssp_neg;
89         RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal;
90         RPC_AUTH_NTLMSSP_RESP ntlmssp_resp;
91         RPC_AUTH_NTLMSSP_CHK  ntlmssp_chk;
92
93         BOOL ntlmssp_auth;
94         BOOL ntlmssp_validated;
95         unsigned char ntlmssp_hash[258];
96         uint32 ntlmssp_seq_num;
97         fstring user_name;
98         fstring domain;
99         fstring wks;
100
101         uint32 file_offset;
102         uint32 prev_pdu_file_offset;
103         uint32 hdr_offsets;
104         uint32 next_frag_start;
105
106 } pipes_struct;
107
108 struct api_struct
109 {  
110   char *name;
111   uint8 opnum;
112   void (*fn) (uint16 vuid, prs_struct*, prs_struct*);
113 };
114
115 struct mem_desc
116 {  
117         /* array memory offsets */
118         uint32 start; 
119         uint32 end;
120 };
121    
122 struct mem_buf
123 {  
124         BOOL dynamic; /* True iff data has been dynamically allocated
125                                          (and therefore can be freed) */
126         char *data;
127         uint32 data_size;
128         uint32 data_used;
129
130         uint32 margin; /* safety margin when reallocing. */
131                                    /* this can be abused quite nicely */
132         uint8 align;   /* alignment of data structures (smb, dce/rpc, udp etc) */
133
134         struct mem_desc offset;
135
136         struct mem_buf *next;
137 };
138
139 typedef struct
140 {  
141         uint32 rid;
142         char *name;
143
144 } rid_name;
145
146 struct acct_info
147 {
148     fstring acct_name; /* account name */
149     fstring acct_desc; /* account description */
150     uint32  rid; /* domain-relative RID */
151 };
152
153 #endif /* _NT_DOMAIN_H */
154