s3-spoolss: make several notify functions static.
[ira/wip.git] / source3 / include / proto.h
index eefde96911a76ba99bea71b446bb5b514918eb13..e16cae5b2b7d91020f73655f484a14ea9b48eb8e 100644 (file)
@@ -154,6 +154,22 @@ void free_user_info(struct auth_usersupplied_info **user_info);
 bool make_auth_methods(struct auth_context *auth_context, auth_methods **auth_method) ;
 bool is_trusted_domain(const char* dom_name);
 
+/* The following definitions come from auth/user_info.c  */
+
+NTSTATUS make_user_info(struct auth_usersupplied_info **user_info,
+                       const char *smb_name,
+                       const char *internal_username,
+                       const char *client_domain,
+                       const char *domain,
+                       const char *wksta_name,
+                       const DATA_BLOB *lm_pwd,
+                       const DATA_BLOB *nt_pwd,
+                       const DATA_BLOB *lm_interactive_pwd,
+                       const DATA_BLOB *nt_interactive_pwd,
+                       const DATA_BLOB *plaintext,
+                       bool encrypted);
+void free_user_info(struct auth_usersupplied_info **user_info);
+
 /* The following definitions come from auth/auth_winbind.c  */
 
 NTSTATUS auth_winbind_init(void);
@@ -677,7 +693,8 @@ ssize_t drain_socket(int sockfd, size_t count);
 /* The following definitions come from lib/secdesc.c  */
 
 uint32_t get_sec_info(const SEC_DESC *sd);
-SEC_DESC_BUF *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
+SEC_DESC *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC *new_sdb, SEC_DESC *old_sdb);
+SEC_DESC_BUF *sec_desc_merge_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
 SEC_DESC *make_sec_desc(TALLOC_CTX *ctx,
                        enum security_descriptor_revision revision,
                        uint16 type,
@@ -1071,6 +1088,7 @@ time_t cli_make_unix_date2(struct cli_state *cli, const void *date_ptr);
 time_t cli_make_unix_date3(struct cli_state *cli, const void *date_ptr);
 void TimeInit(void);
 void get_process_uptime(struct timeval *ret_time);
+void get_startup_time(struct timeval *ret_time);
 time_t nt_time_to_unix_abs(const NTTIME *nt);
 time_t uint64s_nt_time_to_unix_abs(const uint64_t *src);
 void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts);
@@ -1273,9 +1291,9 @@ void flush_pwnam_cache(void);
 struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name);
 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
 
-/* The following definitions come from lib/util_reg.c  */
+/* The following definitions come from ..libcli/registry/util_reg.c  */
 
-const char *reg_type_lookup(enum winreg_Type type);
+const char *str_regtype(int type);
 bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
                 DATA_BLOB *blob, const char *s);
 bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
@@ -2089,27 +2107,8 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
                                uint32_t flags);
 
 
-#include "librpc/gen_ndr/ndr_dfs.h"
-#include "librpc/gen_ndr/ndr_dssetup.h"
-#include "librpc/gen_ndr/ndr_echo.h"
-#include "librpc/gen_ndr/ndr_eventlog.h"
 #include "librpc/gen_ndr/ndr_krb5pac.h"
-#include "librpc/gen_ndr/ndr_lsa.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_notify.h"
-#include "librpc/gen_ndr/ndr_ntsvcs.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_security.h"
-#include "librpc/gen_ndr/ndr_srvsvc.h"
-#include "librpc/gen_ndr/ndr_svcctl.h"
-#include "librpc/gen_ndr/ndr_winreg.h"
-#include "librpc/gen_ndr/ndr_wkssvc.h"
-#include "librpc/gen_ndr/ndr_drsuapi.h"
 #include "librpc/gen_ndr/ndr_spoolss.h"
-#include "librpc/gen_ndr/ndr_initshutdown.h"
-
-#include "librpc/ndr/libndr.h"
 
 /* The following definitions come from librpc/ndr/util.c  */
 
