s3:proto.h: remove duplicate prototypes.
[metze/samba/wip.git] / source3 / include / proto.h
index 2a7547334cc9396b8bf8e796daee9d84c1ef33b5..af5181eca6be533a20e27e5fa7a2bdb009a9e4a0 100644 (file)
@@ -801,7 +801,7 @@ bool set_remote_machine_name(const char *remote_name, bool perm);
 const char *get_remote_machine_name(void);
 void sub_set_smb_name(const char *name);
 void set_current_user_info(const char *smb_name, const char *unix_name,
-                          const char *full_name, const char *domain);
+                          const char *domain);
 const char *get_current_username(void);
 void standard_sub_basic(const char *smb_name, const char *domain_name,
                        char *str, size_t len);
@@ -1190,6 +1190,7 @@ char *lib_path(const char *name);
 char *modules_path(const char *name);
 char *data_path(const char *name);
 char *state_path(const char *name);
+char *cache_path(const char *name);
 const char *shlib_ext(void);
 bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
                    const char **name);
@@ -1673,8 +1674,6 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
                         int num_rids, uint32 *rids,
                         const char **domain_name,
                         const char ***names, enum lsa_SidType **types);
-bool winbind_allocate_uid(uid_t *uid);
-bool winbind_allocate_gid(gid_t *gid);
 
 /* The following definitions come from lib/wins_srv.c  */
 
@@ -2292,7 +2291,8 @@ _PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
                                            struct ndr_syntax_id *syntax);
 const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
 enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot);
-_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower);
+_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower);
+_PUBLIC_ const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t);
 _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, 
                                   struct epm_tower *tower, 
                                   struct dcerpc_binding **b_out);
@@ -2381,7 +2381,10 @@ struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
                                const char *server,
                                const char *share,
                                bool show_hdr,
-                               bool force_encrypt);
+                               bool force_encrypt,
+                               int max_protocol,
+                               int port,
+                               int name_type);
 void cli_cm_shutdown(void);
 void cli_cm_display(void);
 void cli_cm_set_credentials(struct user_auth_info *auth_info);
@@ -2432,7 +2435,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx,
 
 int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
 unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
-int cli_set_port(struct cli_state *cli, int port);
+void cli_set_port(struct cli_state *cli, int port);
 bool cli_receive_smb(struct cli_state *cli);
 ssize_t cli_receive_smb_data(struct cli_state *cli, char *buffer, size_t len);
 bool cli_receive_smb_readX_header(struct cli_state *cli);
@@ -2457,6 +2460,7 @@ struct async_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                                DATA_BLOB data);
 NTSTATUS cli_echo_recv(struct async_req *req);
 NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
+bool cli_ucs2(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clierror.c  */
 
@@ -2495,7 +2499,8 @@ int cli_nt_create_full(struct cli_state *cli, const char *fname,
                 uint32 CreateDisposition, uint32 CreateOptions,
                 uint8 SecuityFlags);
 int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess);
-uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str);
+uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
+                           size_t strlen, size_t *pconverted_size);
 struct async_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                                struct cli_state *cli,
                                const char *fname, int flags, int share_mode);
@@ -2628,12 +2633,6 @@ void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, voi
 
 /* The following definitions come from libsmb/clirap.c  */
 
