Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / samba / source / include / ntdomain.h
blob050bcd163b5738bd3143127414a25b3b35183d41
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
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.
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.
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.
24 #ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */
25 #define _NT_DOMAIN_H
28 /* dce/rpc support */
29 #include "rpc_dce.h"
31 /* miscellaneous structures / defines */
32 #include "rpc_misc.h"
34 /* security descriptor structures */
35 #include "rpc_secdes.h"
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_wkssvc.h"
45 /*
46 * A bunch of stuff that was put into smb.h
47 * in the NTDOM branch - it didn't belong there.
50 typedef struct _prs_struct
52 BOOL io; /* parsing in or out of data stream */
53 /*
54 * If the (incoming) data is big-endian. On output we are
55 * always little-endian.
56 */
57 BOOL bigendian_data;
58 uint8 align; /* data alignment */
59 BOOL is_dynamic; /* Do we own this memory or not ? */
60 uint32 data_offset; /* Current working offset into data. */
61 uint32 buffer_size; /* Current size of the buffer. */
62 char *data_p; /* The buffer itself. */
63 } prs_struct;
66 * Defines for io member of prs_struct.
69 #define MARSHALL 0
70 #define UNMARSHALL 1
72 #define MARSHALLING(ps) (!(ps)->io)
73 #define UNMARSHALLING(ps) ((ps)->io)
75 typedef struct _output_data {
76 /*
77 * Raw RPC output data. This does not include RPC headers or footers.
79 prs_struct rdata;
81 /* The amount of data sent from the current rdata struct. */
82 uint32 data_sent_length;
84 /*
85 * The current PDU being returned. This inclues
86 * headers, data and authentication footer.
88 unsigned char current_pdu[MAX_PDU_FRAG_LEN];
90 /* The amount of data in the current_pdu buffer. */
91 uint32 current_pdu_len;
93 /* The amount of data sent from the current PDU. */
94 uint32 current_pdu_sent;
95 } output_data;
97 typedef struct _input_data {
99 * This is the current incoming pdu. The data here
100 * is collected via multiple writes until a complete
101 * pdu is seen, then the data is copied into the in_data
102 * structure. The maximum size of this is 0x1630 (MAX_PDU_FRAG_LEN).
104 unsigned char current_in_pdu[MAX_PDU_FRAG_LEN];
107 * The amount of data needed to complete the in_pdu.
108 * If this is zero, then we are at the start of a new
109 * pdu.
111 uint32 pdu_needed_len;
114 * The amount of data received so far in the in_pdu.
115 * If this is zero, then we are at the start of a new
116 * pdu.
118 uint32 pdu_received_len;
121 * This is the collection of input data with all
122 * the rpc headers and auth footers removed.
123 * The maximum length of this (1Mb) is strictly enforced.
125 prs_struct data;
126 } input_data;
128 typedef struct pipes_struct
130 struct pipes_struct *next, *prev;
131 int pnum;
132 connection_struct *conn;
133 uint16 vuid;
134 BOOL open; /* open connection */
135 uint16 device_state;
136 uint16 priority;
137 fstring name;
138 fstring pipe_srv_name;
140 RPC_HDR hdr; /* Incoming RPC header. */
141 RPC_HDR_REQ hdr_req; /* Incoming request header. */
143 uint32 ntlmssp_chal_flags; /* Client challenge flags. */
144 BOOL ntlmssp_auth_requested; /* If the client wanted authenticated rpc. */
145 BOOL ntlmssp_auth_validated; /* If the client *got* authenticated rpc. */
146 unsigned char challenge[8];
147 unsigned char ntlmssp_hash[258];
148 uint32 ntlmssp_seq_num;
151 * Windows user info.
153 fstring user_name;
154 fstring domain;
155 fstring wks;
158 * Unix user name and credentials.
160 fstring unix_user_name;
161 uid_t uid;
162 gid_t gid;
165 * Set to true when an RPC bind has been done on this pipe.
168 BOOL pipe_bound;
171 * Set to true when we should return fault PDU's for everything.
174 BOOL fault_state;
177 * Struct to deal with multiple pdu inputs.
180 input_data in_data;
183 * Struct to deal with multiple pdu outputs.
186 output_data out_data;
188 /* When replying to an SMBtrans, this is the maximum amount of
189 data that can be sent in the initial reply. */
190 int max_trans_reply;
191 } pipes_struct;
193 struct api_struct
195 char *name;
196 uint8 opnum;
197 BOOL (*fn) (uint16 vuid, prs_struct*, prs_struct*);
200 typedef struct
202 uint32 rid;
203 char *name;
205 } rid_name;
207 struct acct_info
209 fstring acct_name; /* account name */
210 uint32 smb_userid; /* domain-relative RID */
213 #endif /* _NT_DOMAIN_H */