@@ -2833,9 +2832,12 @@ bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **
 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
 
 /* The following definitions come from libsmb/clirap2.c  */
+struct rap_group_info_1;
+struct rap_user_info_1;
+struct rap_share_info_2;
 
 int cli_NetGroupDelete(struct cli_state *cli, const char *group_name);
-int cli_NetGroupAdd(struct cli_state *cli, RAP_GROUP_INFO_1 *grinfo);
+int cli_NetGroupAdd(struct cli_state *cli, struct rap_group_info_1 *grinfo);
 int cli_RNetGroupEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
 int cli_RNetGroupEnum0(struct cli_state *cli,
                       void (*fn)(const char *, void *),
@@ -2845,7 +2847,7 @@ int cli_NetGroupAddUser(struct cli_state * cli, const char *group_name, const ch
 int cli_NetGroupGetUsers(struct cli_state * cli, const char *group_name, void (*fn)(const char *, void *), void *state );
 int cli_NetUserGetGroups(struct cli_state * cli, const char *user_name, void (*fn)(const char *, void *), void *state );
 int cli_NetUserDelete(struct cli_state *cli, const char * user_name );
-int cli_NetUserAdd(struct cli_state *cli, RAP_USER_INFO_1 * userinfo );
+int cli_NetUserAdd(struct cli_state *cli, struct rap_user_info_1 * userinfo );
 int cli_RNetUserEnum(struct cli_state *cli, void (*fn)(const char *, const char *, const char *, const char *, void *), void *state);
 int cli_RNetUserEnum0(struct cli_state *cli,
                      void (*fn)(const char *, void *),
@@ -2856,7 +2858,7 @@ int cli_NetFileEnum(struct cli_state *cli, const char * user,
                    const char * base_path,
                    void (*fn)(const char *, const char *, uint16, uint16,
                               uint32));
-int cli_NetShareAdd(struct cli_state *cli, RAP_SHARE_INFO_2 * sinfo );
+int cli_NetShareAdd(struct cli_state *cli, struct rap_share_info_2 * sinfo );
 int cli_NetShareDelete(struct cli_state *cli, const char * share_name );
 bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_name);
 bool cli_get_server_domain(struct cli_state *cli);
@@ -3494,12 +3496,12 @@ bool is_valid_share_mode_entry(const struct share_mode_entry *e);
 bool is_deferred_open_entry(const struct share_mode_entry *e);
 bool is_unused_share_mode_entry(const struct share_mode_entry *e);
 void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
-                   uid_t uid, uint16 mid, uint16 op_type);
-void add_deferred_open(struct share_mode_lock *lck, uint16 mid,
+                   uid_t uid, uint64_t mid, uint16 op_type);
+void add_deferred_open(struct share_mode_lock *lck, uint64_t mid,
                       struct timeval request_time,
                       struct file_id id);
 bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
-void del_deferred_open_entry(struct share_mode_lock *lck, uint16 mid);
+void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid);
 bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
@@ -3982,6 +3984,7 @@ char *lp_addmachine_script(void);
 char *lp_shutdown_script(void);
 char *lp_abort_shutdown_script(void);
 char *lp_username_map_script(void);
+int lp_username_map_cache_time(void);
 char *lp_check_password_script(void);
 char *lp_wins_hook(void);
 const char *lp_template_homedir(void);
@@ -4808,12 +4811,12 @@ void notify_job_username(const char *sharename, uint32 jobid, char *name);
 void notify_job_name(const char *sharename, uint32 jobid, char *name);
 void notify_job_submitted(const char *sharename, uint32 jobid,
                          time_t submitted);
-void notify_printer_driver(int snum, char *driver_name);
-void notify_printer_comment(int snum, char *comment);
-void notify_printer_sharename(int snum, char *share_name);
-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_driver(int snum, const char *driver_name);
+void notify_printer_comment(int snum, const char *comment);
+void notify_printer_sharename(int snum, const char *share_name);
+void notify_printer_printername(int snum, const char *printername);
+void notify_printer_port(int snum, const char *port_name);
+void notify_printer_location(int snum, const char *location);
 void notify_printer_byname( const char *printername, uint32 change, const char *value );
 
 /* The following definitions come from printing/nt_printing.c  */
