Fix prototypes
[amitay/samba.git] / source3 / include / proto.h
index 85efe24a361d2c7016a64dbc7832a0054ead4994..b585bee70fbdd1676a83685f22079b702d1a04ca 100644 (file)
@@ -171,6 +171,8 @@ bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid );
 NT_USER_TOKEN *get_root_nt_token( void );
 NTSTATUS add_aliases(const DOM_SID *domain_sid,
                     struct nt_user_token *token);
+NTSTATUS create_builtin_users(const DOM_SID *sid);
+NTSTATUS create_builtin_administrators(const DOM_SID *sid);
 struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
                                            const DOM_SID *user_sid,
                                            bool is_guest,
@@ -291,6 +293,9 @@ char *lang_tdb_current(void);
 
 /* The following definitions come from lib/access.c  */
 
+bool client_match(const char *tok, const void *item);
+bool list_match(const char **list,const void *item,
+               bool (*match_fn)(const char *, const void *));
 bool allow_access(const char **deny_list,
                const char **allow_list,
                const char *cname,
@@ -606,6 +611,8 @@ bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired);
 bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout);
 void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr),
                       void* data, const char* keystr_pattern);
+int gencache_lock_entry( const char *key );
+void gencache_unlock_entry( const char *key );
 
 /* The following definitions come from lib/genrand.c  */
 
@@ -1271,6 +1278,7 @@ const char *get_cmdline_auth_info_password(void);
 void set_cmdline_auth_info_password(const char *password);
 bool set_cmdline_auth_info_signing_state(const char *arg);
 int get_cmdline_auth_info_signing_state(void);
+void set_cmdline_auth_info_use_kerberos(bool b);
 bool get_cmdline_auth_info_use_kerberos(void);
 void set_cmdline_auth_info_use_krb5_ticket(void);
 void set_cmdline_auth_info_smb_encrypt(void);
@@ -1405,6 +1413,8 @@ void *talloc_zeronull(const void *context, size_t size, const char *name);
 NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
                                char **pbase, char **pstream);
 bool is_valid_policy_hnd(const POLICY_HND *hnd);
+bool policy_hnd_equal(const struct policy_handle *hnd1,
+                     const struct policy_handle *hnd2);
 const char *strip_hostname(const char *s);
 
 /* The following definitions come from lib/util_file.c  */
@@ -2064,6 +2074,7 @@ bool ads_sitename_match(ADS_STRUCT *ads);
 bool ads_closest_dc(ADS_STRUCT *ads);
 ADS_STATUS ads_connect(ADS_STRUCT *ads);
 ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_gc(ADS_STRUCT *ads);
 void ads_disconnect(ADS_STRUCT *ads);
 ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
                                int scope, const char *expr, const char **attrs,
@@ -4098,6 +4109,8 @@ void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct
 
 bool all_zero(const uint8_t *ptr, size_t size);
 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
+bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1,
+                        const struct ndr_syntax_id *i2);
 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);
