idl: add file_id idl.
[sfrench/samba-autobuild/.git] / source3 / include / proto.h
index 8278ffbcd5f5560c56568575f33675f4f4daa27a..29dbcc97635ab00b89dce93552daf12c228a513b 100644 (file)
@@ -1584,10 +1584,6 @@ unsigned wins_srv_count_tag(const char *tag);
 enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
 enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r);
 void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r);
-enum ndr_err_code ndr_push_file_id(struct ndr_push *ndr, int ndr_flags, const struct file_id *r);
-enum ndr_err_code ndr_pull_file_id(struct ndr_pull *ndr, int ndr_flags, struct file_id *r);
-void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct file_id *r);
-_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
 _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
 const char *ndr_errstr(enum ndr_err_code err);
 extern const struct ndr_syntax_id null_ndr_syntax_id;
@@ -1746,7 +1742,6 @@ void cli_shutdown(struct cli_state *cli);
 void cli_sockopt(struct cli_state *cli, const char *options);
 uint16 cli_setpid(struct cli_state *cli, uint16 pid);
 bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
-bool cli_send_keepalive(struct cli_state *cli);
 struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                                 struct cli_state *cli, uint16_t num_echos,
                                 DATA_BLOB data);
@@ -1786,6 +1781,11 @@ struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
                                        uint8_t *data,
                                        size_t data_len);
 NTSTATUS cli_setpathinfo_recv(struct tevent_req *req);
+NTSTATUS cli_setpathinfo(struct cli_state *cli,
+                        uint16_t level,
+                        const char *path,
+                        uint8_t *data,
+                        size_t data_len);
 
 struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
                                        struct event_context *ev,
@@ -2247,20 +2247,21 @@ void cli_oplock_handler(struct cli_state *cli,
 int cli_print_queue(struct cli_state *cli,
                    void (*fn)(struct print_job_info *));
 int cli_printjob_del(struct cli_state *cli, int job);
-int cli_spl_open(struct cli_state *cli, const char *fname, int flags, int share_mode);
-bool cli_spl_close(struct cli_state *cli, uint16_t fnum);
 
 /* The following definitions come from libsmb/cliquota.c  */
 
 NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
 void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
-bool cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-bool cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST **pqt_list);
-bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric));
-void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric));
+NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
+                           SMB_NTQUOTA_STRUCT *pqt);
+NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
+                           SMB_NTQUOTA_STRUCT *pqt);
+NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
+                            SMB_NTQUOTA_LIST **pqt_list);
+NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
+                              SMB_NTQUOTA_STRUCT *pqt);
+NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
+                              SMB_NTQUOTA_STRUCT *pqt);
 
 /* The following definitions come from libsmb/clirap.c  */
 
@@ -2293,12 +2294,12 @@ NTSTATUS cli_qpathinfo1(struct cli_state *cli,
                        time_t *write_time,
                        SMB_OFF_T *size,
                        uint16 *mode);
-bool cli_setpathinfo(struct cli_state *cli, const char *fname,
-                     time_t create_time,
-                     time_t access_time,
-                     time_t write_time,
-                     time_t change_time,
-                     uint16 mode);
+NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname,
+                              time_t create_time,
+                              time_t access_time,
+                              time_t write_time,
+                              time_t change_time,
+                              uint16 mode);
 struct tevent_req *cli_qpathinfo2_send(TALLOC_CTX *mem_ctx,
                                       struct event_context *ev,
                                       struct cli_state *cli,
@@ -2508,7 +2509,8 @@ NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
 
 struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
                            TALLOC_CTX *mem_ctx);
-bool cli_set_secdesc(struct cli_state *cli, uint16_t fnum, struct security_descriptor *sd);
+NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
+                        struct security_descriptor *sd);
 
 /* The following definitions come from libsmb/clispnego.c  */
 
@@ -2579,24 +2581,6 @@ size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
 
 /* The following definitions come from libsmb/clitrans.c  */
 
