Changeset 740 for vendor/current/source3/include/ntdomain.h
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/ntdomain.h
r414 r740 24 24 #define _NT_DOMAIN_H 25 25 26 #include "librpc/rpc/dcerpc.h" 27 26 28 /* 27 29 * A bunch of stuff that was put into smb.h … … 29 31 */ 30 32 31 #define prs_init_empty( _ps_, _ctx_, _io_ ) (void) prs_init((_ps_), 0, (_ctx_), (_io_))32 33 typedef struct _prs_struct {34 bool io; /* parsing in or out of data stream */35 /*36 * If the (incoming) data is big-endian. On output we are37 * always little-endian.38 */39 bool bigendian_data;40 uint8 align; /* data alignment */41 bool is_dynamic; /* Do we own this memory or not ? */42 uint32 data_offset; /* Current working offset into data. */43 uint32 buffer_size; /* Current allocated size of the buffer. */44 uint32 grow_size; /* size requested via prs_grow() calls */45 char *data_p; /* The buffer itself. */46 TALLOC_CTX *mem_ctx; /* When unmarshalling, use this.... */47 const char *sess_key; /* If we have to do encrypt/decrypt on the fly. */48 } prs_struct;49 50 /*51 * Defines for io member of prs_struct.52 */53 54 #define MARSHALL 055 #define UNMARSHALL 156 57 #define MARSHALLING(ps) (!(ps)->io)58 #define UNMARSHALLING(ps) ((ps)->io)59 60 #define RPC_BIG_ENDIAN 161 #define RPC_LITTLE_ENDIAN 062 63 #define RPC_PARSE_ALIGN 464 65 33 typedef struct _output_data { 66 34 /* 67 35 * Raw RPC output data. This does not include RPC headers or footers. 68 36 */ 69 prs_structrdata;37 DATA_BLOB rdata; 70 38 71 39 /* The amount of data sent from the current rdata struct. */ … … 76 44 * headers, data and authentication footer. 77 45 */ 78 prs_structfrag;46 DATA_BLOB frag; 79 47 80 48 /* The amount of data sent from the current PDU. */ … … 88 56 * pdu is seen, then the data is copied into the in_data 89 57 * structure. The maximum size of this is 0x1630 (RPC_MAX_PDU_FRAG_LEN). 90 */ 91 uint8_t *current_in_pdu; 58 * If length is zero, then we are at the start of a new 59 * pdu. 60 */ 61 DATA_BLOB pdu; 92 62 93 63 /* … … 99 69 100 70 /* 101 * The amount of data received so far in the in_pdu.102 * If this is zero, then we are at the start of a new103 * pdu.104 */105 uint32 pdu_received_len;106 107 /*108 71 * This is the collection of input data with all 109 72 * the rpc headers and auth footers removed. 110 73 * The maximum length of this (1Mb) is strictly enforced. 111 74 */ 112 prs_struct data; 75 DATA_BLOB data; 76 113 77 } input_data; 114 78 … … 132 96 */ 133 97 134 enum pipe_auth_type { PIPE_AUTH_TYPE_NONE = 0, PIPE_AUTH_TYPE_NTLMSSP, PIPE_AUTH_TYPE_SCHANNEL, 135 PIPE_AUTH_TYPE_SPNEGO_NTLMSSP, PIPE_AUTH_TYPE_KRB5, PIPE_AUTH_TYPE_SPNEGO_KRB5 }; 136 137 /* auth state for krb5. */ 138 struct kerberos_auth_struct { 139 const char *service_principal; 140 DATA_BLOB session_key; 141 }; 142 143 /* auth state for schannel. */ 144 struct schannel_auth_struct { 145 unsigned char sess_key[16]; 146 uint32 seq_num; 147 }; 148 149 /* auth state for all bind types. */ 150 151 struct pipe_auth_data { 152 enum pipe_auth_type auth_type; /* switch for union below. */ 153 enum dcerpc_AuthLevel auth_level; 154 union { 155 struct schannel_state *schannel_auth; 156 AUTH_NTLMSSP_STATE *auth_ntlmssp_state; 157 /* struct kerberos_auth_struct *kerberos_auth; TO BE ADDED... */ 158 } a_u; 159 void (*auth_data_free_func)(struct pipe_auth_data *); 160 }; 98 struct gse_context; 99 100 struct dcesrv_ep_entry_list; 161 101 162 102 /* … … 165 105 */ 166 106 167 typedefstruct pipes_struct {107 struct pipes_struct { 168 108 struct pipes_struct *next, *prev; 169 109 170 char client_address[INET6_ADDRSTRLEN]; 171 172 struct auth_serversupplied_info *server_info; 110 struct client_address *client_id; 111 struct client_address *server_id; 112 113 enum dcerpc_transport_t transport; 114 115 struct auth_serversupplied_info *session_info; 116 struct messaging_context *msg_ctx; 173 117 174 118 struct ndr_syntax_id syntax; 119 struct dcesrv_ep_entry_list *ep_entries; 175 120 176 121 /* linked list of rpc dispatch tables associated … … 179 124 PIPE_RPC_FNS *contexts; 180 125 181 RPC_HDR hdr; /* Incoming RPC header. */182 RPC_HDR_REQ hdr_req; /* Incoming request header. */183 184 126 struct pipe_auth_data auth; 127 128 bool ncalrpc_as_system; 185 129 186 130 /* … … 233 177 struct handle_list *pipe_handles; 234 178 179 /* call id retrieved from the pdu header */ 180 uint32_t call_id; 181 182 /* operation number retrieved from the rpc header */ 183 uint16_t opnum; 184 235 185 /* private data for the interface implementation */ 236 186 void *private_data; 237 187 238 } pipes_struct;188 }; 239 189 240 190 struct api_struct { 241 191 const char *name; 242 192 uint8 opnum; 243 bool (*fn) ( pipes_struct *);193 bool (*fn) (struct pipes_struct *); 244 194 }; 245 195 196 /* The following definitions come from rpc_server/rpc_handles.c */ 197 198 size_t num_pipe_handles(struct pipes_struct *p); 199 bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax); 200 bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr); 201 bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd, 202 void **data_p); 203 bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd); 204 void close_policy_by_pipe(struct pipes_struct *p); 205 bool pipe_access_check(struct pipes_struct *p); 206 207 void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd, 208 uint32_t access_granted, size_t data_size, 209 const char *type, NTSTATUS *pstatus); 210 #define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \ 211 (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \ 212 (_pstatus)) 213 214 void *_policy_handle_find(struct pipes_struct *p, 215 const struct policy_handle *hnd, 216 uint32_t access_required, uint32_t *paccess_granted, 217 const char *name, const char *location, 218 NTSTATUS *pstatus); 219 #define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \ 220 (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \ 221 (_access_granted), #_type, __location__, (_pstatus)) 222 223 #include "rpc_server/srv_pipe_register.h" 224 246 225 #endif /* _NT_DOMAIN_H */
Note:
See TracChangeset
for help on using the changeset viewer.