@@ -5624,6 +5637,7 @@ struct response_record *queue_node_status( struct subnet_record *subrec,
 void reply_netbios_packet(struct packet_struct *orig_packet,
                           int rcode, enum netbios_reply_type_code rcv_code, int opcode,
                           int ttl, char *data,int len);
+void queue_packet(struct packet_struct *packet);
 void run_packet_queue(void);
 void retransmit_or_expire_response_records(time_t t);
 bool listen_for_packets(bool run_election);
@@ -5826,7 +5840,7 @@ bool lp_winbind_offline_logon(void);
 bool lp_winbind_normalize_names(void);
 bool lp_winbind_rpc_only(void);
 const char **lp_idmap_domains(void);
-const char **lp_idmap_backend(void);
+const char *lp_idmap_backend(void);
 char *lp_idmap_alloc_backend(void);
 int lp_idmap_cache_time(void);
 int lp_idmap_negative_cache_time(void);
@@ -5862,6 +5876,8 @@ bool lp_we_are_a_wins_server(void);
 bool lp_wins_proxy(void);
 bool lp_local_master(void);
 bool lp_domain_logons(void);
+const char **lp_init_logon_delayed_hosts(void);
+int lp_init_logon_delay(void);
 bool lp_load_printers(void);
 bool lp_readraw(void);
 bool lp_large_readwrite(void);
@@ -6163,7 +6179,6 @@ bool lp_load_with_registry_shares(const char *pszFname,
                                  bool save_defaults,
                                  bool add_ipc,
                                  bool initialize_globals);
-void lp_resetnumservices(void);
 int lp_numservices(void);
 void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
 void lp_dump_one(FILE * f, bool show_defaults, int snum);
@@ -7066,7 +7081,6 @@ 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_is_pipe_idx(struct rpc_pipe_client *cli, int pipe_idx);
 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,
@@ -7094,50 +7108,52 @@ 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);
-struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe_idx, NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
-                                               int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                               const char *domain,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
-                                               int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                               const char *domain,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *get_schannel_session_key(struct cli_state *cli,
-                                                       const char *domain,
-                                                       uint32 *pneg_flags,
-                                                       NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
-                                       int pipe_idx,
-                                       enum pipe_auth_level auth_level,
-                                       const char *domain,
-                                       const struct dcinfo *pdc,
-                                       NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
-                                                int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                                const char *domain,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel(struct cli_state *cli,
-                                                int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                                const char *domain,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
-                                               int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                               const char *service_princ,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
+NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
+                                 const struct ndr_syntax_id *interface,
+                                 struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
+                                  const struct ndr_syntax_id *interface,
+                                  enum pipe_auth_level auth_level,
+                                  const char *domain,
+                                  const char *username,
+                                  const char *password,
+                                  struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
+                                         const struct ndr_syntax_id *interface,
+                                         enum pipe_auth_level auth_level,
+                                         const char *domain,
+                                         const char *username,
+                                         const char *password,
+                                         struct rpc_pipe_client **presult);
+NTSTATUS get_schannel_session_key(struct cli_state *cli,
+                                 const char *domain,
+                                 uint32 *pneg_flags,
+                                 struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
+                                            const struct ndr_syntax_id *interface,
+                                            enum pipe_auth_level auth_level,
+                                            const char *domain,
+                                            const struct dcinfo *pdc,
+                                            struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
+                                                const struct ndr_syntax_id *interface,
+                                                enum pipe_auth_level auth_level,
+                                                const char *domain,
+                                                const char *username,
+                                                const char *password,
+                                                struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
+                                   const struct ndr_syntax_id *interface,
+                                   enum pipe_auth_level auth_level,
+                                   const char *domain,
+                                   struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
+                               const struct ndr_syntax_id *interface,
+                               enum pipe_auth_level auth_level,
+                               const char *service_princ,
+                               const char *username,
+                               const char *password,
+                               struct rpc_pipe_client **presult);
 NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
                             struct rpc_pipe_client *cli,
                             DATA_BLOB *session_key);
@@ -7566,6 +7582,12 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
 void init_samr_user_info24(struct samr_UserInfo24 *r,
                           uint8_t data[516],
                           uint8_t pw_len);
+void init_samr_CryptPasswordEx(const char *pwd,
+                              DATA_BLOB *session_key,
+                              struct samr_CryptPasswordEx *pwd_buf);
+void init_samr_CryptPassword(const char *pwd,
+                            DATA_BLOB *session_key,
+                            struct samr_CryptPassword *pwd_buf);
 
 /* The following definitions come from rpc_client/init_srvsvc.c  */
 
@@ -7698,7 +7720,7 @@ void init_srvsvc_NetConnInfo1(struct srvsvc_NetConnInfo1 *r,
 /* The following definitions come from rpc_client/ndr.c  */
 
 NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
-                       TALLOC_CTX *mem_ctx, int p_idx,
+                       TALLOC_CTX *mem_ctx,
                        const struct ndr_interface_table *table,
                        uint32 opnum, void *r);
 
@@ -7901,8 +7923,9 @@ 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(int pipe_idx);
-int cli_get_pipe_idx(const RPC_IFACE *syntax);
+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);
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
@@ -8804,7 +8827,11 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS status);
 bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p);
 bool check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
                     RPC_IFACE* transfer, uint32 context_id);
-NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, const struct api_struct *cmds, int size);
+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);
+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);
 bool api_pipe_ntlmssp_auth_process(pipes_struct *p, prs_struct *rpc_in,
@@ -8813,9 +8840,6 @@ bool api_pipe_schannel_process(pipes_struct *p, prs_struct *rpc_in, uint32 *p_ss
 struct current_user *get_current_user(struct current_user *user, pipes_struct *p);
 void free_pipe_rpc_context( PIPE_RPC_FNS *list );
 bool api_pipe_request(pipes_struct *p);
-bool api_rpcTNP(pipes_struct *p, const char *rpc_name, 
-               const struct api_struct *api_rpc_cmds, int n_cmds);
-void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns );
 
 /* The following definitions come from rpc_server/srv_pipe_hnd.c  */
 
@@ -8835,6 +8859,13 @@ bool close_rpc_pipe_hnd(smb_np_struct *p);
 void pipe_close_conn(connection_struct *conn);
 smb_np_struct *get_rpc_pipe_p(uint16 pnum);
 smb_np_struct *get_rpc_pipe(int pnum);
+struct pipes_struct *make_internal_rpc_pipe_p(const char *pipe_name,
+                                             const char *client_address,
+                                             struct auth_serversupplied_info *server_info,
+                                             uint16_t vuid);
+ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_t n,
+                               bool *is_data_outstanding);
+ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n);
 
 /* The following definitions come from rpc_server/srv_samr_nt.c  */
 
@@ -9812,6 +9843,11 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
                                const char *name_in,
                                char **pp_name_out,
                                bool *ppath_contains_wcard);
+NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
+                               connection_struct **pconn,
+                               int snum,
+                               const char *path,
+                           char **poldcwd);
 
 /* The following definitions come from smbd/negprot.c  */
 
@@ -10475,30 +10511,36 @@ char *get_pass( const char *prompt, bool stdin_get);
 /* The following definitions come from winbindd/idmap.c  */
 
 bool idmap_is_offline(void);
+bool idmap_is_online(void);
 NTSTATUS smb_register_idmap(int version, const char *name,
                            struct idmap_methods *methods);
 NTSTATUS smb_register_idmap_alloc(int version, const char *name,
                                  struct idmap_alloc_methods *methods);
-NTSTATUS idmap_close(void);
+void idmap_close(void);
 NTSTATUS idmap_init_cache(void);
 NTSTATUS idmap_allocate_uid(struct unixid *id);
 NTSTATUS idmap_allocate_gid(struct unixid *id);
 NTSTATUS idmap_set_uid_hwm(struct unixid *id);
 NTSTATUS idmap_set_gid_hwm(struct unixid *id);
-NTSTATUS idmap_unixids_to_sids(struct id_map **ids);
-NTSTATUS idmap_sids_to_unixids(struct id_map **ids);
-NTSTATUS idmap_set_mapping(const struct id_map *id);
-char *idmap_fetch_secret(const char *backend, bool alloc,
-                              const char *domain, const char *identity);
+NTSTATUS idmap_backends_unixid_to_sid(const char *domname,
+                                     struct id_map *id);
+NTSTATUS idmap_backends_sid_to_unixid(const char *domname,
+                                     struct id_map *id);
+NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
+                          struct unixid *pxid);
+NTSTATUS idmap_set_mapping(const struct id_map *map);
 
 /* The following definitions come from winbindd/idmap_cache.c  */
 
-struct idmap_cache_ctx *idmap_cache_init(TALLOC_CTX *memctx);
-NTSTATUS idmap_cache_set(struct idmap_cache_ctx *cache, const struct id_map *id);
-NTSTATUS idmap_cache_set_negative_sid(struct idmap_cache_ctx *cache, const struct id_map *id);
-NTSTATUS idmap_cache_set_negative_id(struct idmap_cache_ctx *cache, const struct id_map *id);
-NTSTATUS idmap_cache_map_sid(struct idmap_cache_ctx *cache, struct id_map *id);
-NTSTATUS idmap_cache_map_id(struct idmap_cache_ctx *cache, struct id_map *id);
+bool idmap_cache_find_sid2uid(const struct dom_sid *sid, uid_t *puid,
+                             bool *expired);
+bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired);
+void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid);
+bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid,
+                             bool *expired);
+bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired);
+void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid);
+
 
 /* The following definitions come from winbindd/idmap_nss.c  */
 
@@ -10516,10 +10558,10 @@ NTSTATUS idmap_tdb_init(void);
 
 /* The following definitions come from winbindd/idmap_util.c  */
 
-NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid);
-NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid);
-NTSTATUS idmap_sid_to_uid(DOM_SID *sid, uid_t *uid);
-NTSTATUS idmap_sid_to_gid(DOM_SID *sid, gid_t *gid);
+NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid);
+NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid);
+NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid);
+NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid);
 
 /* The following definitions come from winbindd/nss_info.c  */