-bool cli_send_trans(struct cli_state *cli, int trans,
-                   const char *pipe_name,
-                   int fid, int flags,
-                   uint16 *setup, unsigned int lsetup, unsigned int msetup,
-                   const char *param, unsigned int lparam, unsigned int mparam,
-                   const char *data, unsigned int ldata, unsigned int mdata);
-bool cli_receive_trans(struct cli_state *cli,int trans,
-                              char **param, unsigned int *param_len,
-                              char **data, unsigned int *data_len);
-bool cli_send_nt_trans(struct cli_state *cli,
-                      int function,
-                      int flags,
-                      uint16 *setup, unsigned int lsetup, unsigned int msetup,
-                      char *param, unsigned int lparam, unsigned int mparam,
-                      char *data, unsigned int ldata, unsigned int mdata);
-bool cli_receive_nt_trans(struct cli_state *cli,
-                         char **param, unsigned int *param_len,
-                         char **data, unsigned int *data_len);
 struct tevent_req *cli_trans_send(
        TALLOC_CTX *mem_ctx, struct event_context *ev,
        struct cli_state *cli, uint8_t cmd,
@@ -2699,12 +2683,18 @@ bool saf_store( const char *domain, const char *servername );
 bool saf_join_store( const char *domain, const char *servername );
 bool saf_delete( const char *domain );
 char *saf_fetch( const char *domain );
-NTSTATUS node_status_query(int fd,
-                          struct nmb_name *name,
-                          const struct sockaddr_storage *to_ss,
-                          TALLOC_CTX *mem_ctx,
-                          struct node_status **names,
-                          int *num_names,
+struct tevent_req *node_status_query_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct nmb_name *name,
+                                         const struct sockaddr_storage *addr);
+NTSTATUS node_status_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                               struct node_status **pnode_status,
+                               int *pnum_names,
+                               struct node_status_extra *extra);
+NTSTATUS node_status_query(TALLOC_CTX *mem_ctx, struct nmb_name *name,
+                          const struct sockaddr_storage *addr,
+                          struct node_status **pnode_status,
+                          int *pnum_names,
                           struct node_status_extra *extra);
 bool name_status_find(const char *q_name,
                        int q_type,
@@ -2712,15 +2702,20 @@ bool name_status_find(const char *q_name,
                        const struct sockaddr_storage *to_ss,
                        fstring name);
 int ip_service_compare(struct ip_service *ss1, struct ip_service *ss2);
-struct sockaddr_storage *name_query(int fd,
-                       const char *name,
-                       int name_type,
-                       bool bcast,
-                       bool recurse,
-                       const struct sockaddr_storage *to_ss,
-                       int *count,
-                       int *flags,
-                       bool *timed_out);
+struct tevent_req *name_query_send(TALLOC_CTX *mem_ctx,
+                                  struct tevent_context *ev,
+                                  const char *name, int name_type,
+                                  bool bcast, bool recurse,
+                                  const struct sockaddr_storage *addr);
+NTSTATUS name_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                        struct sockaddr_storage **addrs, int *num_addrs,
+                        uint8_t *flags);
+NTSTATUS name_query(const char *name, int name_type,
+                   bool bcast, bool recurse,
+                   const struct sockaddr_storage *to_ss,
+                   TALLOC_CTX *mem_ctx,
+                   struct sockaddr_storage **addrs,
+                   int *num_addrs, uint8_t *flags);
 NTSTATUS name_resolve_bcast(const char *name,
                        int name_type,
                        struct ip_service **return_iplist,
@@ -2770,6 +2765,7 @@ void put_name(char *dest, const char *name, int pad, unsigned int name_type);
 char *nmb_namestr(const struct nmb_name *n);
 struct packet_struct *copy_packet(struct packet_struct *packet);
 void free_packet(struct packet_struct *packet);
+int packet_trn_id(struct packet_struct *p);
 struct packet_struct *parse_packet(char *buf,int length,
                                   enum packet_type packet_type,
                                   struct in_addr ip,
@@ -2780,9 +2776,6 @@ bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
 int build_packet(char *buf, size_t buflen, struct packet_struct *p);
 bool send_packet(struct packet_struct *p);
 struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
-struct packet_struct *receive_nmb_packet(int fd, int t, int trn_id);
-struct packet_struct *receive_dgram_packet(int fd, int t,
-               const char *mailslot_name);
 bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
 int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
 void sort_query_replies(char *data, int n, struct in_addr ip);
@@ -2924,12 +2917,27 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
 
 /* The following definitions come from libsmb/unexpected.c  */
 
-bool is_requested_send_packet(struct packet_struct *p);
-bool store_outstanding_send_packet(struct packet_struct *p);
-void unexpected_packet(struct packet_struct *p);
-void clear_unexpected(time_t t);
-struct packet_struct *receive_unexpected(enum packet_type packet_type, int id,
+struct nb_packet_server;
+struct nb_packet_reader;
+
+NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
+                                struct tevent_context *ev,
+                                int max_clients,
+                                struct nb_packet_server **presult);
+void nb_packet_dispatch(struct nb_packet_server *server,
+                       struct packet_struct *p);
+struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
+                                        struct tevent_context *ev,
+                                        enum packet_type type,
+                                        int trn_id,
                                         const char *mailslot_name);
+NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                              struct nb_packet_reader **preader);
+struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
+                                      struct tevent_context *ev,
+                                      struct nb_packet_reader *reader);
+NTSTATUS nb_packet_read_recv(struct tevent_req *req,
+                            struct packet_struct **ppacket);
 
 /* The following definitions come from locking/brlock.c  */
 
