Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/include/ntdomain.h

    r414 r740  
    2424#define _NT_DOMAIN_H
    2525
     26#include "librpc/rpc/dcerpc.h"
     27
    2628/*
    2729 * A bunch of stuff that was put into smb.h
     
    2931 */
    3032
    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 are
    37          * 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 0
    55 #define UNMARSHALL 1
    56 
    57 #define MARSHALLING(ps) (!(ps)->io)
    58 #define UNMARSHALLING(ps) ((ps)->io)
    59 
    60 #define RPC_BIG_ENDIAN          1
    61 #define RPC_LITTLE_ENDIAN       0
    62 
    63 #define RPC_PARSE_ALIGN 4
    64 
    6533typedef struct _output_data {
    6634        /*
    6735         * Raw RPC output data. This does not include RPC headers or footers.
    6836         */
    69         prs_struct rdata;
     37        DATA_BLOB rdata;
    7038
    7139        /* The amount of data sent from the current rdata struct. */
     
    7644         * headers, data and authentication footer.
    7745         */
    78         prs_struct frag;
     46        DATA_BLOB frag;
    7947
    8048        /* The amount of data sent from the current PDU. */
     
    8856         * pdu is seen, then the data is copied into the in_data
    8957         * 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;
    9262
    9363        /*
     
    9969
    10070        /*
    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 new
    103          * pdu.
    104          */
    105         uint32 pdu_received_len;
    106 
    107         /*
    10871         * This is the collection of input data with all
    10972         * the rpc headers and auth footers removed.
    11073         * The maximum length of this (1Mb) is strictly enforced.
    11174         */
    112         prs_struct data;
     75        DATA_BLOB data;
     76
    11377} input_data;
    11478
     
    13296 */
    13397
    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 };
     98struct gse_context;
     99
     100struct dcesrv_ep_entry_list;
    161101
    162102/*
     
    165105 */
    166106
    167 typedef struct pipes_struct {
     107struct pipes_struct {
    168108        struct pipes_struct *next, *prev;
    169109
    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;
    173117
    174118        struct ndr_syntax_id syntax;
     119        struct dcesrv_ep_entry_list *ep_entries;
    175120
    176121        /* linked list of rpc dispatch tables associated
     
    179124        PIPE_RPC_FNS *contexts;
    180125
    181         RPC_HDR hdr; /* Incoming RPC header. */
    182         RPC_HDR_REQ hdr_req; /* Incoming request header. */
    183 
    184126        struct pipe_auth_data auth;
     127
     128        bool ncalrpc_as_system;
    185129
    186130        /*
     
    233177        struct handle_list *pipe_handles;
    234178
     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
    235185        /* private data for the interface implementation */
    236186        void *private_data;
    237187
    238 } pipes_struct;
     188};
    239189
    240190struct api_struct { 
    241191        const char *name;
    242192        uint8 opnum;
    243         bool (*fn) (pipes_struct *);
     193        bool (*fn) (struct pipes_struct *);
    244194};
    245195
     196/* The following definitions come from rpc_server/rpc_handles.c  */
     197
     198size_t num_pipe_handles(struct pipes_struct *p);
     199bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax);
     200bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr);
     201bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd,
     202                        void **data_p);
     203bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
     204void close_policy_by_pipe(struct pipes_struct *p);
     205bool pipe_access_check(struct pipes_struct *p);
     206
     207void *_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
     214void *_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
    246225#endif /* _NT_DOMAIN_H */
Note: See TracChangeset for help on using the changeset viewer.