-bool cli_api_pipe(struct cli_state *cli, const char *pipe_name,
-                  uint16 *setup, uint32 setup_count, uint32 max_setup_count,
-                  char *params, uint32 param_count, uint32 max_param_count,
-                  char *data, uint32 data_count, uint32 max_data_count,
-                  char **rparam, uint32 *rparam_count,
-                  char **rdata, uint32 *rdata_count);
 bool cli_api(struct cli_state *cli,
             char *param, int prcnt, int mprcnt,
             char *data, int drcnt, int mdrcnt,
@@ -2826,7 +2825,7 @@ size_t clistr_push_fn(const char *function,
                        int flags);
 size_t clistr_pull_fn(const char *function,
                        unsigned int line,
-                       struct cli_state *cli,
+                       const char *inbuf,
                        char *dest,
                        const void *src,
                        int dest_len,
@@ -2835,7 +2834,7 @@ size_t clistr_pull_fn(const char *function,
 size_t clistr_pull_talloc_fn(const char *function,
                                unsigned int line,
                                TALLOC_CTX *ctx,
-                               struct cli_state *cli,
+                               const char *inbuf,
                                char **pp_dest,
                                const void *src,
                                int src_len,
@@ -2945,7 +2944,6 @@ NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor);
 /* The following definitions come from libsmb/namecache.c  */
 
 bool namecache_enable(void);
-bool namecache_shutdown(void);
 bool namecache_store(const char *name,
                        int name_type,
                        int num_names,
@@ -3877,6 +3875,8 @@ char *lp_addprinter_cmd(void);
 char *lp_deleteprinter_cmd(void);
 char *lp_os2_driver_map(void);
 char *lp_lockdir(void);
+char *lp_statedir(void);
+char *lp_cachedir(void);
 char *lp_piddir(void);
 char *lp_mangling_method(void);
 int lp_mangle_prefix(void);
@@ -4721,7 +4721,6 @@ bool parse_lpq_entry(enum printing_types printing_type,char *line,
 /* The following definitions come from printing/notify.c  */
 
 int print_queue_snum(const char *qname);
-bool print_notify_messages_pending(void);
 void print_notify_send_messages(struct messaging_context *msg_ctx,
                                unsigned int timeout);
 void notify_printer_status_byname(const char *sharename, uint32 status);
@@ -4744,7 +4743,6 @@ void notify_printer_printername(int snum, char *printername);
 void notify_printer_port(int snum, char *port_name);
 void notify_printer_location(int snum, char *location);
 void notify_printer_byname( const char *printername, uint32 change, const char *value );
-bool print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t *p_num_pids, pid_t **pp_pid_list);
 
 /* The following definitions come from printing/nt_printing.c  */
 
@@ -5196,16 +5194,27 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
 
 /* The following definitions come from rpc_client/cli_pipe.c  */
 
-NTSTATUS rpc_api_pipe_req(struct rpc_pipe_client *cli,
+struct async_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
+                                       struct event_context *ev,
+                                       struct rpc_pipe_client *cli,
+                                       uint8_t op_num,
+                                       prs_struct *req_data);
+NTSTATUS rpc_api_pipe_req_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+                              prs_struct *reply_pdu);
+NTSTATUS rpc_api_pipe_req(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli,
                        uint8 op_num,
                        prs_struct *in_data,
                        prs_struct *out_data);
+struct async_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
+                                    struct event_context *ev,
+                                    struct rpc_pipe_client *cli,
+                                    struct cli_pipe_auth_data *auth);
+NTSTATUS rpc_pipe_bind_recv(struct async_req *req);
 NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                       struct cli_pipe_auth_data *auth);
 unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
                                unsigned int timeout);
 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
-struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
 NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
                               struct cli_pipe_auth_data **presult);
 NTSTATUS rpccli_ntlmssp_bind_data(TALLOC_CTX *mem_ctx,
@@ -5231,6 +5240,10 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
 NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
                               const struct ndr_syntax_id *abstract_syntax,
                               struct rpc_pipe_client **presult);
+NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, 
+                               NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r),
+                               struct auth_serversupplied_info *serversupplied_info,
+                               struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
                                  const struct ndr_syntax_id *interface,
                                  struct rpc_pipe_client **presult);
@@ -5281,6 +5294,17 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
                             struct rpc_pipe_client *cli,
                             DATA_BLOB *session_key);
 
+/* The following definitions come from rpc_client/rpc_transport_np.c  */
+
+NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli,
+                              const struct ndr_syntax_id *abstract_syntax,
+                              struct rpc_cli_transport **presult);
+struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
+
+/* The following definitions come from rpc_client/rpc_transport_sock.c  */
+
+NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd,
+                                struct rpc_cli_transport **presult);
 
 /* The following definitions come from rpc_client/cli_reg.c  */
 
@@ -5564,7 +5588,7 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
 
 /* The following definitions come from rpc_parse/parse_buffer.c  */
 