@@ -4840,6 +4843,11 @@ uint32 del_a_printer(const char *sharename);
 NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
 void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr);
 int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen);
+WERROR spoolss_create_default_devmode(TALLOC_CTX *mem_ctx,
+                                     const char *devicename,
+                                     struct spoolss_DeviceMode **devmode);
+WERROR spoolss_create_default_secdesc(TALLOC_CTX *mem_ctx,
+                                     struct spoolss_security_descriptor **secdesc);
 int add_new_printer_key( NT_PRINTER_DATA *data, const char *name );
 int delete_printer_key( NT_PRINTER_DATA *data, const char *name );
 int lookup_printerkey( NT_PRINTER_DATA *data, const char *name );
@@ -4870,6 +4878,8 @@ WERROR get_a_printer_search( Printer_entry *print_hnd,
                        uint32 level,
                        const char *sharename);
 uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level);
+bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r,
+                             struct spoolss_DriverInfo8 *_info8);
 uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx,
                              struct spoolss_AddDriverInfoCtr *r,
                              char **driver_name,
@@ -4953,8 +4963,8 @@ bool print_job_exists(const char* sharename, uint32 jobid);
 int print_job_fd(const char* sharename, uint32 jobid);
 char *print_job_fname(const char* sharename, uint32 jobid);
 NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid);
-bool print_job_set_place(const char *sharename, uint32 jobid, int place);
-bool print_job_set_name(const char *sharename, uint32 jobid, char *name);
+bool print_job_set_name(const char *sharename, uint32 jobid, const char *name);
+bool print_job_get_name(TALLOC_CTX *mem_ctx, const char *sharename, uint32_t jobid, char **name);
 bool print_job_delete(struct auth_serversupplied_info *server_info, int snum,
                      uint32 jobid, WERROR *errcode);
 bool print_job_pause(struct auth_serversupplied_info *server_info, int snum,
@@ -5749,41 +5759,6 @@ void init_rpc_hdr_auth(RPC_HDR_AUTH *rai,
                                uint32 auth_context_id);
 bool smb_io_rpc_hdr_auth(const char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
 
-/* The following definitions come from lib/eventlog/eventlog.c  */
-
-TDB_CONTEXT *elog_init_tdb( char *tdbfilename );
-char *elog_tdbname(TALLOC_CTX *ctx, const char *name );
-int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention );
-bool prune_eventlog( TDB_CONTEXT * tdb );
-ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only );
-int elog_close_tdb( ELOG_TDB *etdb, bool force_close );
-bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor );
-size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r);
-struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx,
-                                                 TDB_CONTEXT *tdb,
-                                                 uint32_t record_number);
-NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
-                              TDB_CONTEXT *tdb,
-                              struct eventlog_Record_tdb *r,
-                              uint32_t *record_number);
-NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx,
-                          TDB_CONTEXT *tdb,
-                          struct EVENTLOGRECORD *r,
-                          uint32_t *record_number);
-struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx,
-                                        TDB_CONTEXT *tdb,
-                                        uint32_t record_number);
-NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx,
-                                     const struct EVENTLOGRECORD *e,
-                                     struct eventlog_Record_tdb *t);
-NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
-                                     const struct eventlog_Record_tdb *t,
-                                     struct EVENTLOGRECORD *e);
-NTSTATUS evlog_convert_tdb_to_evt(TALLOC_CTX *mem_ctx,
-                                 ELOG_TDB *etdb,
-                                 DATA_BLOB *blob_p,
-                                 uint32_t *num_records_p);
-
 /* The following definitions come from rpc_server/srv_eventlog_nt.c  */
 
 /* The following definitions come from rpc_server/srv_lsa_hnd.c  */