@@ -3218,6 +3226,7 @@ bool lp_winbind_offline_logon(void);
 bool lp_winbind_normalize_names(void);
 bool lp_winbind_rpc_only(void);
 bool lp_create_krb5_conf(void);
+int lp_winbind_max_domain_connections(void);
 const char *lp_idmap_backend(void);
 bool lp_idmap_read_only(void);
 int lp_idmap_cache_time(void);
@@ -4038,7 +4047,9 @@ void notify_printer_sepfile(struct tevent_context *ev,
 /* The following definitions come from printing/pcap.c  */
 
 void pcap_cache_reload(struct tevent_context *ev,
-                      struct messaging_context *msg_ctx);
+                      struct messaging_context *msg_ctx,
+                      void (*post_cache_fill_fn)(struct tevent_context *,
+                                                 struct messaging_context *));
 bool pcap_printername_ok(const char *printername);
 
 /* The following definitions come from printing/printing.c  */
@@ -5015,10 +5026,9 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32_t *pprivate_flags);
 void remove_deferred_open_entry(struct file_id id, uint64_t mid,
                                struct server_id pid);
-NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
+NTSTATUS open_file_fchmod(connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
-NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
                          struct smb_filename *smb_dname);
 void msg_file_was_renamed(struct messaging_context *msg,
@@ -5376,9 +5386,12 @@ void server_messaging_context_free(void);
 struct event_context *smbd_event_context(void);
 struct messaging_context *smbd_messaging_context(void);
 struct memcache *smbd_memcache(void);
-void reload_printers(struct messaging_context *msg_ctx);
+void reload_printers(struct tevent_context *ev,
+                    struct messaging_context *msg_ctx);
 bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
                     bool test);
+void reload_pcap_change_notify(struct tevent_context *ev,
+                              struct messaging_context *msg_ctx);
 void exit_server(const char *const explanation);
 void exit_server_cleanly(const char *const explanation);
 void exit_server_fault(void);
@@ -5620,24 +5633,37 @@ int fncall_recv(struct tevent_req *req, int *perr);
 struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
                                        struct tevent_context *ev,
                                        const struct sockaddr_storage *addr,
+                                       uint16_t port,
                                        const char *called_name,
-                                       const char *calling_name);
+                                       int called_type,
+                                       const char *calling_name,
+                                       int calling_type);
 NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
-                             uint16_t *port);
-NTSTATUS smbsock_connect(const struct sockaddr_storage *addr,
-                        const char *called_name, const char *calling_name,
-                        int *pfd, uint16_t *port);
+                             uint16_t *ret_port);
+NTSTATUS smbsock_connect(const struct sockaddr_storage *addr, uint16_t port,
+                        const char *called_name, int called_type,
+                        const char *calling_name, int calling_type,
+                        int *pfd, uint16_t *ret_port);
 
 struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
                                            const struct sockaddr_storage *addrs,
                                            const char **called_names,
-                                           size_t num_addrs);
+                                           int *called_types,
+                                           const char **calling_names,
+                                           int *calling_types,
+                                           size_t num_addrs, uint16_t port);
 NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
-                                 size_t *chosen_index, uint16_t *port);
+                                 size_t *chosen_index, uint16_t *chosen_port);
 NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
-                            const char **called_names, size_t num_addrs,
-                            int *pfd, size_t *chosen_index, uint16_t *port);
+                            const char **called_names,
+                            int *called_types,
+                            const char **calling_names,
+                            int *calling_types,
+                            size_t num_addrs,
+                            uint16_t port,
+                            int *pfd, size_t *chosen_index,
+                            uint16_t *chosen_port);
 
 /* The following definitions come from rpc_server/srv_samr_nt.c */
 NTSTATUS access_check_object( struct security_descriptor *psd, struct security_token *token,