-void rpcbuf_init(RPC_BUFFER *buffer, uint32 size, TALLOC_CTX *ctx);
+bool rpcbuf_init(RPC_BUFFER *buffer, uint32 size, TALLOC_CTX *ctx);
 bool prs_rpcbuffer(const char *desc, prs_struct *ps, int depth, RPC_BUFFER *buffer);
 bool prs_rpcbuffer_p(const char *desc, prs_struct *ps, int depth, RPC_BUFFER **buffer);
 bool rpcbuf_alloc_size(RPC_BUFFER *buffer, uint32 buffer_size);
@@ -5754,7 +5778,6 @@ bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
 /* The following definitions come from rpc_parse/parse_rpc.c  */
 
 const char *cli_get_pipe_name_from_iface(TALLOC_CTX *mem_ctx,
-                                        struct cli_state *cli,
                                         const struct ndr_syntax_id *interface);
 void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
                                uint32 call_id, int data_len, int auth_len);
@@ -6193,6 +6216,10 @@ NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
                                    const char *srv,
                                    const struct ndr_syntax_id *interface,
                                    const struct api_struct *cmds, int size);
+NTSTATUS rpc_srv_register(int version, const char *clnt,
+                         const char *srv,
+                         const struct ndr_interface_table *iface,
+                         const struct api_struct *cmds, int size);
 bool is_known_pipename(const char *cli_filename);
 bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p);
 bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p);
@@ -6206,14 +6233,15 @@ bool api_pipe_request(pipes_struct *p);
 
 pipes_struct *get_first_internal_pipe(void);
 pipes_struct *get_next_internal_pipe(pipes_struct *p);
-void init_rpc_pipe_hnd(void);
 
 bool fsp_is_np(struct files_struct *fsp);
-NTSTATUS np_open(struct smb_request *smb_req, const char *name,
-                struct files_struct **pfsp);
-NTSTATUS np_write(struct files_struct *fsp, const uint8_t *data, size_t len,
-                 ssize_t *nwritten);
-NTSTATUS np_read(struct files_struct *fsp, uint8_t *data, size_t len,
+NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
+                const char *client_address,
+                struct auth_serversupplied_info *server_info,
+                struct fake_file_handle **phandle);
+NTSTATUS np_write(struct fake_file_handle *handle, const uint8_t *data,
+                 size_t len, ssize_t *nwritten);
+NTSTATUS np_read(struct fake_file_handle *handle, uint8_t *data, size_t len,
                 ssize_t *nread, bool *is_data_outstanding);
 
 /* The following definitions come from rpc_server/srv_samr_util.c  */
@@ -6447,8 +6475,6 @@ REGVAL_CTR *svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *token );
 
 /* The following definitions come from smbd/aio.c  */
 
-void aio_request_done(uint16_t mid);
-bool aio_finished(void);
 void initialize_async_io_handler(void);
 bool schedule_aio_read_and_X(connection_struct *conn,
                             struct smb_request *req,
@@ -6459,23 +6485,9 @@ bool schedule_aio_write_and_X(connection_struct *conn,
                              files_struct *fsp, char *data,
                              SMB_OFF_T startpos,
                              size_t numtowrite);
-int process_aio_queue(void);
 int wait_for_aio_completion(files_struct *fsp);
 void cancel_aio_by_fsp(files_struct *fsp);
-bool aio_finished(void);
-void initialize_async_io_handler(void);
-int process_aio_queue(void);
-bool schedule_aio_read_and_X(connection_struct *conn,
-                            struct smb_request *req,
-                            files_struct *fsp, SMB_OFF_T startpos,
-                            size_t smb_maxcnt);
-bool schedule_aio_write_and_X(connection_struct *conn,
-                             struct smb_request *req,
-                             files_struct *fsp, char *data,
-                             SMB_OFF_T startpos,
-                             size_t numtowrite);
-void cancel_aio_by_fsp(files_struct *fsp);
-int wait_for_aio_completion(files_struct *fsp);
+void smbd_aio_complete_mid(unsigned int mid);
 
 /* The following definitions come from smbd/blocking.c  */
 
@@ -6639,14 +6651,9 @@ uint32 dmapi_file_flags(const char * const path);
 
 /* The following definitions come from smbd/dnsregister.c  */
 
-void dns_register_close(struct dns_reg_state **dns_state_ptr);
-void dns_register_smbd(struct dns_reg_state ** dns_state_ptr,
-               unsigned port,
-               int *maxfd,
-               fd_set *listen_set,
-               struct timeval *timeout);
-bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
-               fd_set *lfds, struct timeval *timeout);
+bool smbd_setup_mdns_registration(struct tevent_context *ev,
+                                 TALLOC_CTX *mem_ctx,
+                                 uint16_t port);
 
 /* The following definitions come from smbd/dosmode.c  */
 