@@ -5917,75 +5892,6 @@ bool convert_devicemode(const char *printername,
 WERROR set_printer_dataex(NT_PRINTER_INFO_LEVEL *printer,
                          const char *key, const char *value,
                          uint32_t type, uint8_t *data, int real_len);
-void spoolss_notify_server_name(int snum,
-                                      struct spoolss_Notify *data,
-                                      print_queue_struct *queue,
-                                      NT_PRINTER_INFO_LEVEL *printer,
-                                      TALLOC_CTX *mem_ctx);
-void spoolss_notify_printer_name(int snum,
-                                       struct spoolss_Notify *data,
-                                       print_queue_struct *queue,
-                                       NT_PRINTER_INFO_LEVEL *printer,
-                                       TALLOC_CTX *mem_ctx);
-void spoolss_notify_share_name(int snum,
-                                     struct spoolss_Notify *data,
-                                     print_queue_struct *queue,
-                                     NT_PRINTER_INFO_LEVEL *printer,
-                                     TALLOC_CTX *mem_ctx);
-void spoolss_notify_port_name(int snum,
-                                    struct spoolss_Notify *data,
-                                    print_queue_struct *queue,
-                                    NT_PRINTER_INFO_LEVEL *printer,
-                                    TALLOC_CTX *mem_ctx);
-void spoolss_notify_driver_name(int snum,
-                                      struct spoolss_Notify *data,
-                                      print_queue_struct *queue,
-                                      NT_PRINTER_INFO_LEVEL *printer,
-                                      TALLOC_CTX *mem_ctx);
-void spoolss_notify_comment(int snum,
-                                  struct spoolss_Notify *data,
-                                  print_queue_struct *queue,
-                                  NT_PRINTER_INFO_LEVEL *printer,
-                                  TALLOC_CTX *mem_ctx);
-void spoolss_notify_location(int snum,
-                                   struct spoolss_Notify *data,
-                                   print_queue_struct *queue,
-                                   NT_PRINTER_INFO_LEVEL *printer,
-                                   TALLOC_CTX *mem_ctx);
-void spoolss_notify_sepfile(int snum,
-                                  struct spoolss_Notify *data,
-                                  print_queue_struct *queue,
-                                  NT_PRINTER_INFO_LEVEL *printer,
-                                  TALLOC_CTX *mem_ctx);
-void spoolss_notify_print_processor(int snum,
-                                          struct spoolss_Notify *data,
-                                          print_queue_struct *queue,
-                                          NT_PRINTER_INFO_LEVEL *printer,
-                                          TALLOC_CTX *mem_ctx);
-void spoolss_notify_parameters(int snum,
-                                     struct spoolss_Notify *data,
-                                     print_queue_struct *queue,
-                                     NT_PRINTER_INFO_LEVEL *printer,
-                                     TALLOC_CTX *mem_ctx);
-void spoolss_notify_datatype(int snum,
-                                   struct spoolss_Notify *data,
-                                   print_queue_struct *queue,
-                                   NT_PRINTER_INFO_LEVEL *printer,
-                                   TALLOC_CTX *mem_ctx);
-void spoolss_notify_attributes(int snum,
-                                     struct spoolss_Notify *data,
-                                     print_queue_struct *queue,
-                                     NT_PRINTER_INFO_LEVEL *printer,
-                                     TALLOC_CTX *mem_ctx);
-void spoolss_notify_cjobs(int snum,
-                                struct spoolss_Notify *data,
-                                print_queue_struct *queue,
-                                NT_PRINTER_INFO_LEVEL *printer,
-                                TALLOC_CTX *mem_ctx);
-void construct_info_data(struct spoolss_Notify *info_data,
-                        enum spoolss_NotifyType type,
-                        uint16_t field,
-                        int id);
 struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx,
                                              const char *servicename);
 bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer);
@@ -6074,10 +5980,16 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
                              size_t numtowrite);
 int wait_for_aio_completion(files_struct *fsp);
 void cancel_aio_by_fsp(files_struct *fsp);
-void smbd_aio_complete_mid(unsigned int mid);
+void smbd_aio_complete_mid(uint64_t mid);
 
 /* The following definitions come from smbd/blocking.c  */
 