@@ -6659,7 +6666,8 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
                     uint32 dosmode, SMB_STRUCT_STAT *st,
                     const char *parent_dir,
                     bool newfile);
-int file_ntimes(connection_struct *conn, const char *fname, const struct timespec ts[2]);
+int file_ntimes(connection_struct *conn, const char *fname,
+               struct smb_file_time *ft);
 bool set_sticky_write_time_path(connection_struct *conn, const char *fname,
                         struct file_id fileid, const struct timespec mtime);
 bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime);
@@ -7005,13 +7013,11 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn,
 /* The following definitions come from smbd/oplock.c  */
 
 int32 get_number_of_exclusive_open_oplocks(void);
-bool oplock_message_waiting(fd_set *fds);
-void process_kernel_oplocks(struct messaging_context *msg_ctx, fd_set *pfds);
+void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp);
 bool set_file_oplock(files_struct *fsp, int oplock_type);
 void release_file_oplock(files_struct *fsp);
 bool remove_oplock(files_struct *fsp);
 bool downgrade_oplock(files_struct *fsp);
-int oplock_notify_fd(void);
 void reply_to_oplock_break_requests(files_struct *fsp);
 void release_level_2_oplocks_on_change(files_struct *fsp);
 void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e);
@@ -7020,14 +7026,14 @@ bool init_oplocks(struct messaging_context *msg_ctx);
 
 /* The following definitions come from smbd/oplock_irix.c  */
 
-struct kernel_oplocks *irix_init_kernel_oplocks(void) ;
+struct kernel_oplocks *irix_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ;
 
 /* The following definitions come from smbd/oplock_linux.c  */
 
 void linux_set_lease_capability(void);
 int linux_set_lease_sighandler(int fd);
 int linux_setlease(int fd, int leasetype);
-struct kernel_oplocks *linux_init_kernel_oplocks(void) ;
+struct kernel_oplocks *linux_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ;
 
 /* The following definitions come from smbd/password.c  */
 
@@ -7051,6 +7057,8 @@ bool authorise_login(int snum, fstring user, DATA_BLOB password,
 
 /* The following definitions come from smbd/pipes.c  */
 
+NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
+                     struct files_struct **pfsp);
 void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req);
 void reply_pipe_write(struct smb_request *req);
 void reply_pipe_write_and_X(struct smb_request *req);
@@ -7084,6 +7092,8 @@ SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname);
 
 /* The following definitions come from smbd/process.c  */
 
+void smbd_setup_sig_term_handler(void);
+void smbd_setup_sig_hup_handler(void);
 bool srv_send_smb(int fd, char *buffer, bool do_encrypt);
 int srv_set_message(char *buf,
                         int num_words,
@@ -7109,12 +7119,12 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
                                                  void *private_data),
                                  void *private_data);
 NTSTATUS allow_new_trans(struct trans_state *list, int mid);
-void respond_to_all_remaining_local_messages(void);
 void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes);
 const char *smb_fn_name(int type);
 void add_to_common_flags2(uint32 v);
 void remove_from_common_flags2(uint32 v);
 void construct_reply_common_req(struct smb_request *req, char *outbuf);
+size_t req_wct_ofs(struct smb_request *req);
 void chain_reply(struct smb_request *req);
 void check_reload(time_t t);
 void smbd_process(void);
@@ -7392,7 +7402,7 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
                           files_struct *fsp,
                           const char *fname,
                           const SMB_STRUCT_STAT *psbuf,
-                          struct timespec ts[2],
+                          struct smb_file_time *ft,
                           bool setting_write_time);
 void reply_findclose(struct smb_request *req);
 void reply_findnclose(struct smb_request *req);