+void brl_timeout_fn(struct event_context *event_ctx,
+               struct timed_event *te,
+               struct timeval now,
+               void *private_data);
+struct timeval timeval_brl_min(const struct timeval *tv1,
+                       const struct timeval *tv2);
 void process_blocking_lock_queue(void);
 bool push_blocking_lock_request( struct byte_range_lock *br_lck,
                struct smb_request *req,
@@ -6091,9 +6003,9 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
                uint64_t count,
                uint32 blocking_pid);
 void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck);
-void remove_pending_lock_requests_by_mid(int mid);
-bool blocking_lock_was_deferred(int mid);
-struct blocking_lock_record *blocking_lock_cancel(files_struct *fsp,
+void remove_pending_lock_requests_by_mid_smb1(uint64_t mid);
+bool blocking_lock_was_deferred_smb1(uint64_t mid);
+struct blocking_lock_record *blocking_lock_cancel_smb1(files_struct *fsp,
                        uint32 lock_pid,
                        uint64_t offset,
                        uint64_t count,
@@ -6531,7 +6443,7 @@ NTSTATUS change_notify_add_request(struct smb_request *req,
                                void (*reply_fn)(struct smb_request *req,
                                        NTSTATUS error_code,
                                        uint8_t *buf, size_t len));
-void remove_pending_change_notify_requests_by_mid(uint16 mid);
+void remove_pending_change_notify_requests_by_mid(uint64_t mid);
 void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
                                                  NTSTATUS status);
 void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
@@ -6590,9 +6502,18 @@ void send_nt_replies(connection_struct *conn,
                     char *params, int paramsize,
                     char *pdata, int datasize);
 void reply_ntcreate_and_X(struct smb_request *req);
+NTSTATUS set_sd(files_struct *fsp, uint8_t *data, uint32_t sd_len,
+                       uint32_t security_info_sent);
 struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size);
 void reply_ntcancel(struct smb_request *req);
 void reply_ntrename(struct smb_request *req);
+NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
+                                       TALLOC_CTX *mem_ctx,
+                                       files_struct *fsp,
+                                       uint32_t security_info_wanted,
+                                       uint32_t max_data_count,
+                                       uint8_t **ppmarshalled_sd,
+                                       size_t *psd_size);
 void reply_nttrans(struct smb_request *req);
 void reply_nttranss(struct smb_request *req);
 
@@ -6638,6 +6559,7 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32 *pcreate_disposition,
                                 uint32 *pcreate_options,
                                 uint32_t *pprivate_flags);
+void remove_deferred_open_entry(struct file_id id, uint64_t mid);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
@@ -6792,16 +6714,18 @@ int srv_set_message(char *buf,
                         int num_words,
                         int num_bytes,
                         bool zero);
-void remove_deferred_open_message_smb(uint16_t mid);
-void schedule_deferred_open_message_smb(uint16_t mid);
-bool open_was_deferred(uint16_t mid);
-bool get_deferred_open_message_state(uint16_t mid,
+void remove_deferred_open_message_smb(uint64_t mid);
+void schedule_deferred_open_message_smb(uint64_t mid);
+bool open_was_deferred(uint64_t mid);
+bool get_deferred_open_message_state(struct smb_request *smbreq,
                                struct timeval *p_request_time,
                                void **pp_state);
 bool push_deferred_open_message_smb(struct smb_request *req,
-                              struct timeval request_time,
-                              struct timeval timeout,
-                              char *private_data, size_t priv_len);
+                               struct timeval request_time,
+                               struct timeval timeout,
+                               struct file_id id,
+                               char *private_data,
+                               size_t priv_len);
 struct idle_event *event_add_idle(struct event_context *event_ctx,
                                  TALLOC_CTX *mem_ctx,
                                  struct timeval interval,
@@ -6809,7 +6733,7 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
                                  bool (*handler)(const struct timeval *now,
                                                  void *private_data),
                                  void *private_data);
-NTSTATUS allow_new_trans(struct trans_state *list, int mid);
+NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid);
 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);