1686
1079
struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip);
1687
1080
unsigned wins_srv_count_tag(const char *tag);
1689
/* The following definitions come from libads/ads_status.c */
1691
ADS_STATUS ads_build_error(enum ads_error_type etype,
1692
int rc, int minor_status);
1693
ADS_STATUS ads_build_nt_error(enum ads_error_type etype,
1694
NTSTATUS nt_status);
1695
NTSTATUS ads_ntstatus(ADS_STATUS status);
1696
const char *ads_errstr(ADS_STATUS status);
1697
NTSTATUS gss_err_to_ntstatus(uint32 maj, uint32 min);
1699
/* The following definitions come from libads/ads_struct.c */
1701
char *ads_build_path(const char *realm, const char *sep, const char *field, int reverse);
1702
char *ads_build_dn(const char *realm);
1703
char *ads_build_domain(const char *dn);
1704
ADS_STRUCT *ads_init(const char *realm,
1705
const char *workgroup,
1706
const char *ldap_server);
1707
void ads_destroy(ADS_STRUCT **ads);
1709
const char *ads_get_ldap_server_name(ADS_STRUCT *ads);
1711
/* The following definitions come from libads/authdata.c */
1713
struct PAC_LOGON_INFO *get_logon_info_from_pac(struct PAC_DATA *pac_data);
1714
NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
1718
time_t *expire_time,
1719
time_t *renew_till_time,
1720
const char *cache_name,
1722
bool add_netbios_addr,
1723
time_t renewable_time,
1724
const char *impersonate_princ_s,
1725
struct PAC_DATA **pac_ret);
1726
NTSTATUS kerberos_return_info3_from_pac(TALLOC_CTX *mem_ctx,
1730
time_t *expire_time,
1731
time_t *renew_till_time,
1732
const char *cache_name,
1734
bool add_netbios_addr,
1735
time_t renewable_time,
1736
const char *impersonate_princ_s,
1737
struct netr_SamInfo3 **info3);
1739
/* The following definitions come from libads/cldap.c */
1740
bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx,
1743
uint32_t nt_version,
1744
struct netlogon_samlogon_response **reply);
1745
bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx,
1748
struct NETLOGON_SAM_LOGON_RESPONSE_EX *reply5);
1750
/* The following definitions come from libads/disp_sec.c */
1752
void ads_disp_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, SEC_DESC *sd);
1754
/* The following definitions come from libads/dns.c */
1756
NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
1757
const char *dnsdomain,
1758
struct dns_rr_ns **nslist,
1760
bool sitename_store(const char *realm, const char *sitename);
1761
char *sitename_fetch(const char *realm);
1762
bool stored_sitename_changed(const char *realm, const char *sitename);
1763
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
1765
const char *sitename,
1766
struct dns_rr_srv **dclist,
1768
NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
1770
const char *sitename,
1771
struct dns_rr_srv **dclist,
1773
NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
1774
const char *dns_forest_name,
1775
const char *sitename,
1776
struct dns_rr_srv **dclist,
1778
NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
1779
const char *dns_domain_name,
1780
struct dns_rr_srv **dclist,
1782
NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
1783
const char *dns_forest_name,
1784
const struct GUID *domain_guid,
1785
struct dns_rr_srv **dclist,
1788
/* The following definitions come from libads/kerberos.c */
1790
int kerberos_kinit_password_ext(const char *principal,
1791
const char *password,
1793
time_t *expire_time,
1794
time_t *renew_till_time,
1795
const char *cache_name,
1797
bool add_netbios_addr,
1798
time_t renewable_time,
1799
NTSTATUS *ntstatus);
1800
int ads_kinit_password(ADS_STRUCT *ads);
1801
int ads_kdestroy(const char *cc_name);
1802
char* kerberos_standard_des_salt( void );
1803
bool kerberos_secrets_store_des_salt( const char* salt );
1804
char* kerberos_secrets_fetch_des_salt( void );
1805
char *kerberos_get_default_realm_from_ccache( void );
1806
char *kerberos_get_realm_from_hostname(const char *hostname);
1808
bool kerberos_secrets_store_salting_principal(const char *service,
1810
const char *principal);
1811
int kerberos_kinit_password(const char *principal,
1812
const char *password,
1814
const char *cache_name);
1815
bool create_local_private_krb5_conf_for_domain(const char *realm,
1817
const char *sitename,
1818
struct sockaddr_storage *pss,
1819
const char *kdc_name);
1821
/* The following definitions come from libads/kerberos_keytab.c */
1823
int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc);
1824
int ads_keytab_flush(ADS_STRUCT *ads);
1825
int ads_keytab_create_default(ADS_STRUCT *ads);
1826
int ads_keytab_list(const char *keytab_name);
1828
/* The following definitions come from libads/kerberos_verify.c */
1830
NTSTATUS ads_verify_ticket(TALLOC_CTX *mem_ctx,
1833
const DATA_BLOB *ticket,
1835
struct PAC_DATA **pac_data,
1837
DATA_BLOB *session_key,
1838
bool use_replay_cache);
1840
/* The following definitions come from libads/krb5_errs.c */
1843
/* The following definitions come from libads/krb5_setpw.c */
1845
ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
1846
const char *newpw, int time_offset);
1847
ADS_STATUS kerberos_set_password(const char *kpasswd_server,
1848
const char *auth_principal, const char *auth_password,
1849
const char *target_principal, const char *new_password,
1851
ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
1852
const char *machine_account,
1853
const char *password);
1855
/* The following definitions come from libads/ldap.c */
1857
bool ads_sitename_match(ADS_STRUCT *ads);
1858
bool ads_closest_dc(ADS_STRUCT *ads);
1859
ADS_STATUS ads_connect(ADS_STRUCT *ads);
1860
ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
1861
ADS_STATUS ads_connect_gc(ADS_STRUCT *ads);
1862
void ads_disconnect(ADS_STRUCT *ads);
1863
ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
1864
int scope, const char *expr, const char **attrs,
1865
bool (*fn)(ADS_STRUCT *, char *, void **, void *),
1867
char *ads_parent_dn(const char *dn);
1868
ADS_MODLIST ads_init_mods(TALLOC_CTX *ctx);
1869
ADS_STATUS ads_mod_str(TALLOC_CTX *ctx, ADS_MODLIST *mods,
1870
const char *name, const char *val);
1871
ADS_STATUS ads_mod_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
1872
const char *name, const char **vals);
1873
ADS_STATUS ads_gen_mod(ADS_STRUCT *ads, const char *mod_dn, ADS_MODLIST mods);
1874
ADS_STATUS ads_gen_add(ADS_STRUCT *ads, const char *new_dn, ADS_MODLIST mods);
1875
ADS_STATUS ads_del_dn(ADS_STRUCT *ads, char *del_dn);
1876
char *ads_ou_string(ADS_STRUCT *ads, const char *org_unit);
1877
char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid);
1878
ADS_STATUS ads_add_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
1879
const char *name, const char **vals);
1880
uint32 ads_get_kvno(ADS_STRUCT *ads, const char *account_name);
1881
uint32_t ads_get_machine_kvno(ADS_STRUCT *ads, const char *machine_name);
1882
ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machine_name);
1883
ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_name,
1884
const char *my_fqdn, const char *spn);
1885
ADS_STATUS ads_create_machine_acct(ADS_STRUCT *ads, const char *machine_name,
1886
const char *org_unit);
1887
ADS_STATUS ads_move_machine_acct(ADS_STRUCT *ads, const char *machine_name,
1888
const char *org_unit, bool *moved);
1889
int ads_count_replies(ADS_STRUCT *ads, void *res);
1890
ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn);
1891
ADS_STATUS ads_current_time(ADS_STRUCT *ads);
1892
ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32 *val);
1893
ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, DOM_SID *sid);
1894
ADS_STATUS ads_site_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char **site_name);
1895
ADS_STATUS ads_site_dn_for_machine(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *computer_name, const char **site_dn);
1896
ADS_STATUS ads_upn_suffixes(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char ***suffixes, size_t *num_suffixes);
1897
ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
1898
TALLOC_CTX *mem_ctx,
1901
ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx,
1902
const char *extended_dn,
1903
enum ads_extended_dn_flags flags,
1905
char* ads_get_dnshostname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
1906
char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
1907
char* ads_get_samaccountname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
1908
ADS_STATUS ads_join_realm(ADS_STRUCT *ads, const char *machine_name,
1909
uint32 account_type, const char *org_unit);
1910
ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname);
1911
ADS_STATUS ads_find_samaccount(ADS_STRUCT *ads,
1912
TALLOC_CTX *mem_ctx,
1913
const char *samaccountname,
1915
const char **dn_ret);
1916
ADS_STATUS ads_config_path(ADS_STRUCT *ads,
1917
TALLOC_CTX *mem_ctx,
1918
char **config_path);
1919
const char *ads_get_extended_right_name_by_guid(ADS_STRUCT *ads,
1920
const char *config_path,
1921
TALLOC_CTX *mem_ctx,
1922
const struct GUID *rights_guid);
1923
ADS_STATUS ads_check_ou_dn(TALLOC_CTX *mem_ctx,
1925
const char **account_ou);
1927
/* The following definitions come from libads/ldap_printer.c */
1929
ADS_STATUS ads_mod_printer_entry(ADS_STRUCT *ads, char *prt_dn,
1930
TALLOC_CTX *ctx, const ADS_MODLIST *mods);
1931
ADS_STATUS ads_add_printer_entry(ADS_STRUCT *ads, char *prt_dn,
1932
TALLOC_CTX *ctx, ADS_MODLIST *mods);
1933
WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
1934
TALLOC_CTX *mem_ctx,
1936
const char *printer);
1937
bool get_local_printer_publishing_data(TALLOC_CTX *mem_ctx,
1939
NT_PRINTER_DATA *data);
1941
/* The following definitions come from libads/ldap_schema.c */
1943
ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
1944
const char *schema_path,
1945
const char **OIDs, size_t num_OIDs,
1946
char ***OIDs_out, char ***names, size_t *count);
1947
const char *ads_get_attrname_by_guid(ADS_STRUCT *ads,
1948
const char *schema_path,
1949
TALLOC_CTX *mem_ctx,
1950
const struct GUID *schema_guid);
1951
const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, const char *schema_path, TALLOC_CTX *mem_ctx, const char * OID);
1952
ADS_STATUS ads_schema_path(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char **schema_path);
1953
ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
1955
enum wb_posix_mapping map_type,
1956
struct posix_schema **s ) ;
1958
/* The following definitions come from libads/ldap_user.c */
1960
ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
1961
const char *container, const char *fullname);
1962
ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
1963
const char *container, const char *comment);
1965
/* The following definitions come from libads/ldap_utils.c */
1967
ADS_STATUS ads_ranged_search(ADS_STRUCT *ads,
1968
TALLOC_CTX *mem_ctx,
1973
const char *range_attr,
1975
size_t *num_strings);
1976
ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
1977
TALLOC_CTX *mem_ctx,
1983
const char *range_attr,
1985
size_t *num_strings,
1990
/* The following definitions come from libads/ndr.c */
1992
void ndr_print_ads_auth_flags(struct ndr_print *ndr, const char *name, uint32_t r);
1993
void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct ads_struct *r);
1995
/* The following definitions come from libads/sasl.c */
1997
ADS_STATUS ads_sasl_bind(ADS_STRUCT *ads);
1999
/* The following definitions come from libads/sasl_wrapping.c */
2001
ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads,
2002
const struct ads_saslwrap_ops *ops,
2003
void *private_data);
2004
ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads,
2005
const struct ads_saslwrap_ops *ops,
2006
void *private_data);
2008
/* The following definitions come from libads/util.c */
2010
ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_principal);
2011
ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads,
2012
char **returned_principal);
2014
/* The following definitions come from libgpo/gpo_filesync.c */
2016
NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx,
2017
struct cli_state *cli,
2018
const char *nt_path,
2019
const char *unix_path);
2020
NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx,
2021
struct cli_state *cli,
2022
const char *nt_path,
2023
const char *local_path);
2025
/* The following definitions come from libgpo/gpo_ini.c */
2027
NTSTATUS parse_gpt_ini(TALLOC_CTX *mem_ctx,
2028
const char *filename,
2030
char **display_name);
2032
/* The following definitions come from libgpo/gpo_reg.c */
2034
struct nt_user_token *registry_create_system_token(TALLOC_CTX *mem_ctx);
2035
WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx,
2036
const char *initial_path,
2037
uint32_t desired_access,
2038
const struct nt_user_token *token,
2039
struct gp_registry_context **reg_ctx);
2040
void gp_free_reg_ctx(struct gp_registry_context *reg_ctx);
2041
WERROR gp_store_reg_subkey(TALLOC_CTX *mem_ctx,
2042
const char *subkeyname,
2043
struct registry_key *curr_key,
2044
struct registry_key **new_key);
2045
WERROR gp_read_reg_subkey(TALLOC_CTX *mem_ctx,
2046
struct gp_registry_context *reg_ctx,
2047
const char *subkeyname,
2048
struct registry_key **key);
2049
WERROR gp_store_reg_val_sz(TALLOC_CTX *mem_ctx,
2050
struct registry_key *key,
2051
const char *val_name,
2053
WERROR gp_read_reg_val_sz(TALLOC_CTX *mem_ctx,
2054
struct registry_key *key,
2055
const char *val_name,
2057
WERROR gp_reg_state_store(TALLOC_CTX *mem_ctx,
2060
const struct nt_user_token *token,
2061
struct GROUP_POLICY_OBJECT *gpo_list);
2062
WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx,
2065
struct GROUP_POLICY_OBJECT **gpo_list);
2066
WERROR gp_secure_key(TALLOC_CTX *mem_ctx,
2068
struct registry_key *key,
2069
const DOM_SID *sid);
2070
void dump_reg_val(int lvl, const char *direction,
2071
const char *key, const char *subkey,
2072
struct registry_value *val);
2073
void dump_reg_entry(uint32_t flags,
2075
struct gp_registry_entry *entry);
2076
void dump_reg_entries(uint32_t flags,
2078
struct gp_registry_entry *entries,
2079
size_t num_entries);
2080
bool add_gp_registry_entry_to_array(TALLOC_CTX *mem_ctx,
2081
struct gp_registry_entry *entry,
2082
struct gp_registry_entry **entries,
2084
WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
2085
struct registry_key *root_key,
2086
struct gp_registry_context *reg_ctx,
2087
struct gp_registry_entry *entry,
2088
const struct nt_user_token *token,
2092
#include "librpc/gen_ndr/ndr_dfs.h"
2093
#include "librpc/gen_ndr/ndr_dssetup.h"
2094
#include "librpc/gen_ndr/ndr_echo.h"
2095
#include "librpc/gen_ndr/ndr_eventlog.h"
2096
#include "librpc/gen_ndr/ndr_krb5pac.h"
2097
#include "librpc/gen_ndr/ndr_lsa.h"
2098
#include "librpc/gen_ndr/ndr_misc.h"
2099
#include "librpc/gen_ndr/ndr_netlogon.h"
2100
#include "librpc/gen_ndr/ndr_notify.h"
2101
#include "librpc/gen_ndr/ndr_ntsvcs.h"
2102
#include "librpc/gen_ndr/ndr_samr.h"
2103
#include "librpc/gen_ndr/ndr_security.h"
2104
#include "librpc/gen_ndr/ndr_srvsvc.h"
2105
#include "librpc/gen_ndr/ndr_svcctl.h"
2106
#include "librpc/gen_ndr/ndr_winreg.h"
2107
#include "librpc/gen_ndr/ndr_wkssvc.h"
2108
#include "librpc/gen_ndr/ndr_drsuapi.h"
2109
#include "librpc/gen_ndr/ndr_spoolss.h"
2110
#include "librpc/gen_ndr/ndr_initshutdown.h"
2112
#include "librpc/ndr/libndr.h"
2114
/* The following definitions come from librpc/ndr/util.c */
2116
enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
2117
enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r);
2118
void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r);
2119
enum ndr_err_code ndr_push_file_id(struct ndr_push *ndr, int ndr_flags, const struct file_id *r);
2120
enum ndr_err_code ndr_pull_file_id(struct ndr_pull *ndr, int ndr_flags, struct file_id *r);
2121
void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct file_id *r);
2122
_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
2123
_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
2124
const char *ndr_errstr(enum ndr_err_code err);
2125
extern const struct ndr_syntax_id null_ndr_syntax_id;
2127
/* The following definitions come from librpc/ndr/sid.c */
2129
char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
2131
/* The following definitions come from librpc/rpc/binding.c */
2133
const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
2134
_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b);
2135
_PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out);
2136
_PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
2137
struct ndr_syntax_id *syntax);
2138
const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
2139
enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot);
2140
_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower);
2141
_PUBLIC_ const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t);
2142
_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
2143
struct epm_tower *tower,
2144
struct dcerpc_binding **b_out);
2145
_PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
2146
const struct dcerpc_binding *binding,
2147
struct epm_tower *tower);
2149
/* The following definitions come from librpc/rpc/dcerpc.c */
2151
struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p, const struct GUID *object,
2152
const struct ndr_interface_table *table, uint32_t opnum,
2153
TALLOC_CTX *mem_ctx, void *r);
2154
NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req);
2155
_PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, struct dcerpc_pipe **pp,
2156
const char *binding_string, const struct ndr_interface_table *table,
2157
struct cli_credentials *credentials, struct event_context *ev,
2158
struct loadparm_context *lp_ctx);
2160
/* The following definitions come from libsmb/cliconnect.c */
2162
ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
2163
const char *pass, const char *user_domain,
2164
const char * dest_realm);
2166
NTSTATUS cli_session_setup(struct cli_state *cli,
2168
const char *pass, int passlen,
2169
const char *ntpass, int ntpasslen,
2170
const char *workgroup);
2171
struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
2172
struct event_context *ev,
2173
struct cli_state *cli,
2174
struct tevent_req **psmbreq);
2175
struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
2176
struct event_context *ev,
2177
struct cli_state *cli);
2178
NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
2179
bool cli_ulogoff(struct cli_state *cli);
2180
struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
2181
struct event_context *ev,
2182
struct cli_state *cli,
2183
const char *share, const char *dev,
2184
const char *pass, int passlen,
2185
struct tevent_req **psmbreq);
2186
struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
2187
struct event_context *ev,
2188
struct cli_state *cli,
2189
const char *share, const char *dev,
2190
const char *pass, int passlen);
2191
NTSTATUS cli_tcon_andx_recv(struct tevent_req *req);
2192
NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
2193
const char *dev, const char *pass, int passlen);
2194
bool cli_tdis(struct cli_state *cli);
2195
void cli_negprot_sendsync(struct cli_state *cli);
2196
NTSTATUS cli_negprot(struct cli_state *cli);
2197
struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
2198
struct event_context *ev,
2199
struct cli_state *cli);
2200
NTSTATUS cli_negprot_recv(struct tevent_req *req);
2201
bool cli_session_request(struct cli_state *cli,
2202
struct nmb_name *calling, struct nmb_name *called);
2203
NTSTATUS cli_connect(struct cli_state *cli,
2205
struct sockaddr_storage *dest_ss);
2206
NTSTATUS cli_start_connection(struct cli_state **output_cli,
2207
const char *my_name,
2208
const char *dest_host,
2209
struct sockaddr_storage *dest_ss, int port,
2210
int signing_state, int flags,
2212
NTSTATUS cli_full_connection(struct cli_state **output_cli,
2213
const char *my_name,
2214
const char *dest_host,
2215
struct sockaddr_storage *dest_ss, int port,
2216
const char *service, const char *service_type,
2217
const char *user, const char *domain,
2218
const char *password, int flags,
2221
bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost,
2222
struct sockaddr_storage *pdest_ss);
2223
NTSTATUS cli_raw_tcon(struct cli_state *cli,
2224
const char *service, const char *pass, const char *dev,
2225
uint16 *max_xmit, uint16 *tid);
2226
struct cli_state *get_ipc_connect(char *server,
2227
struct sockaddr_storage *server_ss,
2228
const struct user_auth_info *user_info);
2229
struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
2230
struct ip_service *mb_ip,
2231
const struct user_auth_info *user_info,
2232
char **pp_workgroup_out);
2233
struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx,
2234
const struct user_auth_info *user_info,
2235
char **pp_workgroup_out);
2237
/* The following definitions come from libsmb/clidfs.c */
2239
NTSTATUS cli_cm_force_encryption(struct cli_state *c,
2240
const char *username,
2241
const char *password,
2243
const char *sharename);
2244
struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
2245
struct cli_state *referring_cli,
2248
const struct user_auth_info *auth_info,
2254
void cli_cm_display(const struct cli_state *c);
2255
bool cli_dfs_get_referral(TALLOC_CTX *ctx,
2256
struct cli_state *cli,
2258
CLIENT_DFS_REFERRAL**refs,
2261
bool cli_resolve_path(TALLOC_CTX *ctx,
2262
const char *mountpt,
2263
const struct user_auth_info *dfs_auth_info,
2264
struct cli_state *rootcli,
2266
struct cli_state **targetcli,
2267
char **pp_targetpath);
2269
bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
2270
struct cli_state *cli,
2271
const char *sharename,
2272
char **pp_newserver,
2275
const char *username,
2276
const char *password,
2277
const char *domain);
2278
/* The following definitions come from libsmb/clidgram.c */
2280
bool send_getdc_request(TALLOC_CTX *mem_ctx,
2281
struct messaging_context *msg_ctx,
2282
struct sockaddr_storage *dc_ss,
2283
const char *domain_name,
2285
uint32_t nt_version);
2286
bool receive_getdc_response(TALLOC_CTX *mem_ctx,
2287
struct sockaddr_storage *dc_ss,
2288
const char *domain_name,
2289
uint32_t *nt_version,
2290
const char **dc_name,
2291
struct netlogon_samlogon_response **reply);
2293
/* The following definitions come from libsmb/clientgen.c */
2295
int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
2296
unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
2297
void cli_set_port(struct cli_state *cli, int port);
2298
bool cli_state_seqnum_persistent(struct cli_state *cli,
2300
bool cli_state_seqnum_remove(struct cli_state *cli,
2302
bool cli_receive_smb(struct cli_state *cli);
2303
ssize_t cli_receive_smb_data(struct cli_state *cli, char *buffer, size_t len);
2304
bool cli_receive_smb_readX_header(struct cli_state *cli);
2305
bool cli_send_smb(struct cli_state *cli);
2306
bool cli_send_smb_direct_writeX(struct cli_state *cli,
2309
void cli_setup_packet_buf(struct cli_state *cli, char *buf);
2310
void cli_setup_packet(struct cli_state *cli);
2311
void cli_setup_bcc(struct cli_state *cli, void *p);
2312
NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
2313
NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
2314
NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
2315
NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
2316
struct cli_state *cli_initialise(void);
2317
struct cli_state *cli_initialise_ex(int signing_state);
2318
void cli_nt_pipes_close(struct cli_state *cli);
2319
void cli_shutdown(struct cli_state *cli);
2320
void cli_sockopt(struct cli_state *cli, const char *options);
2321
uint16 cli_setpid(struct cli_state *cli, uint16 pid);
2322
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
2323
bool cli_send_keepalive(struct cli_state *cli);
2324
struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
2325
struct cli_state *cli, uint16_t num_echos,
2327
NTSTATUS cli_echo_recv(struct tevent_req *req);
2328
NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
2329
bool cli_ucs2(struct cli_state *cli);
2330
bool is_andx_req(uint8_t cmd);
2332
/* The following definitions come from libsmb/clierror.c */
2334
const char *cli_errstr(struct cli_state *cli);
2335
NTSTATUS cli_nt_error(struct cli_state *cli);
2336
void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode);
2337
int cli_errno(struct cli_state *cli);
2338
bool cli_is_error(struct cli_state *cli);
2339
bool cli_is_nt_error(struct cli_state *cli);
2340
bool cli_is_dos_error(struct cli_state *cli);
2341
NTSTATUS cli_get_nt_error(struct cli_state *cli);
2342
void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
2343
void cli_reset_error(struct cli_state *cli);
2344
bool cli_state_is_connected(struct cli_state *cli);
2346
/* The following definitions come from libsmb/clifile.c */
2348
struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
2349
struct event_context *ev,
2350
struct cli_state *cli,
2351
const char *oldname,
2352
const char *newname);
2353
NTSTATUS cli_posix_symlink_recv(struct tevent_req *req);
2354
NTSTATUS cli_posix_symlink(struct cli_state *cli,
2355
const char *oldname,
2356
const char *newname);
2357
struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
2358
struct event_context *ev,
2359
struct cli_state *cli,
2362
NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
2363
char *retpath, size_t len);
2364
NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
2365
char *linkpath, size_t len);
2366
struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
2367
struct event_context *ev,
2368
struct cli_state *cli,
2369
const char *oldname,
2370
const char *newname);
2371
NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req);
2372
NTSTATUS cli_posix_hardlink(struct cli_state *cli,
2373
const char *oldname,
2374
const char *newname);
2375
uint32_t unix_perms_to_wire(mode_t perms);
2376
mode_t wire_perms_to_unix(uint32_t perms);
2377
struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
2378
struct event_context *ev,
2379
struct cli_state *cli,
2381
NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
2382
TALLOC_CTX *mem_ctx,
2385
NTSTATUS cli_posix_getfacl(struct cli_state *cli,
2387
TALLOC_CTX *mem_ctx,
2390
struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
2391
struct event_context *ev,
2392
struct cli_state *cli,
2394
NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
2395
SMB_STRUCT_STAT *sbuf);
2396
NTSTATUS cli_posix_stat(struct cli_state *cli,
2398
SMB_STRUCT_STAT *sbuf);
2399
struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
2400
struct event_context *ev,
2401
struct cli_state *cli,
2404
NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
2405
NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
2406
struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
2407
struct event_context *ev,
2408
struct cli_state *cli,
2412
NTSTATUS cli_posix_chown_recv(struct tevent_req *req);
2413
NTSTATUS cli_posix_chown(struct cli_state *cli,
2417
struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
2418
struct event_context *ev,
2419
struct cli_state *cli,
2420
const char *fname_src,
2421
const char *fname_dst);
2422
NTSTATUS cli_rename_recv(struct tevent_req *req);
2423
NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
2424
struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
2425
struct event_context *ev,
2426
struct cli_state *cli,
2427
const char *fname_src,
2428
const char *fname_dst);
2429
NTSTATUS cli_ntrename_recv(struct tevent_req *req);
2430
NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
2432
struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
2433
struct event_context *ev,
2434
struct cli_state *cli,
2435
const char *fname_src,
2436
const char *fname_dst);
2437
NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
2438
NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
2440
struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
2441
struct event_context *ev,
2442
struct cli_state *cli,
2444
uint16_t mayhave_attrs);
2445
NTSTATUS cli_unlink_recv(struct tevent_req *req);
2446
NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
2448
struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
2449
struct event_context *ev,
2450
struct cli_state *cli,
2452
NTSTATUS cli_mkdir_recv(struct tevent_req *req);
2453
NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
2454
struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
2455
struct event_context *ev,
2456
struct cli_state *cli,
2458
NTSTATUS cli_rmdir_recv(struct tevent_req *req);
2459
NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
2460
struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
2461
struct event_context *ev,
2462
struct cli_state *cli,
2465
NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req);
2466
NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
2467
struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
2468
struct event_context *ev,
2469
struct cli_state *cli,
2471
uint32_t CreatFlags,
2472
uint32_t DesiredAccess,
2473
uint32_t FileAttributes,
2474
uint32_t ShareAccess,
2475
uint32_t CreateDisposition,
2476
uint32_t CreateOptions,
2477
uint8_t SecurityFlags);
2478
NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
2479
NTSTATUS cli_ntcreate(struct cli_state *cli,
2481
uint32_t CreatFlags,
2482
uint32_t DesiredAccess,
2483
uint32_t FileAttributes,
2484
uint32_t ShareAccess,
2485
uint32_t CreateDisposition,
2486
uint32_t CreateOptions,
2487
uint8_t SecurityFlags,
2489
uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
2490
size_t str_len, size_t *pconverted_size);
2491
struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
2492
struct event_context *ev,
2493
struct cli_state *cli, const char *fname,
2494
int flags, int share_mode,
2495
struct tevent_req **psmbreq);
2496
struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
2497
struct cli_state *cli, const char *fname,
2498
int flags, int share_mode);
2499
NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
2500
NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
2501
struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
2502
struct event_context *ev,
2503
struct cli_state *cli, uint16_t fnum,
2504
struct tevent_req **psubreq);
2505
struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
2506
struct event_context *ev,
2507
struct cli_state *cli, uint16_t fnum);
2508
NTSTATUS cli_close_recv(struct tevent_req *req);
2509
NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
2510
struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
2511
struct event_context *ev,
2512
struct cli_state *cli,
2515
NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
2516
NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
2517
NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
2518
uint32_t offset, uint32_t len,
2519
int timeout, unsigned char locktype);
2520
bool cli_lock(struct cli_state *cli, uint16_t fnum,
2521
uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
2522
struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
2523
struct event_context *ev,
2524
struct cli_state *cli,
2528
NTSTATUS cli_unlock_recv(struct tevent_req *req);
2529
NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
2530
bool cli_lock64(struct cli_state *cli, uint16_t fnum,
2531
uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
2532
struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
2533
struct event_context *ev,
2534
struct cli_state *cli,
2538
NTSTATUS cli_unlock64_recv(struct tevent_req *req);
2539
NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
2540
struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
2541
struct event_context *ev,
2542
struct cli_state *cli,
2547
enum brl_type lock_type);
2548
NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
2549
NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
2550
uint64_t offset, uint64_t len,
2551
bool wait_lock, enum brl_type lock_type);
2552
struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
2553
struct event_context *ev,
2554
struct cli_state *cli,
2558
NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
2559
NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
2560
struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
2561
struct event_context *ev,
2562
struct cli_state *cli,
2564
NTSTATUS cli_getattrE_recv(struct tevent_req *req,
2567
time_t *change_time,
2568
time_t *access_time,
2569
time_t *write_time);
2570
NTSTATUS cli_getattrE(struct cli_state *cli,
2574
time_t *change_time,
2575
time_t *access_time,
2576
time_t *write_time);
2577
struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
2578
struct event_context *ev,
2579
struct cli_state *cli,
2584
NTSTATUS cli_setattrE_recv(struct tevent_req *req);
2585
NTSTATUS cli_setattrE(struct cli_state *cli,
2590
struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
2591
struct event_context *ev,
2592
struct cli_state *cli,
2594
NTSTATUS cli_getatr_recv(struct tevent_req *req,
2597
time_t *write_time);
2598
NTSTATUS cli_getatr(struct cli_state *cli,
2602
time_t *write_time);
2603
struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
2604
struct event_context *ev,
2605
struct cli_state *cli,
2609
NTSTATUS cli_setatr_recv(struct tevent_req *req);
2610
NTSTATUS cli_setatr(struct cli_state *cli,
2614
struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
2615
struct event_context *ev,
2616
struct cli_state *cli,
2618
NTSTATUS cli_chkpath_recv(struct tevent_req *req);
2619
NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
2620
struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
2621
struct event_context *ev,
2622
struct cli_state *cli);
2623
NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
2625
NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
2626
struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
2627
struct event_context *ev,
2628
struct cli_state *cli,
2630
NTSTATUS cli_ctemp_recv(struct tevent_req *req,
2634
NTSTATUS cli_ctemp(struct cli_state *cli,
2639
NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
2640
bool cli_set_ea_path(struct cli_state *cli, const char *path, const char *ea_name, const char *ea_val, size_t ea_len);
2641
bool cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum, const char *ea_name, const char *ea_val, size_t ea_len);
2642
bool cli_get_ea_list_path(struct cli_state *cli, const char *path,
2645
struct ea_struct **pea_list);
2646
bool cli_get_ea_list_fnum(struct cli_state *cli, uint16_t fnum,
2649
struct ea_struct **pea_list);
2650
struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx,
2651
struct event_context *ev,
2652
struct cli_state *cli,
2656
NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum);
2657
NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
2658
int flags, mode_t mode, uint16_t *fnum);
2659
struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
2660
struct event_context *ev,
2661
struct cli_state *cli,
2664
NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req);
2665
NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
2667
struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
2668
struct event_context *ev,
2669
struct cli_state *cli,
2671
NTSTATUS cli_posix_unlink_recv(struct tevent_req *req);
2672
NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
2674
struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
2675
struct event_context *ev,
2676
struct cli_state *cli,
2678
NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2679
NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
2680
struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
2681
struct tevent_context *ev,
2682
struct cli_state *cli, uint16_t fnum,
2683
uint32_t buffer_size,
2684
uint32_t completion_filter, bool recursive);
2685
NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
2686
uint32_t *pnum_changes,
2687
struct notify_change **pchanges);
2689
/* The following definitions come from libsmb/clifsinfo.c */
2691
struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx,
2692
struct tevent_context *ev,
2693
struct cli_state *cli);
2694
NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req,
2695
uint16_t *pmajor, uint16_t *pminor,
2697
uint32_t *pcaphigh);
2698
NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
2699
uint16 *pminor, uint32 *pcaplow,
2701
bool cli_set_unix_extensions_capabilities(struct cli_state *cli, uint16 major, uint16 minor,
2702
uint32 caplow, uint32 caphigh);
2703
bool cli_get_fs_attr_info(struct cli_state *cli, uint32 *fs_attr);
2704
bool cli_get_fs_volume_info_old(struct cli_state *cli, fstring volume_name, uint32 *pserial_number);
2705
bool cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name, uint32 *pserial_number, time_t *pdate);
2706
bool cli_get_fs_full_size_info(struct cli_state *cli,
2707
uint64_t *total_allocation_units,
2708
uint64_t *caller_allocation_units,
2709
uint64_t *actual_allocation_units,
2710
uint64_t *sectors_per_allocation_unit,
2711
uint64_t *bytes_per_sector);
2712
bool cli_get_posix_fs_info(struct cli_state *cli,
2713
uint32 *optimal_transfer_size,
2715
uint64_t *total_blocks,
2716
uint64_t *blocks_available,
2717
uint64_t *user_blocks_available,
2718
uint64_t *total_file_nodes,
2719
uint64_t *free_file_nodes,
2720
uint64_t *fs_identifier);
2721
NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
2724
const char *domain);
2725
NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
2726
NTSTATUS cli_force_encryption(struct cli_state *c,
2727
const char *username,
2728
const char *password,
2729
const char *domain);
2731
/* The following definitions come from libsmb/clikrb5.c */
2733
bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx,
2735
DATA_BLOB *edata_out);
2736
bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data);
2738
/* The following definitions come from libsmb/clilist.c */
2740
int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
2741
void (*fn)(const char *, file_info *, const char *, void *), void *state);
2742
int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
2743
void (*fn)(const char *, file_info *, const char *, void *), void *state);
2744
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
2745
void (*fn)(const char *, file_info *, const char *, void *), void *state);
2747
/* The following definitions come from libsmb/climessage.c */
2749
struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx,
2750
struct tevent_context *ev,
2751
struct cli_state *cli,
2752
const char *host, const char *username,
2753
const char *message);
2754
NTSTATUS cli_message_recv(struct tevent_req *req);
2755
NTSTATUS cli_message(struct cli_state *cli, const char *host,
2756
const char *username, const char *message);
2758
/* The following definitions come from libsmb/clioplock.c */
2760
struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
2761
struct tevent_context *ev,
2762
struct cli_state *cli,
2763
uint16_t fnum, uint8_t level);
2764
NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
2765
NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
2766
void cli_oplock_handler(struct cli_state *cli,
2767
NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
2769
/* The following definitions come from libsmb/cliprint.c */
2771
int cli_print_queue(struct cli_state *cli,
2772
void (*fn)(struct print_job_info *));
2773
int cli_printjob_del(struct cli_state *cli, int job);
2774
int cli_spl_open(struct cli_state *cli, const char *fname, int flags, int share_mode);
2775
bool cli_spl_close(struct cli_state *cli, uint16_t fnum);
2777
/* The following definitions come from libsmb/cliquota.c */
2779
NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
2780
void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
2781
bool cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
2782
bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
2783
bool cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST **pqt_list);
2784
bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
2785
bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
2786
void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric));
2787
void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric));
2789
/* The following definitions come from libsmb/clirap.c */
2791
bool cli_api(struct cli_state *cli,
2792
char *param, int prcnt, int mprcnt,
2793
char *data, int drcnt, int mdrcnt,
2794
char **rparam, unsigned int *rprcnt,
2795
char **rdata, unsigned int *rdrcnt);
2796
bool cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
2797
int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *, void *), void *state);
2798
bool cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
2799
void (*fn)(const char *, uint32, const char *, void *),
2801
bool cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
2802
const char *old_password);
2803
bool cli_qpathinfo(struct cli_state *cli,
2805
time_t *change_time,
2806
time_t *access_time,
2810
bool cli_setpathinfo(struct cli_state *cli, const char *fname,
2816
bool cli_qpathinfo2(struct cli_state *cli, const char *fname,
2817
struct timespec *create_time,
2818
struct timespec *access_time,
2819
struct timespec *write_time,
2820
struct timespec *change_time,
2821
SMB_OFF_T *size, uint16 *mode,
2823
bool cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
2824
TALLOC_CTX *mem_ctx,
2825
unsigned int *pnum_streams,
2826
struct stream_struct **pstreams);
2827
bool cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name, size_t namelen);
2828
bool cli_qfileinfo(struct cli_state *cli, uint16_t fnum,
2829
uint16 *mode, SMB_OFF_T *size,
2830
struct timespec *create_time,
2831
struct timespec *access_time,
2832
struct timespec *write_time,
2833
struct timespec *change_time,
2835
bool cli_qpathinfo_basic( struct cli_state *cli, const char *name,
2836
SMB_STRUCT_STAT *sbuf, uint32 *attributes );
2837
bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **poutdata, uint32 *poutlen);
2838
NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
2840
/* The following definitions come from libsmb/clirap2.c */
2842
int cli_NetGroupDelete(struct cli_state *cli, const char *group_name);
2843
int cli_NetGroupAdd(struct cli_state *cli, RAP_GROUP_INFO_1 *grinfo);
2844
int cli_RNetGroupEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
2845
int cli_RNetGroupEnum0(struct cli_state *cli,
2846
void (*fn)(const char *, void *),
2848
int cli_NetGroupDelUser(struct cli_state * cli, const char *group_name, const char *user_name);
2849
int cli_NetGroupAddUser(struct cli_state * cli, const char *group_name, const char *user_name);
2850
int cli_NetGroupGetUsers(struct cli_state * cli, const char *group_name, void (*fn)(const char *, void *), void *state );
2851
int cli_NetUserGetGroups(struct cli_state * cli, const char *user_name, void (*fn)(const char *, void *), void *state );
2852
int cli_NetUserDelete(struct cli_state *cli, const char * user_name );
2853
int cli_NetUserAdd(struct cli_state *cli, RAP_USER_INFO_1 * userinfo );
2854
int cli_RNetUserEnum(struct cli_state *cli, void (*fn)(const char *, const char *, const char *, const char *, void *), void *state);
2855
int cli_RNetUserEnum0(struct cli_state *cli,
2856
void (*fn)(const char *, void *),
2858
int cli_NetFileClose(struct cli_state *cli, uint32 file_id );
2859
int cli_NetFileGetInfo(struct cli_state *cli, uint32 file_id, void (*fn)(const char *, const char *, uint16, uint16, uint32));
2860
int cli_NetFileEnum(struct cli_state *cli, const char * user,
2861
const char * base_path,
2862
void (*fn)(const char *, const char *, uint16, uint16,
2864
int cli_NetShareAdd(struct cli_state *cli, RAP_SHARE_INFO_2 * sinfo );
2865
int cli_NetShareDelete(struct cli_state *cli, const char * share_name );
2866
bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_name);
2867
bool cli_get_server_domain(struct cli_state *cli);
2868
bool cli_get_server_type(struct cli_state *cli, uint32 *pstype);
2869
bool cli_get_server_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
2871
bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 stype);
2872
bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation);
2873
int cli_NetPrintQEnum(struct cli_state *cli,
2874
void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
2875
void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint_t,uint_t,const char*));
2876
int cli_NetPrintQGetInfo(struct cli_state *cli, const char *printer,
2877
void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
2878
void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint_t,uint_t,const char*));
2879
int cli_RNetServiceEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
2880
int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, uint_t, uint_t, uint_t, char *));
2881
int cli_NetSessionGetInfo(struct cli_state *cli, const char *workstation,
2882
void (*fn)(const char *, const char *, uint16, uint16, uint16, uint_t, uint_t, uint_t, const char *));
2883
int cli_NetSessionDel(struct cli_state *cli, const char *workstation);
2884
int cli_NetConnectionEnum(struct cli_state *cli, const char *qualifier,
2885
void (*fn)(uint16_t conid, uint16_t contype,
2886
uint16_t numopens, uint16_t numusers,
2887
uint32_t contime, const char *username,
2888
const char *netname));
2890
/* The following definitions come from libsmb/clireadwrite.c */
2892
struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
2893
struct event_context *ev,
2894
struct cli_state *cli, uint16_t fnum,
2895
off_t offset, size_t size,
2896
struct tevent_req **psmbreq);
2897
struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
2898
struct event_context *ev,
2899
struct cli_state *cli, uint16_t fnum,
2900
off_t offset, size_t size);
2901
NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
2903
struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
2904
struct event_context *ev,
2905
struct cli_state *cli,
2906
uint16_t fnum, off_t start_offset,
2907
SMB_OFF_T size, size_t window_size,
2908
NTSTATUS (*sink)(char *buf, size_t n,
2911
NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
2912
NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
2913
off_t start_offset, SMB_OFF_T size, size_t window_size,
2914
NTSTATUS (*sink)(char *buf, size_t n, void *priv),
2915
void *priv, SMB_OFF_T *received);
2916
ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
2917
off_t offset, size_t size);
2918
ssize_t cli_readraw(struct cli_state *cli, uint16_t fnum, char *buf, off_t offset, size_t size);
2919
ssize_t cli_write(struct cli_state *cli,
2920
uint16_t fnum, uint16 write_mode,
2921
const char *buf, off_t offset, size_t size);
2922
ssize_t cli_smbwrite(struct cli_state *cli,
2923
uint16_t fnum, char *buf, off_t offset, size_t size1);
2924
struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
2925
struct event_context *ev,
2926
struct cli_state *cli, uint16_t fnum,
2927
uint16_t mode, const uint8_t *buf,
2928
off_t offset, size_t size,
2929
struct tevent_req **reqs_before,
2930
int num_reqs_before,
2931
struct tevent_req **psmbreq);
2932
struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
2933
struct event_context *ev,
2934
struct cli_state *cli, uint16_t fnum,
2935
uint16_t mode, const uint8_t *buf,
2936
off_t offset, size_t size);
2937
NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
2939
struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
2940
struct cli_state *cli,
2941
uint16_t fnum, uint16_t mode,
2942
off_t start_offset, size_t window_size,
2943
size_t (*source)(uint8_t *buf, size_t n,
2946
NTSTATUS cli_push_recv(struct tevent_req *req);
2947
NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
2948
off_t start_offset, size_t window_size,
2949
size_t (*source)(uint8_t *buf, size_t n, void *priv),
2952
/* The following definitions come from libsmb/clisecdesc.c */
2954
SEC_DESC *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
2955
TALLOC_CTX *mem_ctx);
2956
bool cli_set_secdesc(struct cli_state *cli, uint16_t fnum, SEC_DESC *sd);
2958
1082
/* The following definitions come from libsmb/clispnego.c */
2960
DATA_BLOB spnego_gen_negTokenInit(char guid[16],
1084
DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,
1086
DATA_BLOB *psecblob,
2962
1087
const char *principal);
2963
DATA_BLOB gen_negTokenInit(const char *OID, DATA_BLOB blob);
2964
bool spnego_parse_negTokenInit(DATA_BLOB blob,
1089
#ifndef ASN1_MAX_OIDS
1090
#define ASN1_MAX_OIDS 20
1092
bool spnego_parse_negTokenInit(TALLOC_CTX *ctx,
2965
1094
char *OIDs[ASN1_MAX_OIDS],
2967
DATA_BLOB gen_negTokenTarg(const char *OIDs[], DATA_BLOB blob);
2968
bool parse_negTokenTarg(DATA_BLOB blob, char *OIDs[ASN1_MAX_OIDS], DATA_BLOB *secblob);
2969
DATA_BLOB spnego_gen_krb5_wrap(const DATA_BLOB ticket, const uint8 tok_id[2]);
2970
bool spnego_parse_krb5_wrap(DATA_BLOB blob, DATA_BLOB *ticket, uint8 tok_id[2]);
2971
int spnego_gen_negTokenTarg(const char *principal, int time_offset,
1096
DATA_BLOB *secblob);
1097
DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const uint8 tok_id[2]);
1098
bool spnego_parse_krb5_wrap(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *ticket, uint8 tok_id[2]);
1099
int spnego_gen_krb5_negTokenInit(TALLOC_CTX *ctx,
1100
const char *principal, int time_offset,
2973
1102
DATA_BLOB *session_key_krb5, uint32 extra_ap_opts,
2974
1103
time_t *expire_time);
2975
bool spnego_parse_challenge(const DATA_BLOB blob,
1104
bool spnego_parse_challenge(TALLOC_CTX *ctx, const DATA_BLOB blob,
2976
1105
DATA_BLOB *chal1, DATA_BLOB *chal2);
2977
DATA_BLOB spnego_gen_auth(DATA_BLOB blob);
2978
bool spnego_parse_auth(DATA_BLOB blob, DATA_BLOB *auth);
2979
DATA_BLOB spnego_gen_auth_response(DATA_BLOB *reply, NTSTATUS nt_status,
1106
DATA_BLOB spnego_gen_auth(TALLOC_CTX *ctx, DATA_BLOB blob);
1107
bool spnego_parse_auth(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *auth);
1108
DATA_BLOB spnego_gen_auth_response(TALLOC_CTX *ctx, DATA_BLOB *reply, NTSTATUS nt_status,
2980
1109
const char *mechOID);
2981
bool spnego_parse_auth_response(DATA_BLOB blob, NTSTATUS nt_status,
1110
bool spnego_parse_auth_response(TALLOC_CTX *ctx,
1111
DATA_BLOB blob, NTSTATUS nt_status,
2982
1112
const char *mechOID,
2983
1113
DATA_BLOB *auth);
2985
/* The following definitions come from libsmb/clistr.c */
2987
size_t clistr_push_fn(const char *function,
2989
struct cli_state *cli,
2994
size_t clistr_pull_fn(const char *function,
3002
size_t clistr_pull_talloc_fn(const char *function,
3010
size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
3011
size_t clistr_align_in(struct cli_state *cli, const void *p, int flags);
3013
/* The following definitions come from libsmb/clitrans.c */
3015
bool cli_send_trans(struct cli_state *cli, int trans,
3016
const char *pipe_name,
3018
uint16 *setup, unsigned int lsetup, unsigned int msetup,
3019
const char *param, unsigned int lparam, unsigned int mparam,
3020
const char *data, unsigned int ldata, unsigned int mdata);
3021
bool cli_receive_trans(struct cli_state *cli,int trans,
3022
char **param, unsigned int *param_len,
3023
char **data, unsigned int *data_len);
3024
bool cli_send_nt_trans(struct cli_state *cli,
3027
uint16 *setup, unsigned int lsetup, unsigned int msetup,
3028
char *param, unsigned int lparam, unsigned int mparam,
3029
char *data, unsigned int ldata, unsigned int mdata);
3030
bool cli_receive_nt_trans(struct cli_state *cli,
3031
char **param, unsigned int *param_len,
3032
char **data, unsigned int *data_len);
3033
struct tevent_req *cli_trans_send(
3034
TALLOC_CTX *mem_ctx, struct event_context *ev,
3035
struct cli_state *cli, uint8_t cmd,
3036
const char *pipe_name, uint16_t fid, uint16_t function, int flags,
3037
uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
3038
uint8_t *param, uint32_t num_param, uint32_t max_param,
3039
uint8_t *data, uint32_t num_data, uint32_t max_data);
3040
NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
3041
uint16_t **setup, uint8_t *num_setup,
3042
uint8_t **param, uint32_t *num_param,
3043
uint8_t **data, uint32_t *num_data);
3044
NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
3046
const char *pipe_name, uint16_t fid, uint16_t function,
3048
uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
3049
uint8_t *param, uint32_t num_param, uint32_t max_param,
3050
uint8_t *data, uint32_t num_data, uint32_t max_data,
3051
uint16_t **rsetup, uint8_t *num_rsetup,
3052
uint8_t **rparam, uint32_t *num_rparam,
3053
uint8_t **rdata, uint32_t *num_rdata);
1115
bool spnego_parse_auth_and_mic(TALLOC_CTX *ctx, DATA_BLOB blob,
1116
DATA_BLOB *auth, DATA_BLOB *signature);
1117
DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx,
1119
const char *mechOID,
1121
DATA_BLOB *mechlistMIC);
1122
bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx,
1123
char **oid_list, DATA_BLOB *data);
3055
1125
/* The following definitions come from libsmb/conncache.c */
3057
NTSTATUS check_negative_conn_cache_timeout( const char *domain, const char *server, unsigned int failed_cache_timeout );
3058
1127
NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
3059
1128
void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ;
3060
1129
void flush_negative_conn_cache_for_domain(const char *domain);
3062
/* The following definitions come from ../librpc/rpc/dcerpc_error.c */
3064
const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code);
3066
1131
/* The following definitions come from libsmb/dsgetdcname.c */
1133
struct netr_DsRGetDCNameInfo;
3068
1135
void debug_dsdcinfo_flags(int lvl, uint32_t flags);
3069
1136
NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
3070
1137
struct messaging_context *msg_ctx,
3344
1332
const char *domain) ;
3345
1333
bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
3346
1334
char ***domain_names, uint32 *num_domains,
3349
/* The following definitions come from libsmb/unexpected.c */
3351
void unexpected_packet(struct packet_struct *p);
3352
void clear_unexpected(time_t t);
3353
struct packet_struct *receive_unexpected(enum packet_type packet_type, int id,
3354
const char *mailslot_name);
3356
/* The following definitions come from locking/brlock.c */
3358
bool brl_same_context(const struct lock_context *ctx1,
3359
const struct lock_context *ctx2);
3360
NTSTATUS brl_lock_failed(files_struct *fsp, const struct lock_struct *lock, bool blocking_lock);
3361
void brl_init(bool read_only);
3362
void brl_shutdown(void);
3364
NTSTATUS brl_lock_windows_default(struct byte_range_lock *br_lck,
3365
struct lock_struct *plock,
3366
bool blocking_lock);
3368
NTSTATUS brl_lock(struct messaging_context *msg_ctx,
3369
struct byte_range_lock *br_lck,
3371
struct server_id pid,
3374
enum brl_type lock_type,
3375
enum brl_flavour lock_flav,
3378
struct blocking_lock_record *blr);
3379
bool brl_unlock(struct messaging_context *msg_ctx,
3380
struct byte_range_lock *br_lck,
3382
struct server_id pid,
3385
enum brl_flavour lock_flav);
3386
bool brl_unlock_windows_default(struct messaging_context *msg_ctx,
3387
struct byte_range_lock *br_lck,
3388
const struct lock_struct *plock);
3389
bool brl_locktest(struct byte_range_lock *br_lck,
3391
struct server_id pid,
3394
enum brl_type lock_type,
3395
enum brl_flavour lock_flav);
3396
NTSTATUS brl_lockquery(struct byte_range_lock *br_lck,
3398
struct server_id pid,
3401
enum brl_type *plock_type,
3402
enum brl_flavour lock_flav);
3403
bool brl_lock_cancel(struct byte_range_lock *br_lck,
3405
struct server_id pid,
3408
enum brl_flavour lock_flav,
3409
struct blocking_lock_record *blr);
3410
bool brl_lock_cancel_default(struct byte_range_lock *br_lck,
3411
struct lock_struct *plock);
3412
void brl_close_fnum(struct messaging_context *msg_ctx,
3413
struct byte_range_lock *br_lck);
3414
int brl_forall(void (*fn)(struct file_id id, struct server_id pid,
3415
enum brl_type lock_type,
3416
enum brl_flavour lock_flav,
3417
br_off start, br_off size,
3418
void *private_data),
3419
void *private_data);
3420
struct byte_range_lock *brl_get_locks(TALLOC_CTX *mem_ctx,
3422
struct byte_range_lock *brl_get_locks_readonly(files_struct *fsp);
3423
void brl_register_msgs(struct messaging_context *msg_ctx);
3425
/* The following definitions come from locking/locking.c */
3427
const char *lock_type_name(enum brl_type lock_type);
3428
const char *lock_flav_name(enum brl_flavour lock_flav);
3429
void init_strict_lock_struct(files_struct *fsp,
3433
enum brl_type lock_type,
3434
struct lock_struct *plock);
3435
bool strict_lock_default(files_struct *fsp,
3436
struct lock_struct *plock);
3437
void strict_unlock_default(files_struct *fsp,
3438
struct lock_struct *plock);
3439
NTSTATUS query_lock(files_struct *fsp,
3443
enum brl_type *plock_type,
3444
enum brl_flavour lock_flav);
3445
struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
3450
enum brl_type lock_type,
3451
enum brl_flavour lock_flav,
3455
struct blocking_lock_record *blr);
3456
NTSTATUS do_unlock(struct messaging_context *msg_ctx,
3461
enum brl_flavour lock_flav);
3462
NTSTATUS do_lock_cancel(files_struct *fsp,
3466
enum brl_flavour lock_flav,
3467
struct blocking_lock_record *blr);
3468
void locking_close_file(struct messaging_context *msg_ctx,
3470
bool locking_init(void);
3471
bool locking_init_readonly(void);
3472
bool locking_end(void);
3473
char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e);
3474
struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
3475
const struct file_id id,
3476
const char *servicepath,
3477
const struct smb_filename *smb_fname,
3478
const struct timespec *old_write_time);
3479
struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
3480
const struct file_id id);
3481
bool rename_share_filename(struct messaging_context *msg_ctx,
3482
struct share_mode_lock *lck,
3483
const char *servicepath,
3484
const struct smb_filename *smb_fname);
3485
void get_file_infos(struct file_id id,
3486
bool *delete_on_close,
3487
struct timespec *write_time);
3488
bool is_valid_share_mode_entry(const struct share_mode_entry *e);
3489
bool is_deferred_open_entry(const struct share_mode_entry *e);
3490
bool is_unused_share_mode_entry(const struct share_mode_entry *e);
3491
void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
3492
uid_t uid, uint16 mid, uint16 op_type);
3493
void add_deferred_open(struct share_mode_lock *lck, uint16 mid,
3494
struct timeval request_time,
3496
bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
3497
void del_deferred_open_entry(struct share_mode_lock *lck, uint16 mid);
3498
bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
3499
bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
3500
NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
3501
void set_delete_on_close_token(struct share_mode_lock *lck, const UNIX_USER_TOKEN *tok);
3502
void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, const UNIX_USER_TOKEN *tok);
3503
bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const UNIX_USER_TOKEN *tok);
3504
bool set_sticky_write_time(struct file_id fileid, struct timespec write_time);
3505
bool set_write_time(struct file_id fileid, struct timespec write_time);
3506
int share_mode_forall(void (*fn)(const struct share_mode_entry *, const char *,
3507
const char *, void *),
3508
void *private_data);
3510
/* The following definitions come from locking/posix.c */
3512
bool is_posix_locked(files_struct *fsp,
3513
uint64_t *pu_offset,
3515
enum brl_type *plock_type,
3516
enum brl_flavour lock_flav);
3517
bool posix_locking_init(bool read_only);
3518
bool posix_locking_end(void);
3519
void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount);
3520
int fd_close_posix(struct files_struct *fsp);
3521
bool set_posix_lock_windows_flavour(files_struct *fsp,
3524
enum brl_type lock_type,
3525
const struct lock_context *lock_ctx,
3526
const struct lock_struct *plocks,
3529
bool release_posix_lock_windows_flavour(files_struct *fsp,
3532
enum brl_type deleted_lock_type,
3533
const struct lock_context *lock_ctx,
3534
const struct lock_struct *plocks,
3536
bool set_posix_lock_posix_flavour(files_struct *fsp,
3539
enum brl_type lock_type,
3541
bool release_posix_lock_posix_flavour(files_struct *fsp,
3544
const struct lock_context *lock_ctx,
3545
const struct lock_struct *plocks,
3548
/* The following definitions come from modules/vfs_default.c */
3550
ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size);
3551
ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size);
3552
NTSTATUS vfs_default_init(void);
3554
/* The following definitions come from nmbd/asyncdns.c */
3556
int asyncdns_fd(void);
3557
void kill_async_dns_child(void);
3558
void start_async_dns(void);
3559
void run_dns_queue(void);
3560
bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
3561
bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
3562
void kill_async_dns_child(void);
3564
/* The following definitions come from nmbd/nmbd.c */
3566
struct event_context *nmbd_event_context(void);
3567
struct messaging_context *nmbd_messaging_context(void);
3569
/* The following definitions come from nmbd/nmbd_become_dmb.c */
3571
void add_domain_names(time_t t);
3573
/* The following definitions come from nmbd/nmbd_become_lmb.c */
3575
void insert_permanent_name_into_unicast( struct subnet_record *subrec,
3576
struct nmb_name *nmbname, uint16 nb_type );
3577
void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
3578
bool force_new_election);
3579
void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
3580
void set_workgroup_local_master_browser_name( struct work_record *work, const char *newname);
3582
/* The following definitions come from nmbd/nmbd_browserdb.c */
3584
void update_browser_death_time( struct browse_cache_record *browc );
3585
struct browse_cache_record *create_browser_in_lmb_cache( const char *work_name,
3586
const char *browser_name,
3587
struct in_addr ip );
3588
struct browse_cache_record *find_browser_in_lmb_cache( const char *browser_name );
3589
void expire_lmb_browsers( time_t t );
3591
/* The following definitions come from nmbd/nmbd_browsesync.c */
3593
void dmb_expire_and_sync_browser_lists(time_t t);
3594
void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
3595
struct work_record *work);
3596
void collect_all_workgroup_names_from_wins_server(time_t t);
3597
void sync_all_dmbs(time_t t);
3599
/* The following definitions come from nmbd/nmbd_elections.c */
3601
void check_master_browser_exists(time_t t);
3602
void run_elections(time_t t);
3603
void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
3604
bool check_elections(void);
3605
void nmbd_message_election(struct messaging_context *msg,
3608
struct server_id server_id,
3611
/* The following definitions come from nmbd/nmbd_incomingdgrams.c */
3613
void tell_become_backup(void);
3614
void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
3615
void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
3616
void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
3617
void process_master_browser_announce(struct subnet_record *subrec,
3618
struct packet_struct *p,char *buf);
3619
void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
3620
void process_get_backup_list_request(struct subnet_record *subrec,
3621
struct packet_struct *p,char *buf);
3622
void process_reset_browser(struct subnet_record *subrec,
3623
struct packet_struct *p,char *buf);
3624
void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
3625
void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
3627
/* The following definitions come from nmbd/nmbd_incomingrequests.c */
3629
void process_name_release_request(struct subnet_record *subrec,
3630
struct packet_struct *p);
3631
void process_name_refresh_request(struct subnet_record *subrec,
3632
struct packet_struct *p);
3633
void process_name_registration_request(struct subnet_record *subrec,
3634
struct packet_struct *p);
3635
void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
3636
void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
3638
/* The following definitions come from nmbd/nmbd_lmhosts.c */
3640
void load_lmhosts_file(const char *fname);
3641
bool find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
3643
/* The following definitions come from nmbd/nmbd_logonnames.c */
3645
void add_logon_names(void);
3647
/* The following definitions come from nmbd/nmbd_mynames.c */
3649
void register_my_workgroup_one_subnet(struct subnet_record *subrec);
3650
bool register_my_workgroup_and_names(void);
3651
void release_wins_names(void);
3652
void refresh_my_names(time_t t);
3654
/* The following definitions come from nmbd/nmbd_namelistdb.c */
3656
void set_samba_nb_type(void);
3657
void remove_name_from_namelist(struct subnet_record *subrec,
3658
struct name_record *namerec );
3659
struct name_record *find_name_on_subnet(struct subnet_record *subrec,
3660
const struct nmb_name *nmbname,
3662
struct name_record *find_name_for_remote_broadcast_subnet(struct nmb_name *nmbname,
3664
void update_name_ttl( struct name_record *namerec, int ttl );
3665
bool add_name_to_subnet( struct subnet_record *subrec,
3670
enum name_source source,
3672
struct in_addr *iplist);
3673
void standard_success_register(struct subnet_record *subrec,
3674
struct userdata_struct *userdata,
3675
struct nmb_name *nmbname, uint16 nb_flags, int ttl,
3676
struct in_addr registered_ip);
3677
void standard_fail_register( struct subnet_record *subrec,
3678
struct nmb_name *nmbname );
3679
bool find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
3680
void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
3681
void remove_ip_from_name_record( struct name_record *namerec,
3682
struct in_addr remove_ip );
3683
void standard_success_release( struct subnet_record *subrec,
3684
struct userdata_struct *userdata,
3685
struct nmb_name *nmbname,
3686
struct in_addr released_ip );
3687
void expire_names(time_t t);
3688
void add_samba_names_to_subnet( struct subnet_record *subrec );
3689
void dump_name_record( struct name_record *namerec, XFILE *fp);
3690
void dump_all_namelists(void);
3692
/* The following definitions come from nmbd/nmbd_namequery.c */
3694
bool query_name(struct subnet_record *subrec, const char *name, int type,
3695
query_name_success_function success_fn,
3696
query_name_fail_function fail_fn,
3697
struct userdata_struct *userdata);
3698
bool query_name_from_wins_server(struct in_addr ip_to,
3699
const char *name, int type,
3700
query_name_success_function success_fn,
3701
query_name_fail_function fail_fn,
3702
struct userdata_struct *userdata);
3704
/* The following definitions come from nmbd/nmbd_nameregister.c */
3706
void register_name(struct subnet_record *subrec,
3707
const char *name, int type, uint16 nb_flags,
3708
register_name_success_function success_fn,
3709
register_name_fail_function fail_fn,
3710
struct userdata_struct *userdata);
3711
void wins_refresh_name(struct name_record *namerec);
3713
/* The following definitions come from nmbd/nmbd_namerelease.c */
3715
void release_name(struct subnet_record *subrec, struct name_record *namerec,
3716
release_name_success_function success_fn,
3717
release_name_fail_function fail_fn,
3718
struct userdata_struct *userdata);
3720
/* The following definitions come from nmbd/nmbd_nodestatus.c */
3722
bool node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
3723
struct in_addr send_ip, node_status_success_function success_fn,
3724
node_status_fail_function fail_fn, struct userdata_struct *userdata);
3726
/* The following definitions come from nmbd/nmbd_packets.c */
3728
uint16 get_nb_flags(char *buf);
3729
void set_nb_flags(char *buf, uint16 nb_flags);
3730
struct response_record *queue_register_name( struct subnet_record *subrec,
3731
response_function resp_fn,
3732
timeout_response_function timeout_fn,
3733
register_name_success_function success_fn,
3734
register_name_fail_function fail_fn,
3735
struct userdata_struct *userdata,
3736
struct nmb_name *nmbname,
3738
void queue_wins_refresh(struct nmb_name *nmbname,
3739
response_function resp_fn,
3740
timeout_response_function timeout_fn,
3742
struct in_addr refresh_ip,
3744
struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
3745
response_function resp_fn,
3746
timeout_response_function timeout_fn,
3747
register_name_success_function success_fn,
3748
register_name_fail_function fail_fn,
3749
struct userdata_struct *userdata,
3750
struct nmb_name *nmbname,
3752
struct in_addr register_ip,
3753
struct in_addr wins_ip);
3754
struct response_record *queue_release_name( struct subnet_record *subrec,
3755
response_function resp_fn,
3756
timeout_response_function timeout_fn,
3757
release_name_success_function success_fn,
3758
release_name_fail_function fail_fn,
3759
struct userdata_struct *userdata,
3760
struct nmb_name *nmbname,
3762
struct in_addr release_ip,
3763
struct in_addr dest_ip);
3764
struct response_record *queue_query_name( struct subnet_record *subrec,
3765
response_function resp_fn,
3766
timeout_response_function timeout_fn,
3767
query_name_success_function success_fn,
3768
query_name_fail_function fail_fn,
3769
struct userdata_struct *userdata,
3770
struct nmb_name *nmbname);
3771
struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
3772
response_function resp_fn,
3773
timeout_response_function timeout_fn,
3774
query_name_success_function success_fn,
3775
query_name_fail_function fail_fn,
3776
struct userdata_struct *userdata,
3777
struct nmb_name *nmbname);
3778
struct response_record *queue_node_status( struct subnet_record *subrec,
3779
response_function resp_fn,
3780
timeout_response_function timeout_fn,
3781
node_status_success_function success_fn,
3782
node_status_fail_function fail_fn,
3783
struct userdata_struct *userdata,
3784
struct nmb_name *nmbname,
3785
struct in_addr send_ip);
3786
void reply_netbios_packet(struct packet_struct *orig_packet,
3787
int rcode, enum netbios_reply_type_code rcv_code, int opcode,
3788
int ttl, char *data,int len);
3789
void queue_packet(struct packet_struct *packet);
3790
void run_packet_queue(void);
3791
void retransmit_or_expire_response_records(time_t t);
3792
bool listen_for_packets(bool run_election);
3793
bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
3794
const char *srcname, int src_type,
3795
const char *dstname, int dest_type,
3796
struct in_addr dest_ip,struct in_addr src_ip,
3799
/* The following definitions come from nmbd/nmbd_processlogon.c */
3801
bool initialize_nmbd_proxy_logon(void);
3803
void process_logon_packet(struct packet_struct *p, char *buf,int len,
3804
const char *mailslot);
3806
/* The following definitions come from nmbd/nmbd_responserecordsdb.c */
3808
void remove_response_record(struct subnet_record *subrec,
3809
struct response_record *rrec);
3810
struct response_record *make_response_record( struct subnet_record *subrec,
3811
struct packet_struct *p,
3812
response_function resp_fn,
3813
timeout_response_function timeout_fn,
3814
success_function success_fn,
3815
fail_function fail_fn,
3816
struct userdata_struct *userdata);
3817
struct response_record *find_response_record(struct subnet_record **ppsubrec,
3819
bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
3821
/* The following definitions come from nmbd/nmbd_sendannounce.c */
3823
void send_browser_reset(int reset_type, const char *to_name, int to_type, struct in_addr to_ip);
3824
void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
3825
void announce_my_server_names(time_t t);
3826
void announce_my_lm_server_names(time_t t);
3827
void reset_announce_timer(void);
3828
void announce_myself_to_domain_master_browser(time_t t);
3829
void announce_my_servers_removed(void);
3830
void announce_remote(time_t t);
3831
void browse_sync_remote(time_t t);
3833
/* The following definitions come from nmbd/nmbd_serverlistdb.c */
3835
void remove_all_servers(struct work_record *work);
3836
struct server_record *find_server_in_workgroup(struct work_record *work, const char *name);
3837
void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
3838
struct server_record *create_server_on_workgroup(struct work_record *work,
3839
const char *name,int servertype,
3840
int ttl, const char *comment);
3841
void update_server_ttl(struct server_record *servrec, int ttl);
3842
void expire_servers(struct work_record *work, time_t t);
3843
void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,
3844
const char *local_master_browser_name, const char *description);
3845
void write_browse_list(time_t t, bool force_write);
3847
/* The following definitions come from nmbd/nmbd_subnetdb.c */
3849
void close_subnet(struct subnet_record *subrec);
3850
struct subnet_record *make_normal_subnet(const struct interface *iface);
3851
bool create_subnets(void);
3852
bool we_are_a_wins_client(void);
3853
struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
3854
struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
3856
/* The following definitions come from nmbd/nmbd_synclists.c */
3858
void sync_browse_lists(struct work_record *work,
3859
char *name, int nm_type,
3860
struct in_addr ip, bool local, bool servers);
3861
void sync_check_completion(void);
3863
/* The following definitions come from nmbd/nmbd_winsproxy.c */
3865
void make_wins_proxy_name_query_request( struct subnet_record *subrec,
3866
struct packet_struct *incoming_packet,
3867
struct nmb_name *question_name);
3869
/* The following definitions come from nmbd/nmbd_winsserver.c */
3871
struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, bool self_only);
3872
bool wins_store_changed_namerec(const struct name_record *namerec);
3873
bool add_name_to_wins_subnet(const struct name_record *namerec);
3874
bool remove_name_from_wins_namelist(struct name_record *namerec);
3875
void dump_wins_subnet_namelist(XFILE *fp);
3876
bool packet_is_for_wins_server(struct packet_struct *packet);
3877
bool initialise_wins(void);
3878
void wins_process_name_refresh_request( struct subnet_record *subrec,
3879
struct packet_struct *p );
3880
void wins_process_name_registration_request(struct subnet_record *subrec,
3881
struct packet_struct *p);
3882
void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
3883
struct packet_struct *p);
3884
void fetch_all_active_wins_1b_names(void);
3885
void send_wins_name_query_response(int rcode, struct packet_struct *p,
3886
struct name_record *namerec);
3887
void wins_process_name_query_request(struct subnet_record *subrec,
3888
struct packet_struct *p);
3889
void wins_process_name_release_request(struct subnet_record *subrec,
3890
struct packet_struct *p);
3891
void initiate_wins_processing(time_t t);
3892
void wins_write_name_record(struct name_record *namerec, XFILE *fp);
3893
void wins_write_database(time_t t, bool background);
3894
void nmbd_wins_new_entry(struct messaging_context *msg,
3897
struct server_id server_id,
3900
/* The following definitions come from nmbd/nmbd_workgroupdb.c */
3902
struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec,
3904
struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
3905
const char *name, int ttl);
3906
void update_workgroup_ttl(struct work_record *work, int ttl);
3907
void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
3908
void dump_workgroups(bool force_write);
3909
void expire_workgroups_and_servers(time_t t);
1335
struct dom_sid **sids );
1336
NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine);
3911
1338
/* The following definitions come from param/loadparm.c */
4387
1826
char* lp_perfcount_module(void);
4388
1827
void lp_set_passdb_backend(const char *backend);
4389
1828
void widelinks_warning(int snum);
1829
char *lp_ncalrpc_dir(void);
1831
/* The following definitions come from param/loadparm_server_role.c */
1833
int lp_server_role(void);
1834
void set_server_role(void);
4391
1836
/* The following definitions come from param/util.c */
4393
1838
uint32 get_int_param( const char* param );
4394
1839
char* get_string_param( const char* param );
4396
/* The following definitions come from passdb/login_cache.c */
4398
bool login_cache_init(void);
4399
bool login_cache_shutdown(void);
4400
LOGIN_CACHE * login_cache_read(struct samu *sampass);
4401
bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry);
4402
bool login_cache_delentry(const struct samu *sampass);
4404
/* The following definitions come from passdb/lookup_sid.c */
4406
bool lookup_name(TALLOC_CTX *mem_ctx,
4407
const char *full_name, int flags,
4408
const char **ret_domain, const char **ret_name,
4409
DOM_SID *ret_sid, enum lsa_SidType *ret_type);
4410
bool lookup_name_smbconf(TALLOC_CTX *mem_ctx,
4411
const char *full_name, int flags,
4412
const char **ret_domain, const char **ret_name,
4413
DOM_SID *ret_sid, enum lsa_SidType *ret_type);
4414
NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
4415
const DOM_SID **sids, int level,
4416
struct lsa_dom_info **ret_domains,
4417
struct lsa_name_info **ret_names);
4418
bool lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
4419
const char **ret_domain, const char **ret_name,
4420
enum lsa_SidType *ret_type);
4421
void store_uid_sid_cache(const DOM_SID *psid, uid_t uid);
4422
void store_gid_sid_cache(const DOM_SID *psid, gid_t gid);
4423
void uid_to_sid(DOM_SID *psid, uid_t uid);
4424
void gid_to_sid(DOM_SID *psid, gid_t gid);
4425
bool sid_to_uid(const DOM_SID *psid, uid_t *puid);
4426
bool sid_to_gid(const DOM_SID *psid, gid_t *pgid);
4428
/* The following definitions come from passdb/machine_sid.c */
4430
DOM_SID *get_global_sam_sid(void);
4431
void reset_global_sam_sid(void) ;
4432
bool sid_check_is_domain(const DOM_SID *sid);
4433
bool sid_check_is_in_our_domain(const DOM_SID *sid);
4435
/* The following definitions come from passdb/passdb.c */
4437
const char *my_sam_name(void);
4438
struct samu *samu_new( TALLOC_CTX *ctx );
4439
NTSTATUS samu_set_unix(struct samu *user, const struct passwd *pwd);
4440
NTSTATUS samu_alloc_rid_unix(struct samu *user, const struct passwd *pwd);
4441
char *pdb_encode_acct_ctrl(uint32 acct_ctrl, size_t length);
4442
uint32 pdb_decode_acct_ctrl(const char *p);
4443
void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32 acct_ctrl);
4444
bool pdb_gethexpwd(const char *p, unsigned char *pwd);
4445
void pdb_sethexhours(char *p, const unsigned char *hours);
4446
bool pdb_gethexhours(const char *p, unsigned char *hours);
4447
int algorithmic_rid_base(void);
4448
uid_t algorithmic_pdb_user_rid_to_uid(uint32 user_rid);
4449
uid_t max_algorithmic_uid(void);
4450
uint32 algorithmic_pdb_uid_to_user_rid(uid_t uid);
4451
gid_t pdb_group_rid_to_gid(uint32 group_rid);
4452
gid_t max_algorithmic_gid(void);
4453
uint32 algorithmic_pdb_gid_to_group_rid(gid_t gid);
4454
bool algorithmic_pdb_rid_is_user(uint32 rid);
4455
bool lookup_global_sam_name(const char *name, int flags, uint32_t *rid,
4456
enum lsa_SidType *type);
4457
NTSTATUS local_password_change(const char *user_name,
4459
const char *new_passwd,
4462
bool init_samu_from_buffer(struct samu *sampass, uint32_t level,
4463
uint8 *buf, uint32 buflen);
4464
uint32 init_buffer_from_samu (uint8 **buf, struct samu *sampass, bool size_only);
4465
bool pdb_copy_sam_account(struct samu *dst, struct samu *src );
4466
bool pdb_update_bad_password_count(struct samu *sampass, bool *updated);
4467
bool pdb_update_autolock_flag(struct samu *sampass, bool *updated);
4468
bool pdb_increment_bad_password_count(struct samu *sampass);
4469
bool is_dc_trusted_domain_situation(const char *domain_name);
4470
bool get_trust_pw_clear(const char *domain, char **ret_pwd,
4471
const char **account_name,
4472
enum netr_SchannelType *channel);
4473
bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16],
4474
const char **account_name,
4475
enum netr_SchannelType *channel);
4476
struct samr_LogonHours get_logon_hours_from_pdb(TALLOC_CTX *mem_ctx,
4478
/* The following definitions come from passdb/pdb_compat.c */
4480
uint32 pdb_get_user_rid (const struct samu *sampass);
4481
uint32 pdb_get_group_rid (struct samu *sampass);
4482
bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag);
4483
bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag);
4485
/* The following definitions come from passdb/pdb_get_set.c */
4487
uint32 pdb_get_acct_ctrl(const struct samu *sampass);
4488
time_t pdb_get_logon_time(const struct samu *sampass);
4489
time_t pdb_get_logoff_time(const struct samu *sampass);
4490
time_t pdb_get_kickoff_time(const struct samu *sampass);
4491
time_t pdb_get_bad_password_time(const struct samu *sampass);
4492
time_t pdb_get_pass_last_set_time(const struct samu *sampass);
4493
time_t pdb_get_pass_can_change_time(const struct samu *sampass);
4494
time_t pdb_get_pass_can_change_time_noncalc(const struct samu *sampass);
4495
time_t pdb_get_pass_must_change_time(const struct samu *sampass);
4496
bool pdb_get_pass_can_change(const struct samu *sampass);
4497
uint16 pdb_get_logon_divs(const struct samu *sampass);
4498
uint32 pdb_get_hours_len(const struct samu *sampass);
4499
const uint8 *pdb_get_hours(const struct samu *sampass);
4500
const uint8 *pdb_get_nt_passwd(const struct samu *sampass);
4501
const uint8 *pdb_get_lanman_passwd(const struct samu *sampass);
4502
const uint8 *pdb_get_pw_history(const struct samu *sampass, uint32 *current_hist_len);
4503
const char *pdb_get_plaintext_passwd(const struct samu *sampass);
4504
const DOM_SID *pdb_get_user_sid(const struct samu *sampass);
4505
const DOM_SID *pdb_get_group_sid(struct samu *sampass);
4506
enum pdb_value_state pdb_get_init_flags(const struct samu *sampass, enum pdb_elements element);
4507
const char *pdb_get_username(const struct samu *sampass);
4508
const char *pdb_get_domain(const struct samu *sampass);
4509
const char *pdb_get_nt_username(const struct samu *sampass);
4510
const char *pdb_get_fullname(const struct samu *sampass);
4511
const char *pdb_get_homedir(const struct samu *sampass);
4512
const char *pdb_get_dir_drive(const struct samu *sampass);
4513
const char *pdb_get_logon_script(const struct samu *sampass);
4514
const char *pdb_get_profile_path(const struct samu *sampass);
4515
const char *pdb_get_acct_desc(const struct samu *sampass);
4516
const char *pdb_get_workstations(const struct samu *sampass);
4517
const char *pdb_get_comment(const struct samu *sampass);
4518
const char *pdb_get_munged_dial(const struct samu *sampass);
4519
uint16 pdb_get_bad_password_count(const struct samu *sampass);
4520
uint16 pdb_get_logon_count(const struct samu *sampass);
4521
uint32 pdb_get_unknown_6(const struct samu *sampass);
4522
void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_methods *my_methods);
4523
bool pdb_set_acct_ctrl(struct samu *sampass, uint32 acct_ctrl, enum pdb_value_state flag);
4524
bool pdb_set_logon_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4525
bool pdb_set_logoff_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4526
bool pdb_set_kickoff_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4527
bool pdb_set_bad_password_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4528
bool pdb_set_pass_can_change_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4529
bool pdb_set_pass_must_change_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4530
bool pdb_set_pass_last_set_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag);
4531
bool pdb_set_hours_len(struct samu *sampass, uint32 len, enum pdb_value_state flag);
4532
bool pdb_set_logon_divs(struct samu *sampass, uint16 hours, enum pdb_value_state flag);
4533
bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag);
4534
bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag);
4535
bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_value_state flag);
4536
bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag);
4537
bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag);
4538
bool pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag);
4539
bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag);
4540
bool pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_value_state flag);
4541
bool pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum pdb_value_state flag);
4542
bool pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum pdb_value_state flag);
4543
bool pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_value_state flag);
4544
bool pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_state flag);
4545
bool pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_value_state flag);
4546
bool pdb_set_workstations(struct samu *sampass, const char *workstations, enum pdb_value_state flag);
4547
bool pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_state flag);
4548
bool pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb_value_state flag);
4549
bool pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum pdb_value_state flag);
4550
bool pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_HASH_LEN], enum pdb_value_state flag);
4551
bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32 historyLen, enum pdb_value_state flag);
4552
bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag);
4553
bool pdb_set_bad_password_count(struct samu *sampass, uint16 bad_password_count, enum pdb_value_state flag);
4554
bool pdb_set_logon_count(struct samu *sampass, uint16 logon_count, enum pdb_value_state flag);
4555
bool pdb_set_unknown_6(struct samu *sampass, uint32 unkn, enum pdb_value_state flag);
4556
bool pdb_set_hours(struct samu *sampass, const uint8 *hours, enum pdb_value_state flag);
4557
bool pdb_set_backend_private_data(struct samu *sampass, void *private_data,
4558
void (*free_fn)(void **),
4559
const struct pdb_methods *my_methods,
4560
enum pdb_value_state flag);
4561
bool pdb_set_pass_can_change(struct samu *sampass, bool canchange);
4562
bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext);
4563
uint32 pdb_build_fields_present(struct samu *sampass);
4565
/* The following definitions come from passdb/pdb_interface.c */
4567
NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init) ;
4568
struct pdb_init_function_entry *pdb_find_backend_entry(const char *name);
4569
struct event_context *pdb_get_event_context(void);
4570
NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected);
4571
struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx);
4572
bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ;
4573
bool guest_user_info( struct samu *user );
4574
bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ;
4575
NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags,
4577
NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct);
4578
NTSTATUS pdb_add_sam_account(struct samu *sam_acct) ;
4579
NTSTATUS pdb_update_sam_account(struct samu *sam_acct) ;
4580
NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) ;
4581
NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname);
4582
NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success);
4583
bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid);
4584
bool pdb_getgrgid(GROUP_MAP *map, gid_t gid);
4585
bool pdb_getgrnam(GROUP_MAP *map, const char *name);
4586
NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name,
4588
NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32 rid);
4589
NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map);
4590
NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map);
4591
NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid);
4592
bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
4593
size_t *p_num_entries, bool unix_only);
4594
NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx,
4596
uint32 **pp_member_rids,
4597
size_t *p_num_members);
4598
NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user,
4599
DOM_SID **pp_sids, gid_t **pp_gids,
4600
size_t *p_num_groups);
4601
NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user);
4602
NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
4604
NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
4606
NTSTATUS pdb_create_alias(const char *name, uint32 *rid);
4607
NTSTATUS pdb_delete_alias(const DOM_SID *sid);
4608
NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info);
4609
NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info);
4610
NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member);
4611
NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member);
4612
NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
4613
DOM_SID **pp_members, size_t *p_num_members);
4614
NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx,
4615
const DOM_SID *domain_sid,
4616
const DOM_SID *members, size_t num_members,
4617
uint32 **pp_alias_rids,
4618
size_t *p_num_alias_rids);
4619
NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid,
4623
enum lsa_SidType *attrs);
4624
NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
4628
enum lsa_SidType *attrs);
4629
bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value);
4630
bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value);
4631
bool pdb_get_seq_num(time_t *seq_num);
4632
bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid);
4633
bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid);
4634
bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,
4635
enum lsa_SidType *type);
4636
uint32_t pdb_capabilities(void);
4637
bool pdb_new_rid(uint32 *rid);
4638
bool initialize_password_db(bool reload, struct event_context *event_ctx);
4639
struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx,
4640
enum pdb_search_type type);
4641
struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32 acct_flags);
4642
struct pdb_search *pdb_search_groups(TALLOC_CTX *mem_ctx);
4643
struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid);
4644
uint32 pdb_search_entries(struct pdb_search *search,
4645
uint32 start_idx, uint32 max_entries,
4646
struct samr_displayentry **result);
4647
bool pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid,
4648
time_t *pass_last_set_time);
4649
bool pdb_set_trusteddom_pw(const char* domain, const char* pwd,
4650
const DOM_SID *sid);
4651
bool pdb_del_trusteddom_pw(const char *domain);
4652
NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32 *num_domains,
4653
struct trustdom_info ***domains);
4654
NTSTATUS make_pdb_method( struct pdb_methods **methods ) ;
4656
/* The following definitions come from passdb/pdb_ldap.c */
4658
const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver );
4659
int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
4661
LDAPMessage ** result,
4663
const char **talloc_attrs(TALLOC_CTX *mem_ctx, ...);
4664
NTSTATUS pdb_init_ldapsam_compat(struct pdb_methods **pdb_method, const char *location);
4665
NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location);
4666
NTSTATUS pdb_ldap_init(void);
4668
/* The following definitions come from passdb/pdb_nds.c */
4670
int pdb_nds_get_password(
4671
struct smbldap_state *ldap_state,
4675
int pdb_nds_set_password(
4676
struct smbldap_state *ldap_state,
4679
NTSTATUS pdb_nds_init(void);
4681
/* The following definitions come from passdb/pdb_smbpasswd.c */
4683
NTSTATUS pdb_smbpasswd_init(void) ;
4685
/* The following definitions come from passdb/pdb_wbc_sam.c */
4687
NTSTATUS pdb_wbc_sam_init(void);
4689
/* The following definitions come from passdb/pdb_tdb.c */
4691
bool init_sam_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen);
4692
NTSTATUS pdb_tdbsam_init(void);
4694
/* The following definitions come from passdb/secrets.c */
4696
bool secrets_init(void);
4697
struct db_context *secrets_db_ctx(void);
4698
void secrets_shutdown(void);
4699
void *secrets_fetch(const char *key, size_t *size);
4700
bool secrets_store(const char *key, const void *data, size_t size);
4701
bool secrets_delete(const char *key);
4702
bool secrets_store_domain_sid(const char *domain, const DOM_SID *sid);
4703
bool secrets_fetch_domain_sid(const char *domain, DOM_SID *sid);
4704
bool secrets_store_domain_guid(const char *domain, struct GUID *guid);
4705
bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid);
4706
void *secrets_get_trust_account_lock(TALLOC_CTX *mem_ctx, const char *domain);
4707
enum netr_SchannelType get_default_sec_channel(void);
4708
bool secrets_fetch_trust_account_password_legacy(const char *domain,
4710
time_t *pass_last_set_time,
4711
enum netr_SchannelType *channel);
4712
bool secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
4713
time_t *pass_last_set_time,
4714
enum netr_SchannelType *channel);
4715
bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
4716
DOM_SID *sid, time_t *pass_last_set_time);
4717
bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
4718
const DOM_SID *sid);
4719
bool secrets_delete_machine_password(const char *domain);
4720
bool secrets_delete_machine_password_ex(const char *domain);
4721
bool secrets_delete_domain_sid(const char *domain);
4722
bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel);
4723
char *secrets_fetch_prev_machine_password(const char *domain);
4724
char *secrets_fetch_machine_password(const char *domain,
4725
time_t *pass_last_set_time,
4726
enum netr_SchannelType *channel);
4727
bool trusted_domain_password_delete(const char *domain);
4728
bool secrets_store_ldap_pw(const char* dn, char* pw);
4729
bool fetch_ldap_pw(char **dn, char** pw);
4730
NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
4731
struct trustdom_info ***domains);
4732
bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile);
4733
bool secrets_fetch_afs_key(const char *cell, struct afs_key *result);
4734
void secrets_fetch_ipc_userpass(char **username, char **domain, char **password);
4735
bool secrets_store_generic(const char *owner, const char *key, const char *secret);
4736
char *secrets_fetch_generic(const char *owner, const char *key);
4737
bool secrets_delete_generic(const char *owner, const char *key);
4738
bool secrets_store_local_schannel_key(uint8_t schannel_key[16]);
4739
bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]);
4741
/* The following definitions come from passdb/secrets_schannel.c */
4743
TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx);
4744
NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx,
4745
const char *computer_name,
4746
struct netlogon_creds_CredentialState **pcreds);
4747
NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx,
4748
struct netlogon_creds_CredentialState *creds);
4750
/* The following definitions come from passdb/util_builtin.c */
4752
bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
4753
bool lookup_builtin_name(const char *name, uint32 *rid);
4754
const char *builtin_domain_name(void);
4755
bool sid_check_is_builtin(const DOM_SID *sid);
4756
bool sid_check_is_in_builtin(const DOM_SID *sid);
4758
/* The following definitions come from passdb/util_unixsids.c */
4760
bool sid_check_is_unix_users(const DOM_SID *sid);
4761
bool sid_check_is_in_unix_users(const DOM_SID *sid);
4762
bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid);
4763
bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid);
1841
/* The following definitions come from lib/server_contexts.c */
1842
struct tevent_context *server_event_context(void);
1843
void server_event_context_free(void);
1844
struct messaging_context *server_messaging_context(void);
1845
void server_messaging_context_free(void);
1847
/* The following definitions come from lib/sessionid_tdb.c */
1849
bool sessionid_init(void);
1850
struct db_record *sessionid_fetch_record(TALLOC_CTX *mem_ctx, const char *key);
1851
int sessionid_traverse(int (*fn)(struct db_record *rec, const char *key,
1852
struct sessionid *session,
1853
void *private_data),
1854
void *private_data);
1855
int sessionid_traverse_read(int (*fn)(const char *key,
1856
struct sessionid *session,
1857
void *private_data),
1858
void *private_data);
1860
/* The following definitions come from utils/passwd_util.c */
1862
char *stdin_new_passwd( void);
1863
char *get_pass( const char *prompt, bool stdin_get);
1865
/* The following definitions come from lib/avahi.c */
1867
struct AvahiPoll *tevent_avahi_poll(TALLOC_CTX *mem_ctx,
1868
struct tevent_context *ev);
1870
/* The following definitions come from lib/fncall.c */
1872
struct fncall_context *fncall_context_init(TALLOC_CTX *mem_ctx,
1874
struct tevent_req *fncall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
1875
struct fncall_context *ctx,
1876
void (*fn)(void *private_data),
1877
void *private_data);
1878
int fncall_recv(struct tevent_req *req, int *perr);
1880
/* The following definitions come from libsmb/smbsock_connect.c */
1882
struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
1883
struct tevent_context *ev,
1884
const struct sockaddr_storage *addr,
1886
const char *called_name,
1888
const char *calling_name,
1890
NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
1891
uint16_t *ret_port);
1892
NTSTATUS smbsock_connect(const struct sockaddr_storage *addr, uint16_t port,
1893
const char *called_name, int called_type,
1894
const char *calling_name, int calling_type,
1895
int *pfd, uint16_t *ret_port, int sec_timeout);
1897
struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
1898
struct tevent_context *ev,
1899
const struct sockaddr_storage *addrs,
1900
const char **called_names,
1902
const char **calling_names,
1904
size_t num_addrs, uint16_t port);
1905
NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
1906
size_t *chosen_index, uint16_t *chosen_port);
1907
NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
1908
const char **called_names,
1910
const char **calling_names,
1915
int *pfd, size_t *chosen_index,
1916
uint16_t *chosen_port);
1918
/* The following definitions come from lib/util_wellknown.c */
1920
bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name);
1921
bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid);
1922
bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
1923
const char **domain, const char **name);
1924
bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
1925
struct dom_sid *sid, const char **domain);
1927
/* The following definitions come from lib/util_unixsids.c */
1929
bool sid_check_is_unix_users(const struct dom_sid *sid);
1930
bool sid_check_is_in_unix_users(const struct dom_sid *sid);
1931
void uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid);
1932
void gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid);
4764
1933
const char *unix_users_domain_name(void);
4765
bool lookup_unix_user_name(const char *name, DOM_SID *sid);
4766
bool sid_check_is_unix_groups(const DOM_SID *sid);
4767
bool sid_check_is_in_unix_groups(const DOM_SID *sid);
1934
bool lookup_unix_user_name(const char *name, struct dom_sid *sid);
1935
bool sid_check_is_unix_groups(const struct dom_sid *sid);
1936
bool sid_check_is_in_unix_groups(const struct dom_sid *sid);
4768
1937
const char *unix_groups_domain_name(void);
4769
bool lookup_unix_group_name(const char *name, DOM_SID *sid);
4771
/* The following definitions come from passdb/util_wellknown.c */
4773
bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name);
4774
bool sid_check_is_in_wellknown_domain(const DOM_SID *sid);
4775
bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
4776
const char **domain, const char **name);
4777
bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
4778
DOM_SID *sid, const char **domain);
4780
/* The following definitions come from printing/load.c */
4782
void load_printers(void);
4784
/* The following definitions come from printing/lpq_parse.c */
4786
bool parse_lpq_entry(enum printing_types printing_type,char *line,
4787
print_queue_struct *buf,
4788
print_status_struct *status,bool first);
4789
uint32_t print_parse_jobid(const char *fname);
4791
/* The following definitions come from printing/notify.c */
4793
int print_queue_snum(const char *qname);
4794
void print_notify_send_messages(struct messaging_context *msg_ctx,
4795
unsigned int timeout);
4796
void notify_printer_status_byname(const char *sharename, uint32 status);
4797
void notify_printer_status(int snum, uint32 status);
4798
void notify_job_status_byname(const char *sharename, uint32 jobid, uint32 status,
4800
void notify_job_status(const char *sharename, uint32 jobid, uint32 status);
4801
void notify_job_total_bytes(const char *sharename, uint32 jobid,
4803
void notify_job_total_pages(const char *sharename, uint32 jobid,
4805
void notify_job_username(const char *sharename, uint32 jobid, char *name);
4806
void notify_job_name(const char *sharename, uint32 jobid, char *name);
4807
void notify_job_submitted(const char *sharename, uint32 jobid,
4809
void notify_printer_driver(int snum, char *driver_name);
4810
void notify_printer_comment(int snum, char *comment);
4811
void notify_printer_sharename(int snum, char *share_name);
4812
void notify_printer_printername(int snum, char *printername);
4813
void notify_printer_port(int snum, char *port_name);
4814
void notify_printer_location(int snum, char *location);
4815
void notify_printer_byname( const char *printername, uint32 change, const char *value );
4817
/* The following definitions come from printing/nt_printing.c */
4819
bool nt_printing_init(struct messaging_context *msg_ctx);
4820
uint32 update_c_setprinter(bool initialize);
4821
uint32 get_c_setprinter(void);
4822
int get_builtin_ntforms(nt_forms_struct **list);
4823
bool get_a_builtin_ntform_by_string(const char *form_name, nt_forms_struct *form);
4824
int get_ntforms(nt_forms_struct **list);
4825
int write_ntforms(nt_forms_struct **list, int number);
4826
bool add_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int *count);
4827
bool delete_a_form(nt_forms_struct **list, const char *del_name, int *count, WERROR *ret);
4828
void update_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int count);
4829
int get_ntdrivers(fstring **list, const char *architecture, uint32 version);
4830
const char *get_short_archi(const char *long_archi);
4831
WERROR clean_up_driver_struct(struct pipes_struct *rpc_pipe,
4832
struct spoolss_AddDriverInfoCtr *r);
4833
WERROR move_driver_to_download_area(struct pipes_struct *p,
4834
struct spoolss_AddDriverInfoCtr *r,
4836
int pack_devicemode(NT_DEVICEMODE *nt_devmode, uint8 *buf, int buflen);
4837
uint32 del_a_printer(const char *sharename);
4838
NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
4839
void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr);
4840
int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen);
4841
int add_new_printer_key( NT_PRINTER_DATA *data, const char *name );
4842
int delete_printer_key( NT_PRINTER_DATA *data, const char *name );
4843
int lookup_printerkey( NT_PRINTER_DATA *data, const char *name );
4844
int get_printer_subkeys( NT_PRINTER_DATA *data, const char* key, fstring **subkeys );
4845
WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action);
4846
WERROR check_published_printers(void);
4847
bool is_printer_published(Printer_entry *print_hnd, int snum,
4849
WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action);
4850
WERROR check_published_printers(void);
4851
bool is_printer_published(Printer_entry *print_hnd, int snum,
4853
WERROR delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key );
4854
WERROR delete_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value );
4855
WERROR add_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value,
4856
uint32 type, uint8 *data, int real_len );
4857
struct regval_blob* get_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value );
4858
WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level);
4859
bool set_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level);
4860
bool del_driver_init(const char *drivername);
4861
WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, uint8 *data, uint32 data_len);
4862
WERROR get_a_printer( Printer_entry *print_hnd,
4863
NT_PRINTER_INFO_LEVEL **pp_printer,
4865
const char *sharename);
4866
WERROR get_a_printer_search( Printer_entry *print_hnd,
4867
NT_PRINTER_INFO_LEVEL **pp_printer,
4869
const char *sharename);
4870
uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level);
4871
uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx,
4872
struct spoolss_AddDriverInfoCtr *r,
4875
WERROR get_a_printer_driver(TALLOC_CTX *mem_ctx,
4876
struct spoolss_DriverInfo8 **driver_p,
4877
const char *drivername, const char *architecture,
4879
uint32_t free_a_printer_driver(struct spoolss_DriverInfo8 *driver);
4880
bool printer_driver_in_use(const struct spoolss_DriverInfo8 *r);
4881
bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
4882
struct spoolss_DriverInfo8 *r);
4883
WERROR delete_printer_driver(struct pipes_struct *rpc_pipe,
4884
const struct spoolss_DriverInfo8 *r,
4885
uint32 version, bool delete_files );
4886
WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr);
4887
bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr);
4888
void map_printer_permissions(SEC_DESC *sd);
4889
void map_job_permissions(SEC_DESC *sd);
4890
bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
4892
bool print_time_access_check(const char *servicename);
4893
char* get_server_name( Printer_entry *printer );
4895
/* The following definitions come from printing/pcap.c */
4897
bool pcap_cache_add_specific(struct pcap_cache **ppcache, const char *name, const char *comment);
4898
void pcap_cache_destroy_specific(struct pcap_cache **ppcache);
4899
bool pcap_cache_add(const char *name, const char *comment);
4900
bool pcap_cache_loaded(void);
4901
void pcap_cache_replace(const struct pcap_cache *cache);
4902
void pcap_cache_reload(void (*post_cache_fill_fn)(void));
4903
bool pcap_printername_ok(const char *printername);
4904
void pcap_printer_fn_specific(const struct pcap_cache *, void (*fn)(const char *, const char *, void *), void *);
4905
void pcap_printer_fn(void (*fn)(const char *, const char *, void *), void *);
4907
/* The following definitions come from printing/print_aix.c */
4909
bool aix_cache_reload(void);
4911
/* The following definitions come from printing/print_cups.c */
4913
bool cups_cache_reload(void (*post_cache_fill_fn)(void));
4914
bool cups_pull_comment_location(NT_PRINTER_INFO_LEVEL_2 *printer);
4916
/* The following definitions come from printing/print_generic.c */
4919
/* The following definitions come from printing/print_iprint.c */
4921
bool iprint_cache_reload(void);
4923
/* The following definitions come from printing/print_svid.c */
4925
bool sysv_cache_reload(void);
4927
/* The following definitions come from printing/printfsp.c */
4929
NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
4931
uint16_t current_vuid, files_struct *fsp);
4932
void print_fsp_end(files_struct *fsp, enum file_close_type close_type);
4934
/* The following definitions come from printing/printing.c */
4936
uint16 pjobid_to_rap(const char* sharename, uint32 jobid);
4937
bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid);
4938
bool print_backend_init(struct messaging_context *msg_ctx);
4939
void printing_end(void);
4940
int unpack_pjob( uint8 *buf, int buflen, struct printjob *pjob );
4941
uint32 sysjob_to_jobid(int unix_jobid);
4942
void pjob_delete(const char* sharename, uint32 jobid);
4943
void start_background_queue(void);
4944
bool print_notify_register_pid(int snum);
4945
bool print_notify_deregister_pid(int snum);
4946
bool print_job_exists(const char* sharename, uint32 jobid);
4947
int print_job_fd(const char* sharename, uint32 jobid);
4948
char *print_job_fname(const char* sharename, uint32 jobid);
4949
NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid);
4950
bool print_job_set_place(const char *sharename, uint32 jobid, int place);
4951
bool print_job_set_name(const char *sharename, uint32 jobid, char *name);
4952
bool print_job_delete(struct auth_serversupplied_info *server_info, int snum,
4953
uint32 jobid, WERROR *errcode);
4954
bool print_job_pause(struct auth_serversupplied_info *server_info, int snum,
4955
uint32 jobid, WERROR *errcode);
4956
bool print_job_resume(struct auth_serversupplied_info *server_info, int snum,
4957
uint32 jobid, WERROR *errcode);
4958
ssize_t print_job_write(int snum, uint32 jobid, const char *buf, SMB_OFF_T pos, size_t size);
4959
int print_queue_length(int snum, print_status_struct *pstatus);
4960
uint32 print_job_start(struct auth_serversupplied_info *server_info, int snum,
4961
const char *jobname, NT_DEVICEMODE *nt_devmode );
4962
void print_job_endpage(int snum, uint32 jobid);
4963
bool print_job_end(int snum, uint32 jobid, enum file_close_type close_type);
4964
int print_queue_status(int snum,
4965
print_queue_struct **ppqueue,
4966
print_status_struct *status);
4967
WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum);
4968
WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum);
4969
WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum);
4971
/* The following definitions come from printing/printing_db.c */
4973
struct tdb_print_db *get_print_db_byname(const char *printername);
4974
void release_print_db( struct tdb_print_db *pdb);
4975
void close_all_print_db(void);
4976
TDB_DATA get_printer_notify_pid_list(TDB_CONTEXT *tdb, const char *printer_name, bool cleanlist);
4978
/* The following definitions come from profile/profile.c */
4980
void set_profile_level(int level, struct server_id src);
4981
bool profile_setup(struct messaging_context *msg_ctx, bool rdonly);
4983
/* The following definitions come from registry/reg_api.c */
4985
WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive,
4986
uint32 desired_access,
4987
const struct nt_user_token *token,
4988
struct registry_key **pkey);
4989
WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent,
4990
const char *name, uint32 desired_access,
4991
struct registry_key **pkey);
4992
WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key,
4993
uint32 idx, char **name, NTTIME *last_write_time);
4994
WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
4995
uint32 idx, char **pname, struct registry_value **pval);
4996
WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
4997
const char *name, struct registry_value **pval);
4998
WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys,
4999
uint32_t *max_subkeylen, uint32_t *max_subkeysize,
5000
uint32_t *num_values, uint32_t *max_valnamelen,
5001
uint32_t *max_valbufsize, uint32_t *secdescsize,
5002
NTTIME *last_changed_time);
5003
WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
5004
const char *subkeypath, uint32 desired_access,
5005
struct registry_key **pkey,
5006
enum winreg_CreateAction *paction);
5007
WERROR reg_deletekey(struct registry_key *parent, const char *path);
5008
WERROR reg_setvalue(struct registry_key *key, const char *name,
5009
const struct registry_value *val);
5010
WERROR reg_deletevalue(struct registry_key *key, const char *name);
5011
WERROR reg_getkeysecurity(TALLOC_CTX *mem_ctx, struct registry_key *key,
5012
struct security_descriptor **psecdesc);
5013
WERROR reg_setkeysecurity(struct registry_key *key,
5014
struct security_descriptor *psecdesc);
5015
WERROR reg_getversion(uint32_t *version);
5016
WERROR reg_restorekey(struct registry_key *key, const char *fname);
5017
WERROR reg_savekey(struct registry_key *key, const char *fname);
5018
WERROR reg_deleteallvalues(struct registry_key *key);
5019
WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path,
5020
uint32 desired_access, const struct nt_user_token *token,
5021
struct registry_key **pkey);
5022
WERROR reg_deletekey_recursive(TALLOC_CTX *ctx,
5023
struct registry_key *parent,
5025
WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx,
5026
struct registry_key *parent,
5028
WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path,
5029
uint32 desired_access,
5030
const struct nt_user_token *token,
5031
enum winreg_CreateAction *paction,
5032
struct registry_key **pkey);
5033
WERROR reg_delete_path(const struct nt_user_token *token,
5034
const char *orig_path);
5036
/* The following definitions come from registry/reg_backend_current_version.c */
5039
/* The following definitions come from registry/reg_backend_db.c */
5041
WERROR init_registry_key(const char *add_path);
5042
WERROR init_registry_data(void);
5043
WERROR regdb_init(void);
5044
WERROR regdb_open( void );
5045
int regdb_close( void );
5046
WERROR regdb_transaction_start(void);
5047
WERROR regdb_transaction_commit(void);
5048
WERROR regdb_transaction_cancel(void);
5049
int regdb_get_seqnum(void);
5050
bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr);
5051
int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr);
5052
int regdb_fetch_values(const char* key, struct regval_ctr *values);
5053
bool regdb_store_values(const char *key, struct regval_ctr *values);
5054
bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys);
5055
bool regdb_values_need_update(struct regval_ctr *values);
5057
/* The following definitions come from registry/reg_backend_hkpt_params.c */
5060
/* The following definitions come from registry/reg_backend_netlogon_params.c */
5063
/* The following definitions come from registry/reg_backend_perflib.c */
5066
/* The following definitions come from registry/reg_backend_printing.c */
5069
/* The following definitions come from registry/reg_backend_prod_options.c */
5072
/* The following definitions come from registry/reg_backend_shares.c */
5075
/* The following definitions come from registry/reg_backend_smbconf.c */
5078
/* The following definitions come from registry/reg_backend_tcpip_params.c */
5081
/* The following definitions come from registry/reg_cachehook.c */
5083
WERROR reghook_cache_init(void);
5084
WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops);
5085
struct registry_ops *reghook_cache_find(const char *keyname);
5086
void reghook_dump_cache( int debuglevel );
5088
/* The following definitions come from registry/reg_dispatcher.c */
5090
bool store_reg_keys(struct registry_key_handle *key,
5091
struct regsubkey_ctr *subkeys);
5092
bool store_reg_values(struct registry_key_handle *key, struct regval_ctr *val);
5093
WERROR create_reg_subkey(struct registry_key_handle *key, const char *subkey);
5094
WERROR delete_reg_subkey(struct registry_key_handle *key, const char *subkey);
5095
int fetch_reg_keys(struct registry_key_handle *key,
5096
struct regsubkey_ctr *subkey_ctr);
5097
int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val);
5098
bool regkey_access_check(struct registry_key_handle *key, uint32 requested,
5100
const struct nt_user_token *token);
5101
WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, struct registry_key_handle *key,
5102
struct security_descriptor **psecdesc);
5103
WERROR regkey_set_secdesc(struct registry_key_handle *key,
5104
struct security_descriptor *psecdesc);
5105
bool reg_subkeys_need_update(struct registry_key_handle *key,
5106
struct regsubkey_ctr *subkeys);
5107
bool reg_values_need_update(struct registry_key_handle *key,
5108
struct regval_ctr *values);
5110
/* The following definitions come from registry/reg_eventlog.c */
5112
bool eventlog_init_keys(void);
5113
bool eventlog_add_source( const char *eventlog, const char *sourcename,
5114
const char *messagefile );
5116
/* The following definitions come from registry/reg_init_basic.c */
5118
WERROR registry_init_common(void);
5119
WERROR registry_init_basic(void);
5121
/* The following definitions come from registry/reg_init_full.c */
5123
WERROR registry_init_full(void);
5125
/* The following definitions come from registry/reg_init_smbconf.c */
5127
NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx,
5128
NT_USER_TOKEN **ptoken);
5129
WERROR registry_init_smbconf(const char *keyname);
5131
/* The following definitions come from registry/reg_objects.c */
5133
WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr);
5134
WERROR regsubkey_ctr_reinit(struct regsubkey_ctr *ctr);
5135
WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum);
5136
int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr);
5137
WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
5138
WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
5139
bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
5140
int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr );
5141
char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index );
5142
int regval_ctr_numvals(struct regval_ctr *ctr);
5143
struct regval_blob* dup_registry_value(struct regval_blob *val);
5144
void free_registry_value(struct regval_blob *val);
5145
uint8* regval_data_p(struct regval_blob *val);
5146
uint32 regval_size(struct regval_blob *val);
5147
char* regval_name(struct regval_blob *val);
5148
uint32 regval_type(struct regval_blob *val);
5149
struct regval_blob* regval_ctr_specific_value(struct regval_ctr *ctr,
5151
bool regval_ctr_key_exists(struct regval_ctr *ctr, const char *value);
5152
struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
5154
const char *data_p, size_t size);
5155
int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16 type,
5156
const char *data_p, size_t size);
5157
int regval_ctr_addvalue_sz(struct regval_ctr *ctr, const char *name, const char *data);
5158
int regval_ctr_addvalue_multi_sz(struct regval_ctr *ctr, const char *name, const char **data);
5159
int regval_ctr_copyvalue(struct regval_ctr *ctr, struct regval_blob *val);
5160
int regval_ctr_delvalue(struct regval_ctr *ctr, const char *name);
5161
struct regval_blob* regval_ctr_getvalue(struct regval_ctr *ctr,
5163
uint32 regval_dword(struct regval_blob *val);
5164
const char *regval_sz(struct regval_blob *val);
5166
/* The following definitions come from registry/reg_perfcount.c */
5168
void perfcount_init_keys( void );
5169
uint32 reg_perfcount_get_base_index(void);
5170
uint32 reg_perfcount_get_last_counter(uint32 base_index);
5171
uint32 reg_perfcount_get_last_help(uint32 last_counter);
5172
uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf);
5173
uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf);
5174
WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids);
5176
/* The following definitions come from registry/reg_util.c */
5178
bool reg_split_path(char *path, char **base, char **new_path);
5179
bool reg_split_key(char *path, char **base, char **key);
5180
char *normalize_reg_path(TALLOC_CTX *ctx, const char *keyname );
5181
void normalize_dbkey(char *key);
5182
char *reg_remaining_path(TALLOC_CTX *ctx, const char *key);
5184
/* The following definitions come from registry/reg_util_legacy.c */
5186
WERROR regkey_open_internal(TALLOC_CTX *ctx,
5187
struct registry_key_handle **regkey,
5189
const struct nt_user_token *token,
5190
uint32 access_desired );
5192
/* The following definitions come from registry/regfio.c */
5195
/* The following definitions come from rpc_client/cli_lsarpc.c */
5197
NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
5198
TALLOC_CTX *mem_ctx,
5199
bool sec_qos, uint32 des_access,
5200
struct policy_handle *pol);
5201
NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
5202
TALLOC_CTX *mem_ctx, bool sec_qos,
5203
uint32 des_access, struct policy_handle *pol);
5204
NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
5205
TALLOC_CTX *mem_ctx,
5206
struct policy_handle *pol,
5208
const DOM_SID *sids,
5211
enum lsa_SidType **ptypes);
5212
NTSTATUS rpccli_lsa_lookup_sids3(struct rpc_pipe_client *cli,
5213
TALLOC_CTX *mem_ctx,
5214
struct policy_handle *pol,
5216
const DOM_SID *sids,
5219
enum lsa_SidType **ptypes);
5220
NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
5221
TALLOC_CTX *mem_ctx,
5222
struct policy_handle *pol, int num_names,
5224
const char ***dom_names,
5227
enum lsa_SidType **types);
5228
NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli,
5229
TALLOC_CTX *mem_ctx,
5230
struct policy_handle *pol, int num_names,
5232
const char ***dom_names,
5235
enum lsa_SidType **types);
5237
bool fetch_domain_sid( char *domain, char *remote_machine, DOM_SID *psid);
5239
/* The following definitions come from rpc_client/cli_netlogon.c */
5241
NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli,
5242
const char *server_name,
5244
const char *clnt_name,
5245
const char *machine_account,
5246
const unsigned char machine_pwd[16],
5247
enum netr_SchannelType sec_chan_type,
5248
uint32_t *neg_flags_inout);
5249
NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
5250
TALLOC_CTX *mem_ctx,
5251
uint32 logon_parameters,
5253
const char *username,
5254
const char *password,
5255
const char *workstation,
5257
NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli,
5258
TALLOC_CTX *mem_ctx,
5259
uint32 logon_parameters,
5261
const char *username,
5263
const char *workstation,
5264
const uint8 chal[8],
5265
uint16_t validation_level,
5266
DATA_BLOB lm_response,
5267
DATA_BLOB nt_response,
5268
struct netr_SamInfo3 **info3);
5269
NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
5270
TALLOC_CTX *mem_ctx,
5271
uint32 logon_parameters,
5273
const char *username,
5275
const char *workstation,
5276
const uint8 chal[8],
5277
uint16_t validation_level,
5278
DATA_BLOB lm_response,
5279
DATA_BLOB nt_response,
5280
struct netr_SamInfo3 **info3);
5281
NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
5282
TALLOC_CTX *mem_ctx,
5283
const char *account_name,
5284
const unsigned char orig_trust_passwd_hash[16],
5285
const char *new_trust_pwd_cleartext,
5286
const unsigned char new_trust_passwd_hash[16],
5287
enum netr_SchannelType sec_channel_type);
5289
/* The following definitions come from rpc_client/cli_pipe.c */
5291
struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
5292
struct event_context *ev,
5293
struct rpc_pipe_client *cli,
5295
prs_struct *req_data);
5296
NTSTATUS rpc_api_pipe_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
5297
prs_struct *reply_pdu);
5298
struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
5299
struct event_context *ev,
5300
struct rpc_pipe_client *cli,
5301
struct cli_pipe_auth_data *auth);
5302
NTSTATUS rpc_pipe_bind_recv(struct tevent_req *req);
5303
NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
5304
struct cli_pipe_auth_data *auth);
5305
unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
5306
unsigned int timeout);
5307
bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli);
5308
bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
5309
NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
5310
struct cli_pipe_auth_data **presult);
5311
NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx, const char *domain,
5312
enum dcerpc_AuthLevel auth_level,
5313
struct netlogon_creds_CredentialState *creds,
5314
struct cli_pipe_auth_data **presult);
5315
NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
5316
const struct ndr_syntax_id *abstract_syntax,
5317
struct rpc_pipe_client **presult);
5318
NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
5319
const struct ndr_syntax_id *abstract_syntax,
5320
struct rpc_pipe_client **presult);
5321
NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax,
5322
NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r),
5323
struct auth_serversupplied_info *serversupplied_info,
5324
struct rpc_pipe_client **presult);
5325
NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
5326
const struct ndr_syntax_id *interface,
5327
struct rpc_pipe_client **presult);
5328
NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
5329
enum dcerpc_transport_t transport,
5330
const struct ndr_syntax_id *interface,
5331
struct rpc_pipe_client **presult);
5332
NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
5333
const struct ndr_syntax_id *interface,
5334
enum dcerpc_transport_t transport,
5335
enum dcerpc_AuthLevel auth_level,
5337
const char *username,
5338
const char *password,
5339
struct rpc_pipe_client **presult);
5340
NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
5341
const struct ndr_syntax_id *interface,
5342
enum dcerpc_transport_t transport,
5343
enum dcerpc_AuthLevel auth_level,
5345
const char *username,
5346
const char *password,
5347
struct rpc_pipe_client **presult);
5348
NTSTATUS get_schannel_session_key(struct cli_state *cli,
5351
struct rpc_pipe_client **presult);
5352
NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
5353
const struct ndr_syntax_id *interface,
5354
enum dcerpc_transport_t transport,
5355
enum dcerpc_AuthLevel auth_level,
5357
struct netlogon_creds_CredentialState **pdc,
5358
struct rpc_pipe_client **presult);
5359
NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
5360
const struct ndr_syntax_id *interface,
5361
enum dcerpc_transport_t transport,
5362
enum dcerpc_AuthLevel auth_level,
5364
const char *username,
5365
const char *password,
5366
struct rpc_pipe_client **presult);
5367
NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
5368
const struct ndr_syntax_id *interface,
5369
enum dcerpc_transport_t transport,
5370
enum dcerpc_AuthLevel auth_level,
5372
struct rpc_pipe_client **presult);
5373
NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
5374
const struct ndr_syntax_id *interface,
5375
enum dcerpc_AuthLevel auth_level,
5376
const char *service_princ,
5377
const char *username,
5378
const char *password,
5379
struct rpc_pipe_client **presult);
5380
NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
5381
struct rpc_pipe_client *cli,
5382
DATA_BLOB *session_key);
5383
NTSTATUS rpc_pipe_open_local(TALLOC_CTX *mem_ctx,
5384
struct rpc_cli_smbd_conn *conn,
5385
const struct ndr_syntax_id *syntax,
5386
struct rpc_pipe_client **presult);
5388
/* The following definitions come from rpc_client/rpc_transport_np.c */
5390
struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
5391
struct event_context *ev,
5392
struct cli_state *cli,
5393
const struct ndr_syntax_id *abstract_syntax);
5394
NTSTATUS rpc_transport_np_init_recv(struct tevent_req *req,
5395
TALLOC_CTX *mem_ctx,
5396
struct rpc_cli_transport **presult);
5397
NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli,
5398
const struct ndr_syntax_id *abstract_syntax,
5399
struct rpc_cli_transport **presult);
5400
struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
5402
/* The following definitions come from rpc_client/rpc_transport_smbd.c */
5404
struct tevent_req *rpc_cli_smbd_conn_init_send(TALLOC_CTX *mem_ctx,
5405
struct event_context *ev,
5406
void (*stdout_callback)(char *buf,
5410
NTSTATUS rpc_cli_smbd_conn_init_recv(struct tevent_req *req,
5411
TALLOC_CTX *mem_ctx,
5412
struct rpc_cli_smbd_conn **pconn);
5413
NTSTATUS rpc_cli_smbd_conn_init(TALLOC_CTX *mem_ctx,
5414
struct rpc_cli_smbd_conn **pconn,
5415
void (*stdout_callback)(char *buf,
5420
struct tevent_req *rpc_transport_smbd_init_send(TALLOC_CTX *mem_ctx,
5421
struct event_context *ev,
5422
struct rpc_cli_smbd_conn *conn,
5423
const struct ndr_syntax_id *abstract_syntax);
5424
NTSTATUS rpc_transport_smbd_init_recv(struct tevent_req *req,
5425
TALLOC_CTX *mem_ctx,
5426
struct rpc_cli_transport **presult);
5427
NTSTATUS rpc_transport_smbd_init(TALLOC_CTX *mem_ctx,
5428
struct rpc_cli_smbd_conn *conn,
5429
const struct ndr_syntax_id *abstract_syntax,
5430
struct rpc_cli_transport **presult);
5431
struct cli_state *rpc_pipe_smbd_smb_conn(struct rpc_pipe_client *p);
5433
/* The following definitions come from rpc_client/rpc_transport_sock.c */
5435
NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd,
5436
struct rpc_cli_transport **presult);
5438
/* The following definitions come from rpc_client/cli_samr.c */
5440
NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
5441
TALLOC_CTX *mem_ctx,
5442
struct policy_handle *user_handle,
5443
const char *newpassword,
5444
const char *oldpassword);
5445
NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli,
5446
TALLOC_CTX *mem_ctx,
5447
const char *username,
5448
const char *newpassword,
5449
const char *oldpassword);
5450
NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
5451
TALLOC_CTX *mem_ctx,
5452
const char *username,
5453
DATA_BLOB new_nt_password_blob,
5454
DATA_BLOB old_nt_hash_enc_blob,
5455
DATA_BLOB new_lm_password_blob,
5456
DATA_BLOB old_lm_hash_enc_blob);
5457
NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
5458
TALLOC_CTX *mem_ctx,
5459
const char *username,
5460
const char *newpassword,
5461
const char *oldpassword,
5462
struct samr_DomInfo1 **dominfo1,
5463
struct samr_ChangeReject **reject);
5464
void get_query_dispinfo_params(int loop_count, uint32 *max_entries,
5466
NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
5467
TALLOC_CTX *mem_ctx,
5468
uint32_t access_mask,
5469
struct policy_handle *connect_pol);
5471
/* The following definitions come from rpc_client/cli_spoolss.c */
5473
WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli,
5474
TALLOC_CTX *mem_ctx,
5475
const char *printername,
5476
uint32_t access_desired,
5477
struct policy_handle *handle);
5478
WERROR rpccli_spoolss_getprinterdriver(struct rpc_pipe_client *cli,
5479
TALLOC_CTX *mem_ctx,
5480
struct policy_handle *handle,
5481
const char *architecture,
5484
union spoolss_DriverInfo *info);
5485
WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli,
5486
TALLOC_CTX *mem_ctx,
5487
struct policy_handle *handle,
5488
const char *architecture,
5491
uint32_t client_major_version,
5492
uint32_t client_minor_version,
5493
union spoolss_DriverInfo *info,
5494
uint32_t *server_major_version,
5495
uint32_t *server_minor_version);
5496
WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli,
5497
TALLOC_CTX *mem_ctx,
5498
struct spoolss_SetPrinterInfoCtr *info_ctr);
5499
WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli,
5500
TALLOC_CTX *mem_ctx,
5501
struct policy_handle *handle,
5504
union spoolss_PrinterInfo *info);
5505
WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli,
5506
TALLOC_CTX *mem_ctx,
5507
struct policy_handle *handle,
5511
union spoolss_JobInfo *info);
5512
WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli,
5513
TALLOC_CTX *mem_ctx,
5514
struct policy_handle *handle,
5518
union spoolss_FormInfo **info);
5519
WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli,
5520
TALLOC_CTX *mem_ctx,
5521
const char *servername,
5522
const char *environment,
5526
union spoolss_PrintProcessorInfo **info);
5527
WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli,
5528
TALLOC_CTX *mem_ctx,
5529
const char *servername,
5530
const char *print_processor_name,
5534
union spoolss_PrintProcDataTypesInfo **info);
5535
WERROR rpccli_spoolss_enumports(struct rpc_pipe_client *cli,
5536
TALLOC_CTX *mem_ctx,
5537
const char *servername,
5541
union spoolss_PortInfo **info);
5542
WERROR rpccli_spoolss_enummonitors(struct rpc_pipe_client *cli,
5543
TALLOC_CTX *mem_ctx,
5544
const char *servername,
5548
union spoolss_MonitorInfo **info);
5549
WERROR rpccli_spoolss_enumjobs(struct rpc_pipe_client *cli,
5550
TALLOC_CTX *mem_ctx,
5551
struct policy_handle *handle,
5557
union spoolss_JobInfo **info);
5558
WERROR rpccli_spoolss_enumprinterdrivers(struct rpc_pipe_client *cli,
5559
TALLOC_CTX *mem_ctx,
5561
const char *environment,
5565
union spoolss_DriverInfo **info);
5566
WERROR rpccli_spoolss_enumprinters(struct rpc_pipe_client *cli,
5567
TALLOC_CTX *mem_ctx,
5573
union spoolss_PrinterInfo **info);
5574
WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli,
5575
TALLOC_CTX *mem_ctx,
5576
struct policy_handle *handle,
5577
const char *value_name,
5579
enum winreg_Type *type,
5582
WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
5583
TALLOC_CTX *mem_ctx,
5584
struct policy_handle *handle,
5585
const char *key_name,
5586
const char ***key_buffer,
5588
WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli,
5589
TALLOC_CTX *mem_ctx,
5590
struct policy_handle *handle,
5591
const char *key_name,
5594
struct spoolss_PrinterEnumValues **info);
5596
/* The following definitions come from rpc_client/init_spoolss.c */
5598
bool init_systemtime(struct spoolss_Time *r,
5599
struct tm *unixtime);
5600
WERROR pull_spoolss_PrinterData(TALLOC_CTX *mem_ctx,
5601
const DATA_BLOB *blob,
5602
union spoolss_PrinterData *data,
5603
enum winreg_Type type);
5604
WERROR push_spoolss_PrinterData(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
5605
enum winreg_Type type,
5606
union spoolss_PrinterData *data);
5607
void spoolss_printerinfo2_to_setprinterinfo2(const struct spoolss_PrinterInfo2 *i,
5608
struct spoolss_SetPrinterInfo2 *s);
5610
/* The following definitions come from rpc_client/init_lsa.c */
5612
void init_lsa_String(struct lsa_String *name, const char *s);
5613
void init_lsa_StringLarge(struct lsa_StringLarge *name, const char *s);
5614
void init_lsa_AsciiString(struct lsa_AsciiString *name, const char *s);
5615
void init_lsa_AsciiStringLarge(struct lsa_AsciiStringLarge *name, const char *s);
5617
/* The following definitions come from rpc_client/init_netlogon.c */
5619
NTSTATUS serverinfo_to_SamInfo2(struct auth_serversupplied_info *server_info,
5620
uint8_t *pipe_session_key,
5621
size_t pipe_session_key_len,
5622
struct netr_SamInfo2 *sam2);
5623
NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info,
5624
uint8_t *pipe_session_key,
5625
size_t pipe_session_key_len,
5626
struct netr_SamInfo3 *sam3);
5627
NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info,
5628
uint8_t *pipe_session_key,
5629
size_t pipe_session_key_len,
5630
struct netr_SamInfo6 *sam6);
5631
void init_netr_CryptPassword(const char *pwd,
5632
unsigned char session_key[16],
5633
struct netr_CryptPassword *pwd_buf);
5635
/* The following definitions come from rpc_client/init_samr.c */
5637
void init_samr_CryptPasswordEx(const char *pwd,
5638
DATA_BLOB *session_key,
5639
struct samr_CryptPasswordEx *pwd_buf);
5640
void init_samr_CryptPassword(const char *pwd,
5641
DATA_BLOB *session_key,
5642
struct samr_CryptPassword *pwd_buf);
5644
/* The following definitions come from rpc_client/ndr.c */
5646
struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx,
5647
struct tevent_context *ev,
5648
struct rpc_pipe_client *cli,
5649
const struct ndr_interface_table *table,
5652
NTSTATUS cli_do_rpc_ndr_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5653
NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
5654
TALLOC_CTX *mem_ctx,
5655
const struct ndr_interface_table *table,
5656
uint32 opnum, void *r);
5658
/* The following definitions come from rpc_parse/parse_misc.c */
5660
bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth);
5661
bool smb_io_uuid(const char *desc, struct GUID *uuid,
5662
prs_struct *ps, int depth);
5664
/* The following definitions come from rpc_parse/parse_prs.c */
5666
void prs_dump(const char *name, int v, prs_struct *ps);
5667
void prs_dump_before(const char *name, int v, prs_struct *ps);
5668
void prs_dump_region(const char *name, int v, prs_struct *ps,
5669
int from_off, int to_off);
5670
void prs_debug(prs_struct *ps, int depth, const char *desc, const char *fn_name);
5671
bool prs_init(prs_struct *ps, uint32 size, TALLOC_CTX *ctx, bool io);
5672
void prs_mem_free(prs_struct *ps);
5673
void prs_mem_clear(prs_struct *ps);
5674
char *prs_alloc_mem_(prs_struct *ps, size_t size, unsigned int count);
5675
char *prs_alloc_mem(prs_struct *ps, size_t size, unsigned int count);
5676
TALLOC_CTX *prs_get_mem_context(prs_struct *ps);
5677
void prs_give_memory(prs_struct *ps, char *buf, uint32 size, bool is_dynamic);
5678
char *prs_take_memory(prs_struct *ps, uint32 *psize);
5679
bool prs_set_buffer_size(prs_struct *ps, uint32 newsize);
5680
bool prs_grow(prs_struct *ps, uint32 extra_space);
5681
bool prs_force_grow(prs_struct *ps, uint32 extra_space);
5682
char *prs_data_p(prs_struct *ps);
5683
uint32 prs_data_size(prs_struct *ps);
5684
uint32 prs_offset(prs_struct *ps);
5685
bool prs_set_offset(prs_struct *ps, uint32 offset);
5686
bool prs_append_prs_data(prs_struct *dst, prs_struct *src);
5687
bool prs_append_some_data(prs_struct *dst, void *src_base, uint32_t start,
5689
bool prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len);
5690
bool prs_copy_data_in(prs_struct *dst, const char *src, uint32 len);
5691
bool prs_copy_data_out(char *dst, prs_struct *src, uint32 len);
5692
bool prs_copy_all_data_out(char *dst, prs_struct *src);
5693
void prs_set_endian_data(prs_struct *ps, bool endian);
5694
bool prs_align(prs_struct *ps);
5695
bool prs_align_uint16(prs_struct *ps);
5696
bool prs_align_uint64(prs_struct *ps);
5697
bool prs_align_custom(prs_struct *ps, uint8 boundary);
5698
bool prs_align_needed(prs_struct *ps, uint32 needed);
5699
char *prs_mem_get(prs_struct *ps, uint32 extra_size);
5700
void prs_switch_type(prs_struct *ps, bool io);
5701
void prs_force_dynamic(prs_struct *ps);
5702
void prs_set_session_key(prs_struct *ps, const char sess_key[16]);
5703
bool prs_uint8(const char *name, prs_struct *ps, int depth, uint8 *data8);
5704
bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16);
5705
bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32);
5706
bool prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32);
5707
bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64);
5708
bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *status);
5709
bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
5710
bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
5711
bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
5712
bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str);
5713
bool prs_init_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
5714
bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
5716
/* The following definitions come from rpc_parse/parse_rpc.c */
5718
bool smb_register_ndr_interface(const struct ndr_interface_table *interface);
5719
const struct ndr_interface_table *get_iface_from_syntax(
5720
const struct ndr_syntax_id *syntax);
5721
const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx,
5722
const struct ndr_syntax_id *syntax);
5723
void init_rpc_hdr(RPC_HDR *hdr, enum dcerpc_pkt_type pkt_type, uint8 flags,
5724
uint32 call_id, int data_len, int auth_len);
5725
bool smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth);
5726
void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id,
5727
const struct ndr_syntax_id *abstract,
5728
const struct ndr_syntax_id *transfer);
5729
void init_rpc_hdr_rb(RPC_HDR_RB *rpc,
5730
uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
5731
RPC_CONTEXT *context);
5732
bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps, int depth);
5733
bool smb_io_rpc_hdr_rb(const char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth);
5734
void init_rpc_hdr_ba(RPC_HDR_BA *rpc,
5735
uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
5736
const char *pipe_addr,
5737
uint8 num_results, uint16 result, uint16 reason,
5738
const struct ndr_syntax_id *transfer);
5739
bool smb_io_rpc_hdr_ba(const char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth);
5740
void init_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum);
5741
bool smb_io_rpc_hdr_req(const char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth);
5742
bool smb_io_rpc_hdr_resp(const char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth);
5743
bool smb_io_rpc_hdr_fault(const char *desc, RPC_HDR_FAULT *rpc, prs_struct *ps, int depth);
5744
void init_rpc_hdr_auth(RPC_HDR_AUTH *rai,
5745
uint8 auth_type, uint8 auth_level,
5747
uint32 auth_context_id);
5748
bool smb_io_rpc_hdr_auth(const char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
5750
/* The following definitions come from lib/eventlog/eventlog.c */
5752
TDB_CONTEXT *elog_init_tdb( char *tdbfilename );
5753
char *elog_tdbname(TALLOC_CTX *ctx, const char *name );
5754
int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention );
5755
bool prune_eventlog( TDB_CONTEXT * tdb );
5756
ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only );
5757
int elog_close_tdb( ELOG_TDB *etdb, bool force_close );
5758
bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor );
5759
size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r);
5760
struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx,
5762
uint32_t record_number);
5763
NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
5765
struct eventlog_Record_tdb *r,
5766
uint32_t *record_number);
5767
NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx,
5769
struct EVENTLOGRECORD *r,
5770
uint32_t *record_number);
5771
struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx,
5773
uint32_t record_number);
5774
NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx,
5775
const struct EVENTLOGRECORD *e,
5776
struct eventlog_Record_tdb *t);
5777
NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
5778
const struct eventlog_Record_tdb *t,
5779
struct EVENTLOGRECORD *e);
5780
NTSTATUS evlog_convert_tdb_to_evt(TALLOC_CTX *mem_ctx,
5783
uint32_t *num_records_p);
5785
/* The following definitions come from rpc_server/srv_eventlog_nt.c */
5787
/* The following definitions come from rpc_server/srv_lsa_hnd.c */
5789
size_t num_pipe_handles(struct handle_list *list);
5790
bool init_pipe_handle_list(pipes_struct *p,
5791
const struct ndr_syntax_id *syntax);
5792
bool create_policy_hnd(pipes_struct *p, struct policy_handle *hnd, void *data_ptr);
5793
bool find_policy_by_hnd(pipes_struct *p, const struct policy_handle *hnd,
5795
bool close_policy_hnd(pipes_struct *p, struct policy_handle *hnd);
5796
void close_policy_by_pipe(pipes_struct *p);
5797
bool pipe_access_check(pipes_struct *p);
5799
void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
5800
uint32_t access_granted, size_t data_size,
5801
const char *type, NTSTATUS *pstatus);
5802
#define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \
5803
(_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \
5806
void *_policy_handle_find(struct pipes_struct *p,
5807
const struct policy_handle *hnd,
5808
uint32_t access_required, uint32_t *paccess_granted,
5809
const char *name, const char *location,
5811
#define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \
5812
(_type *)_policy_handle_find((_p), (_hnd), (_access_required), \
5813
(_access_granted), #_type, __location__, (_pstatus))
5816
/* The following definitions come from rpc_server/srv_pipe.c */
5818
bool create_next_pdu(pipes_struct *p);
5819
bool api_pipe_bind_auth3(pipes_struct *p, prs_struct *rpc_in_p);
5820
bool setup_fault_pdu(pipes_struct *p, NTSTATUS status);
5821
bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p);
5822
NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
5824
const struct ndr_syntax_id *interface,
5825
const struct api_struct *cmds, int size);
5826
NTSTATUS rpc_srv_register(int version, const char *clnt,
5828
const struct ndr_interface_table *iface,
5829
const struct api_struct *cmds, int size);
5830
bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax);
5831
bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p);
5832
bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p);
5833
bool api_pipe_ntlmssp_auth_process(pipes_struct *p, prs_struct *rpc_in,
5834
uint32 *p_ss_padding_len, NTSTATUS *pstatus);
5835
bool api_pipe_schannel_process(pipes_struct *p, prs_struct *rpc_in, uint32 *p_ss_padding_len);
5836
void free_pipe_rpc_context( PIPE_RPC_FNS *list );
5837
bool api_pipe_request(pipes_struct *p);
5839
/* The following definitions come from rpc_server/srv_pipe_hnd.c */
5841
pipes_struct *get_first_internal_pipe(void);
5842
pipes_struct *get_next_internal_pipe(pipes_struct *p);
5844
bool fsp_is_np(struct files_struct *fsp);
5845
NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
5846
const char *client_address,
5847
struct auth_serversupplied_info *server_info,
5848
struct fake_file_handle **phandle);
5849
struct tevent_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
5850
struct fake_file_handle *handle,
5851
const uint8_t *data, size_t len);
5852
NTSTATUS np_write_recv(struct tevent_req *req, ssize_t *pnwritten);
5853
struct tevent_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
5854
struct fake_file_handle *handle,
5855
uint8_t *data, size_t len);
5856
NTSTATUS np_read_recv(struct tevent_req *req, ssize_t *nread,
5857
bool *is_data_outstanding);
5859
/* The following definitions come from rpc_server/srv_samr_util.c */
5861
void copy_id2_to_sam_passwd(struct samu *to,
5862
struct samr_UserInfo2 *from);
5863
void copy_id4_to_sam_passwd(struct samu *to,
5864
struct samr_UserInfo4 *from);
5865
void copy_id6_to_sam_passwd(struct samu *to,
5866
struct samr_UserInfo6 *from);
5867
void copy_id8_to_sam_passwd(struct samu *to,
5868
struct samr_UserInfo8 *from);
5869
void copy_id10_to_sam_passwd(struct samu *to,
5870
struct samr_UserInfo10 *from);
5871
void copy_id11_to_sam_passwd(struct samu *to,
5872
struct samr_UserInfo11 *from);
5873
void copy_id12_to_sam_passwd(struct samu *to,
5874
struct samr_UserInfo12 *from);
5875
void copy_id13_to_sam_passwd(struct samu *to,
5876
struct samr_UserInfo13 *from);
5877
void copy_id14_to_sam_passwd(struct samu *to,
5878
struct samr_UserInfo14 *from);
5879
void copy_id16_to_sam_passwd(struct samu *to,
5880
struct samr_UserInfo16 *from);
5881
void copy_id17_to_sam_passwd(struct samu *to,
5882
struct samr_UserInfo17 *from);
5883
void copy_id18_to_sam_passwd(struct samu *to,
5884
struct samr_UserInfo18 *from);
5885
void copy_id20_to_sam_passwd(struct samu *to,
5886
struct samr_UserInfo20 *from);
5887
void copy_id21_to_sam_passwd(const char *log_prefix,
5889
struct samr_UserInfo21 *from);
5890
void copy_id23_to_sam_passwd(struct samu *to,
5891
struct samr_UserInfo23 *from);
5892
void copy_id24_to_sam_passwd(struct samu *to,
5893
struct samr_UserInfo24 *from);
5894
void copy_id25_to_sam_passwd(struct samu *to,
5895
struct samr_UserInfo25 *from);
5896
void copy_id26_to_sam_passwd(struct samu *to,
5897
struct samr_UserInfo26 *from);
5899
/* The following definitions come from rpc_server/srv_spoolss_nt.c */
5901
void do_drv_upgrade_printer(struct messaging_context *msg,
5904
struct server_id server_id,
5906
void update_monitored_printq_cache( void );
5907
void reset_all_printerdata(struct messaging_context *msg,
5910
struct server_id server_id,
5912
bool convert_devicemode(const char *printername,
5913
const struct spoolss_DeviceMode *devmode,
5914
NT_DEVICEMODE **pp_nt_devmode);
5915
WERROR set_printer_dataex(NT_PRINTER_INFO_LEVEL *printer,
5916
const char *key, const char *value,
5917
uint32_t type, uint8_t *data, int real_len);
5918
void spoolss_notify_server_name(int snum,
5919
struct spoolss_Notify *data,
5920
print_queue_struct *queue,
5921
NT_PRINTER_INFO_LEVEL *printer,
5922
TALLOC_CTX *mem_ctx);
5923
void spoolss_notify_printer_name(int snum,
5924
struct spoolss_Notify *data,
5925
print_queue_struct *queue,
5926
NT_PRINTER_INFO_LEVEL *printer,
5927
TALLOC_CTX *mem_ctx);
5928
void spoolss_notify_share_name(int snum,
5929
struct spoolss_Notify *data,
5930
print_queue_struct *queue,
5931
NT_PRINTER_INFO_LEVEL *printer,
5932
TALLOC_CTX *mem_ctx);
5933
void spoolss_notify_port_name(int snum,
5934
struct spoolss_Notify *data,
5935
print_queue_struct *queue,
5936
NT_PRINTER_INFO_LEVEL *printer,
5937
TALLOC_CTX *mem_ctx);
5938
void spoolss_notify_driver_name(int snum,
5939
struct spoolss_Notify *data,
5940
print_queue_struct *queue,
5941
NT_PRINTER_INFO_LEVEL *printer,
5942
TALLOC_CTX *mem_ctx);
5943
void spoolss_notify_comment(int snum,
5944
struct spoolss_Notify *data,
5945
print_queue_struct *queue,
5946
NT_PRINTER_INFO_LEVEL *printer,
5947
TALLOC_CTX *mem_ctx);
5948
void spoolss_notify_location(int snum,
5949
struct spoolss_Notify *data,
5950
print_queue_struct *queue,
5951
NT_PRINTER_INFO_LEVEL *printer,
5952
TALLOC_CTX *mem_ctx);
5953
void spoolss_notify_sepfile(int snum,
5954
struct spoolss_Notify *data,
5955
print_queue_struct *queue,
5956
NT_PRINTER_INFO_LEVEL *printer,
5957
TALLOC_CTX *mem_ctx);
5958
void spoolss_notify_print_processor(int snum,
5959
struct spoolss_Notify *data,
5960
print_queue_struct *queue,
5961
NT_PRINTER_INFO_LEVEL *printer,
5962
TALLOC_CTX *mem_ctx);
5963
void spoolss_notify_parameters(int snum,
5964
struct spoolss_Notify *data,
5965
print_queue_struct *queue,
5966
NT_PRINTER_INFO_LEVEL *printer,
5967
TALLOC_CTX *mem_ctx);
5968
void spoolss_notify_datatype(int snum,
5969
struct spoolss_Notify *data,
5970
print_queue_struct *queue,
5971
NT_PRINTER_INFO_LEVEL *printer,
5972
TALLOC_CTX *mem_ctx);
5973
void spoolss_notify_attributes(int snum,
5974
struct spoolss_Notify *data,
5975
print_queue_struct *queue,
5976
NT_PRINTER_INFO_LEVEL *printer,
5977
TALLOC_CTX *mem_ctx);
5978
void spoolss_notify_cjobs(int snum,
5979
struct spoolss_Notify *data,
5980
print_queue_struct *queue,
5981
NT_PRINTER_INFO_LEVEL *printer,
5982
TALLOC_CTX *mem_ctx);
5983
void construct_info_data(struct spoolss_Notify *info_data,
5984
enum spoolss_NotifyType type,
5987
struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx,
5988
const char *servicename);
5989
bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer);
5991
/* The following definitions come from rpc_server/srv_srvsvc_nt.c */
5993
char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
5995
/* The following definitions come from rpc_server/srv_svcctl_nt.c */
5997
bool init_service_op_table( void );
5999
/* The following definitions come from rpcclient/cmd_dfs.c */
6002
/* The following definitions come from rpcclient/cmd_dssetup.c */
6005
/* The following definitions come from rpcclient/cmd_echo.c */
6008
/* The following definitions come from rpcclient/cmd_lsarpc.c */
6011
/* The following definitions come from rpcclient/cmd_netlogon.c */
6014
/* The following definitions come from rpcclient/cmd_ntsvcs.c */
6017
/* The following definitions come from rpcclient/cmd_samr.c */
6020
/* The following definitions come from rpcclient/cmd_shutdown.c */
6023
/* The following definitions come from rpcclient/cmd_spoolss.c */
6026
/* The following definitions come from rpcclient/cmd_srvsvc.c */
6029
/* The following definitions come from rpcclient/cmd_test.c */
6032
/* The following definitions come from rpcclient/cmd_wkssvc.c */
6035
/* The following definitions come from rpcclient/rpcclient.c */
6038
/* The following definitions come from services/services_db.c */
6040
void svcctl_init_keys( void );
6041
SEC_DESC *svcctl_get_secdesc( TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token );
6042
bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, SEC_DESC *sec_desc, NT_USER_TOKEN *token );
6043
const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token );
6044
const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token );
6045
struct regval_ctr *svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *token );
6047
/* The following definitions come from services/svc_netlogon.c */
6050
/* The following definitions come from services/svc_rcinit.c */
6053
/* The following definitions come from services/svc_spoolss.c */
6056
/* The following definitions come from services/svc_winreg.c */
6059
/* The following definitions come from services/svc_wins.c */
6062
/* The following definitions come from smbd/aio.c */
6064
void initialize_async_io_handler(void);
6065
bool schedule_aio_read_and_X(connection_struct *conn,
6066
struct smb_request *req,
6067
files_struct *fsp, SMB_OFF_T startpos,
6069
bool schedule_aio_write_and_X(connection_struct *conn,
6070
struct smb_request *req,
6071
files_struct *fsp, char *data,
6074
int wait_for_aio_completion(files_struct *fsp);
6075
void cancel_aio_by_fsp(files_struct *fsp);
6076
void smbd_aio_complete_mid(unsigned int mid);
6078
/* The following definitions come from smbd/blocking.c */
6080
void process_blocking_lock_queue(void);
6081
bool push_blocking_lock_request( struct byte_range_lock *br_lck,
6082
struct smb_request *req,
6087
enum brl_type lock_type,
6088
enum brl_flavour lock_flav,
6091
uint32 blocking_pid);
6092
void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck);
6093
void remove_pending_lock_requests_by_mid(int mid);
6094
bool blocking_lock_was_deferred(int mid);
6095
struct blocking_lock_record *blocking_lock_cancel(files_struct *fsp,
6099
enum brl_flavour lock_flav,
6100
unsigned char locktype,
6103
/* The following definitions come from smbd/change_trust_pw.c */
6105
NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine);
6107
/* The following definitions come from smbd/chgpasswd.c */
6109
bool chgpasswd(const char *name, const struct passwd *pass,
6110
const char *oldpass, const char *newpass, bool as_root);
6111
bool chgpasswd(const char *name, const struct passwd *pass,
6112
const char *oldpass, const char *newpass, bool as_root);
6113
bool check_lanman_password(char *user, uchar * pass1,
6114
uchar * pass2, struct samu **hnd);
6115
bool change_lanman_password(struct samu *sampass, uchar *pass2);
6116
NTSTATUS pass_oem_change(char *user,
6117
uchar password_encrypted_with_lm_hash[516],
6118
const uchar old_lm_hash_encrypted[16],
6119
uchar password_encrypted_with_nt_hash[516],
6120
const uchar old_nt_hash_encrypted[16],
6121
uint32 *reject_reason);
6122
bool password_in_history(uint8_t nt_pw[NT_HASH_LEN],
6123
uint32_t pw_history_len,
6124
const uint8_t *pw_history);
6125
NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, bool as_root, uint32 *samr_reject_reason);
6127
/* The following definitions come from smbd/close.c */
6129
void set_close_write_time(struct files_struct *fsp, struct timespec ts);
6130
NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
6131
enum file_close_type close_type);
6132
void msg_close_file(struct messaging_context *msg_ctx,
6135
struct server_id server_id,
6137
NTSTATUS delete_all_streams(connection_struct *conn, const char *fname);
6139
/* The following definitions come from smbd/conn.c */
6141
void conn_init(struct smbd_server_connection *sconn);
6142
int conn_num_open(struct smbd_server_connection *sconn);
6143
bool conn_snum_used(int snum);
6144
connection_struct *conn_find(struct smbd_server_connection *sconn,
6146
connection_struct *conn_new(struct smbd_server_connection *sconn);
6147
bool conn_close_all(struct smbd_server_connection *sconn);
6148
bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
6149
void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint16 vuid);
6150
void conn_free(connection_struct *conn);
6151
void msg_force_tdis(struct messaging_context *msg,
6154
struct server_id server_id,
6157
/* The following definitions come from smbd/connection.c */
6159
bool yield_connection(connection_struct *conn, const char *name);
6160
int count_current_connections( const char *sharename, bool clear );
6161
int count_all_current_connections(void);
6162
bool claim_connection(connection_struct *conn, const char *name,
6164
bool register_message_flags(bool doreg, uint32 msg_flags);
6166
/* The following definitions come from smbd/dfree.c */
6168
uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
6169
uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
6170
uint64_t get_dfree_info(connection_struct *conn,
6177
/* The following definitions come from smbd/dir.c */
6179
bool make_dir_struct(TALLOC_CTX *ctx,
6187
bool init_dptrs(struct smbd_server_connection *sconn);
6188
char *dptr_path(struct smbd_server_connection *sconn, int key);
6189
char *dptr_wcard(struct smbd_server_connection *sconn, int key);
6190
uint16 dptr_attr(struct smbd_server_connection *sconn, int key);
6191
void dptr_close(struct smbd_server_connection *sconn, int *key);
6192
void dptr_closecnum(connection_struct *conn);
6193
void dptr_idlecnum(connection_struct *conn);
6194
void dptr_closepath(struct smbd_server_connection *sconn,
6195
char *path,uint16 spid);
6196
NTSTATUS dptr_create(connection_struct *conn, const char *path, bool old_handle, bool expect_close,uint16 spid,
6197
const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret);
6198
int dptr_CloseDir(struct dptr_struct *dptr);
6199
void dptr_SeekDir(struct dptr_struct *dptr, long offset);
6200
long dptr_TellDir(struct dptr_struct *dptr);
6201
bool dptr_has_wild(struct dptr_struct *dptr);
6202
int dptr_dnum(struct dptr_struct *dptr);
6203
char *dptr_ReadDirName(TALLOC_CTX *ctx,
6204
struct dptr_struct *dptr,
6206
SMB_STRUCT_STAT *pst);
6207
bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
6208
void dptr_DirCacheAdd(struct dptr_struct *dptr, const char *name, long offset);
6209
void dptr_init_search_op(struct dptr_struct *dptr);
6210
bool dptr_fill(struct smbd_server_connection *sconn,
6211
char *buf1,unsigned int key);
6212
struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
6213
char *buf,int *num);
6214
struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,
6216
bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype);
6217
bool get_dir_entry(TALLOC_CTX *ctx,
6218
struct dptr_struct *dirptr,
6221
char **pp_fname_out,
6224
struct timespec *date,
6226
bool ask_sharemode);
6227
bool is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, bool use_veto);
6228
struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn,
6229
const char *name, const char *mask, uint32 attr);
6230
const char *ReadDirName(struct smb_Dir *dirp, long *poffset,
6231
SMB_STRUCT_STAT *sbuf, char **talloced);
6232
void RewindDir(struct smb_Dir *dirp, long *poffset);
6233
void SeekDir(struct smb_Dir *dirp, long offset);
6234
long TellDir(struct smb_Dir *dirp);
6235
void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset);
6236
bool SearchDir(struct smb_Dir *dirp, const char *name, long *poffset);
6237
NTSTATUS can_delete_directory(struct connection_struct *conn,
6238
const char *dirname);
6240
/* The following definitions come from smbd/dmapi.c */
6242
const void *dmapi_get_current_session(void);
6243
bool dmapi_have_session(void);
6244
bool dmapi_new_session(void);
6245
bool dmapi_destroy_session(void);
6246
uint32 dmapi_file_flags(const char * const path);
6248
/* The following definitions come from smbd/dnsregister.c */
6250
bool smbd_setup_mdns_registration(struct tevent_context *ev,
6251
TALLOC_CTX *mem_ctx,
6254
/* The following definitions come from smbd/dosmode.c */
6256
mode_t unix_mode(connection_struct *conn, int dosmode,
6257
const struct smb_filename *smb_fname,
6258
const char *inherit_from_dir);
6259
uint32 dos_mode_msdfs(connection_struct *conn,
6260
const struct smb_filename *smb_fname);
6261
int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
6262
uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname);
6263
int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
6264
uint32 dosmode, const char *parent_dir, bool newfile);
6265
int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
6266
struct smb_file_time *ft);
6267
bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
6268
bool set_sticky_write_time_fsp(struct files_struct *fsp,
6269
struct timespec mtime);
6271
NTSTATUS set_create_timespec_ea(connection_struct *conn,
6272
const struct smb_filename *smb_fname,
6273
struct timespec create_time);
6275
struct timespec get_create_timespec(connection_struct *conn,
6276
struct files_struct *fsp,
6277
const struct smb_filename *smb_fname);
6279
struct timespec get_change_timespec(connection_struct *conn,
6280
struct files_struct *fsp,
6281
const struct smb_filename *smb_fname);
6283
/* The following definitions come from smbd/error.c */
6285
bool use_nt_status(void);
6286
void error_packet_set(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file);
6287
int error_packet(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file);
6288
void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus,
6289
int line, const char *file);
6290
void reply_force_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode,
6291
int line, const char *file);
6292
void reply_both_error(struct smb_request *req, uint8 eclass, uint32 ecode,
6293
NTSTATUS status, int line, const char *file);
6294
void reply_openerror(struct smb_request *req, NTSTATUS status);
6296
/* The following definitions come from smbd/fake_file.c */
6298
enum FAKE_FILE_TYPE is_fake_file_path(const char *path);
6299
enum FAKE_FILE_TYPE is_fake_file(const struct smb_filename *smb_fname);
6300
NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
6301
uint16_t current_vuid,
6302
enum FAKE_FILE_TYPE fake_file_type,
6303
const struct smb_filename *smb_fname,
6305
files_struct **result);
6306
NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp);
6308
/* The following definitions come from smbd/file_access.c */
6310
bool can_access_file_acl(struct connection_struct *conn,
6311
const struct smb_filename *smb_fname,
6312
uint32_t access_mask);
6313
bool can_delete_file_in_directory(connection_struct *conn,
6314
struct smb_filename *smb_fname);
6315
bool can_access_file_data(connection_struct *conn,
6316
const struct smb_filename *smb_fname,
6317
uint32 access_mask);
6318
bool can_write_to_file(connection_struct *conn,
6319
const struct smb_filename *smb_fname);
6320
bool directory_has_default_acl(connection_struct *conn, const char *fname);
6322
/* The following definitions come from smbd/fileio.c */
6324
ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n);
6325
void update_write_time_handler(struct event_context *ctx,
6326
struct timed_event *te,
6328
void *private_data);
6329
void trigger_write_time_update(struct files_struct *fsp);
6330
void trigger_write_time_update_immediate(struct files_struct *fsp);
6331
ssize_t write_file(struct smb_request *req,
6336
void delete_write_cache(files_struct *fsp);
6337
void set_filelen_write_cache(files_struct *fsp, SMB_OFF_T file_size);
6338
ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason);
6339
NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_through);
6340
int fsp_stat(files_struct *fsp);
6342
/* The following definitions come from smbd/filename.c */
6344
NTSTATUS unix_convert(TALLOC_CTX *ctx,
6345
connection_struct *conn,
6346
const char *orig_path,
6347
struct smb_filename **smb_fname,
6348
uint32_t ucf_flags);
6349
NTSTATUS check_name(connection_struct *conn, const char *name);
6350
int get_real_filename(connection_struct *conn, const char *path,
6351
const char *name, TALLOC_CTX *mem_ctx,
6353
NTSTATUS filename_convert(TALLOC_CTX *mem_ctx,
6354
connection_struct *conn,
6356
const char *name_in,
6358
bool *ppath_contains_wcard,
6359
struct smb_filename **pp_smb_fname);
6361
/* The following definitions come from smbd/filename_utils.c */
1938
bool lookup_unix_group_name(const char *name, struct dom_sid *sid);
1940
/* The following definitions come from lib/filename_util.c */
6363
1942
NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname,
6364
1943
char **full_name);
6378
1957
bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname);
6379
1958
bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname);
6381
/* The following definitions come from smbd/files.c */
6383
NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
6384
files_struct **result);
6385
void file_close_conn(connection_struct *conn);
6386
void file_close_pid(uint16 smbpid, int vuid);
6387
void file_init(void);
6388
void file_close_user(int vuid);
6389
void file_dump_open_table(void);
6390
struct files_struct *file_walk_table(
6391
struct files_struct *(*fn)(struct files_struct *fsp,
6392
void *private_data),
6393
void *private_data);
6394
files_struct *file_find_fd(int fd);
6395
files_struct *file_find_dif(struct file_id id, unsigned long gen_id);
6396
files_struct *file_find_fsp(files_struct *orig_fsp);
6397
files_struct *file_find_di_first(struct file_id id);
6398
files_struct *file_find_di_next(files_struct *start_fsp);
6399
files_struct *file_find_print(void);
6400
bool file_find_subpath(files_struct *dir_fsp);
6401
void file_sync_all(connection_struct *conn);
6402
void file_free(struct smb_request *req, files_struct *fsp);
6403
files_struct *file_fnum(uint16 fnum);
6404
files_struct *file_fsp(struct smb_request *req, uint16 fid);
6405
NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
6406
uint32 access_mask, uint32 share_access,
6407
uint32 create_options, files_struct *to);
6408
NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
6409
const struct smb_filename *smb_fname_in);
6411
/* The following definitions come from smbd/ipc.c */
6413
void send_trans_reply(connection_struct *conn,
6414
struct smb_request *req,
6415
char *rparam, int rparam_len,
6416
char *rdata, int rdata_len,
6417
bool buffer_too_large);
6418
void reply_trans(struct smb_request *req);
6419
void reply_transs(struct smb_request *req);
6421
/* The following definitions come from smbd/lanman.c */
6423
void api_reply(connection_struct *conn, uint16 vuid,
6424
struct smb_request *req,
6425
char *data, char *params,
6426
int tdscnt, int tpscnt,
6427
int mdrcnt, int mprcnt);
6429
/* The following definitions come from smbd/mangle.c */
6431
void mangle_reset_cache(void);
6432
void mangle_change_to_posix(void);
6433
bool mangle_is_mangled(const char *s, const struct share_params *p);
6434
bool mangle_is_8_3(const char *fname, bool check_case,
6435
const struct share_params *p);
6436
bool mangle_is_8_3_wildcards(const char *fname, bool check_case,
6437
const struct share_params *p);
6438
bool mangle_must_mangle(const char *fname,
6439
const struct share_params *p);
6440
bool mangle_lookup_name_from_8_3(TALLOC_CTX *ctx,
6442
char **out, /* talloced on the given context. */
6443
const struct share_params *p);
6444
bool name_to_8_3(const char *in,
6447
const struct share_params *p);
6449
/* The following definitions come from smbd/mangle_hash.c */
6451
const struct mangle_fns *mangle_hash_init(void);
6453
/* The following definitions come from smbd/mangle_hash2.c */
6455
const struct mangle_fns *mangle_hash2_init(void);
6456
const struct mangle_fns *posix_mangle_init(void);
6458
/* The following definitions come from smbd/map_username.c */
6460
bool map_username(struct smbd_server_connection *sconn, fstring user);
6462
/* The following definitions come from smbd/message.c */
6464
void reply_sends(struct smb_request *req);
6465
void reply_sendstrt(struct smb_request *req);
6466
void reply_sendtxt(struct smb_request *req);
6467
void reply_sendend(struct smb_request *req);
6469
/* The following definitions come from smbd/msdfs.c */
6471
bool is_msdfs_link(connection_struct *conn,
6473
SMB_STRUCT_STAT *sbufp);
6474
NTSTATUS get_referred_path(TALLOC_CTX *ctx,
6475
struct auth_serversupplied_info *server_info,
6476
const char *dfs_path,
6477
struct junction_map *jucn,
6479
bool *self_referralp);
6480
int setup_dfs_referral(connection_struct *orig_conn,
6481
const char *dfs_path,
6482
int max_referral_level,
6483
char **ppdata, NTSTATUS *pstatus);
6484
bool create_junction(TALLOC_CTX *ctx,
6485
const char *dfs_path,
6486
struct junction_map *jucn);
6487
bool create_msdfs_link(const struct junction_map *jucn);
6488
bool remove_msdfs_link(const struct junction_map *jucn);
6489
struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn);
6490
NTSTATUS resolve_dfspath(TALLOC_CTX *ctx,
6491
connection_struct *conn,
6493
const char *name_in,
6494
char **pp_name_out);
6495
NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
6496
connection_struct *conn,
6498
const char *name_in,
6501
bool *ppath_contains_wcard);
6502
NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
6503
connection_struct **pconn,
6506
struct auth_serversupplied_info *server_info,
6509
/* The following definitions come from smbd/negprot.c */
6511
void reply_negprot(struct smb_request *req);
6513
/* The following definitions come from smbd/notify.c */
6515
void change_notify_reply(connection_struct *conn,
6516
struct smb_request *req,
6517
NTSTATUS error_code,
6519
struct notify_change_buf *notify_buf,
6520
void (*reply_fn)(struct smb_request *req,
6521
NTSTATUS error_code,
6522
uint8_t *buf, size_t len));
6523
NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
6525
NTSTATUS change_notify_add_request(struct smb_request *req,
6527
uint32 filter, bool recursive,
6528
struct files_struct *fsp,
6529
void (*reply_fn)(struct smb_request *req,
6530
NTSTATUS error_code,
6531
uint8_t *buf, size_t len));
6532
void remove_pending_change_notify_requests_by_mid(uint16 mid);
6533
void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
6535
void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
6537
char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32 filter);
6538
struct sys_notify_context *sys_notify_context_create(connection_struct *conn,
6539
TALLOC_CTX *mem_ctx,
6540
struct event_context *ev);
6541
NTSTATUS sys_notify_watch(struct sys_notify_context *ctx,
6542
struct notify_entry *e,
6543
void (*callback)(struct sys_notify_context *ctx,
6545
struct notify_event *ev),
6546
void *private_data, void *handle);
6548
/* The following definitions come from smbd/notify_inotify.c */
6550
NTSTATUS inotify_watch(struct sys_notify_context *ctx,
6551
struct notify_entry *e,
6552
void (*callback)(struct sys_notify_context *ctx,
6554
struct notify_event *ev),
6558
/* The following definitions come from smbd/notify_internal.c */
6560
struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
6561
struct messaging_context *messaging_ctx,
6562
struct event_context *ev,
6563
connection_struct *conn);
6564
NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0,
6565
void (*callback)(void *, const struct notify_event *),
6566
void *private_data);
6567
NTSTATUS notify_remove(struct notify_context *notify, void *private_data);
6568
NTSTATUS notify_remove_onelevel(struct notify_context *notify,
6569
const struct file_id *fid,
6570
void *private_data);
6571
void notify_onelevel(struct notify_context *notify, uint32_t action,
6572
uint32_t filter, struct file_id fid, const char *name);
6573
void notify_trigger(struct notify_context *notify,
6574
uint32_t action, uint32_t filter, const char *path);
6576
/* The following definitions come from smbd/ntquotas.c */
6578
int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt);
6579
int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt);
6580
int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list);
6581
void *init_quota_handle(TALLOC_CTX *mem_ctx);
6583
/* The following definitions come from smbd/nttrans.c */
6585
void send_nt_replies(connection_struct *conn,
6586
struct smb_request *req, NTSTATUS nt_error,
6587
char *params, int paramsize,
6588
char *pdata, int datasize);
6589
void reply_ntcreate_and_X(struct smb_request *req);
6590
struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size);
6591
void reply_ntcancel(struct smb_request *req);
6592
void reply_ntrename(struct smb_request *req);
6593
void reply_nttrans(struct smb_request *req);
6594
void reply_nttranss(struct smb_request *req);
6596
/* The following definitions come from smbd/open.c */
6598
NTSTATUS smb1_file_se_access_check(connection_struct *conn,
6599
const struct security_descriptor *sd,
6600
const NT_USER_TOKEN *token,
6601
uint32_t access_desired,
6602
uint32_t *access_granted);
6603
NTSTATUS fd_close(files_struct *fsp);
6604
void change_file_owner_to_parent(connection_struct *conn,
6605
const char *inherit_from_dir,
6607
NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
6608
const char *inherit_from_dir,
6610
SMB_STRUCT_STAT *psbuf);
6611
bool is_executable(const char *fname);
6612
bool is_stat_open(uint32 access_mask);
6613
bool request_timed_out(struct timeval request_time,
6614
struct timeval timeout);
6615
bool open_match_attributes(connection_struct *conn,
6616
uint32 old_dos_attr,
6617
uint32 new_dos_attr,
6618
mode_t existing_unx_mode,
6619
mode_t new_unx_mode,
6620
mode_t *returned_unx_mode);
6621
NTSTATUS fcb_or_dos_open(struct smb_request *req,
6622
connection_struct *conn,
6623
files_struct *fsp_to_dup_into,
6624
const struct smb_filename *smb_fname,
6629
uint32 share_access,
6630
uint32 create_options);
6631
bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
6632
int deny_mode, int open_func,
6633
uint32 *paccess_mask,
6634
uint32 *pshare_mode,
6635
uint32 *pcreate_disposition,
6636
uint32 *pcreate_options);
6637
NTSTATUS open_file_fchmod(connection_struct *conn,
6638
struct smb_filename *smb_fname,
6639
files_struct **result);
6640
NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
6641
struct smb_filename *smb_dname);
6642
void msg_file_was_renamed(struct messaging_context *msg,
6645
struct server_id server_id,
6647
NTSTATUS open_streams_for_delete(connection_struct *conn,
6649
NTSTATUS create_file_default(connection_struct *conn,
6650
struct smb_request *req,
6651
uint16_t root_dir_fid,
6652
struct smb_filename * smb_fname,
6653
uint32_t access_mask,
6654
uint32_t share_access,
6655
uint32_t create_disposition,
6656
uint32_t create_options,
6657
uint32_t file_attributes,
6658
uint32_t oplock_request,
6659
uint64_t allocation_size,
6660
struct security_descriptor *sd,
6661
struct ea_list *ea_list,
6663
files_struct **result,
6665
NTSTATUS get_relative_fid_filename(connection_struct *conn,
6666
struct smb_request *req,
6667
uint16_t root_dir_fid,
6668
const struct smb_filename *smb_fname,
6669
struct smb_filename **smb_fname_out);
6671
/* The following definitions come from smbd/oplock.c */
6673
int32 get_number_of_exclusive_open_oplocks(void);
6674
void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp);
6675
bool set_file_oplock(files_struct *fsp, int oplock_type);
6676
void release_file_oplock(files_struct *fsp);
6677
bool remove_oplock(files_struct *fsp);
6678
bool downgrade_oplock(files_struct *fsp);
6679
bool should_notify_deferred_opens(void);
6680
void break_level2_to_none_async(files_struct *fsp);
6681
void reply_to_oplock_break_requests(files_struct *fsp);
6682
void process_oplock_async_level2_break_message(struct messaging_context *msg_ctx,
6685
struct server_id src,
1960
/* The following definitions come from lib/dummyroot.c */
1962
void become_root(void);
1963
void unbecome_root(void);
1965
/* The following definitions come from lib/dummysmbd.c */
1967
int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out);
1968
bool conn_snum_used(int snum);
1969
void cancel_pending_lock_requests_by_fid(files_struct *fsp,
1970
struct byte_range_lock *br_lck,
1971
enum file_close_type close_type);
1972
void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
1974
NTSTATUS can_delete_directory(struct connection_struct *conn,
1975
const char *dirname);
1976
bool change_to_root_user(void);
1977
struct event_context *smbd_event_context(void);
6687
1978
void contend_level2_oplocks_begin(files_struct *fsp,
6688
1979
enum level2_contention_type type);
6689
1980
void contend_level2_oplocks_end(files_struct *fsp,
6690
1981
enum level2_contention_type type);
6691
void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e);
6692
void message_to_share_mode_entry(struct share_mode_entry *e, char *msg);
6693
bool init_oplocks(struct messaging_context *msg_ctx);
6695
/* The following definitions come from smbd/oplock_irix.c */
6697
struct kernel_oplocks *irix_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ;
6699
/* The following definitions come from smbd/oplock_linux.c */
6701
void linux_set_lease_capability(void);
6702
int linux_set_lease_sighandler(int fd);
6703
int linux_setlease(int fd, int leasetype);
6704
struct kernel_oplocks *linux_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ;
6706
/* The following definitions come from smbd/oplock_onefs.c */
6708
struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx);
6710
/* The following definitions come from smbd/password.c */
6712
user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
6714
bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid);
6715
user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
6717
void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid);
6718
void invalidate_all_vuids(struct smbd_server_connection *sconn);
6719
int register_initial_vuid(struct smbd_server_connection *sconn);
6720
int register_existing_vuid(struct smbd_server_connection *sconn,
6722
auth_serversupplied_info *server_info,
6723
DATA_BLOB response_blob,
6724
const char *smb_name);
6725
void add_session_user(struct smbd_server_connection *sconn, const char *user);
6726
void add_session_workgroup(struct smbd_server_connection *sconn,
6727
const char *workgroup);
6728
const char *get_session_workgroup(struct smbd_server_connection *sconn);
6729
bool user_in_netgroup(struct smbd_server_connection *sconn,
6730
const char *user, const char *ngname);
6731
bool user_in_list(struct smbd_server_connection *sconn,
6732
const char *user,const char **list);
6733
bool authorise_login(struct smbd_server_connection *sconn,
6734
int snum, fstring user, DATA_BLOB password,
6737
/* The following definitions come from smbd/pipes.c */
6739
NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
6740
struct files_struct **pfsp);
6741
void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req);
6742
void reply_pipe_write(struct smb_request *req);
6743
void reply_pipe_write_and_X(struct smb_request *req);
6744
void reply_pipe_read_and_X(struct smb_request *req);
6745
void reply_pipe_close(connection_struct *conn, struct smb_request *req);
6747
/* The following definitions come from smbd/posix_acls.c */
6749
void create_file_sids(const SMB_STRUCT_STAT *psbuf, DOM_SID *powner_sid, DOM_SID *pgroup_sid);
6750
bool nt4_compatible_acls(void);
6751
uint32_t map_canon_ace_perms(int snum,
6752
enum security_ace_type *pacl_type,
6754
bool directory_ace);
6755
NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd);
6756
bool current_user_in_group(gid_t gid);
6757
SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl);
6758
NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
6760
NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
6761
uint32_t security_info, SEC_DESC **ppdesc);
6762
int try_chown(connection_struct *conn, struct smb_filename *smb_fname,
6763
uid_t uid, gid_t gid);
6764
NTSTATUS append_parent_acl(files_struct *fsp,
6765
const SEC_DESC *pcsd,
6766
SEC_DESC **pp_new_sd);
6767
NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const SEC_DESC *psd);
6768
int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode );
6769
int chmod_acl(connection_struct *conn, const char *name, mode_t mode);
6770
int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_dir,
6771
const char *name, mode_t mode);
6772
int fchmod_acl(files_struct *fsp, mode_t mode);
6773
bool set_unix_posix_default_acl(connection_struct *conn, const char *fname,
6774
const SMB_STRUCT_STAT *psbuf,
6775
uint16 num_def_acls, const char *pdata);
6776
bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata);
6777
SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname);
6778
NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx,
6780
SMB_STRUCT_STAT *psbuf,
6783
/* The following definitions come from smbd/process.c */
6785
void smbd_setup_sig_term_handler(void);
6786
void smbd_setup_sig_hup_handler(void);
6787
bool srv_send_smb(int fd, char *buffer,
6788
bool no_signing, uint32_t seqnum,
6790
struct smb_perfcount_data *pcd);
6791
int srv_set_message(char *buf,
6795
void init_smb_request(struct smb_request *req,
6797
size_t unread_bytes,
6799
void remove_deferred_open_smb_message(uint16 mid);
6800
void schedule_deferred_open_smb_message(uint16 mid);
6801
bool open_was_deferred(uint16 mid);
6802
struct pending_message_list *get_open_deferred_message(uint16 mid);
6803
bool push_deferred_smb_message(struct smb_request *req,
6804
struct timeval request_time,
6805
struct timeval timeout,
6806
char *private_data, size_t priv_len);
6807
struct idle_event *event_add_idle(struct event_context *event_ctx,
6808
TALLOC_CTX *mem_ctx,
6809
struct timeval interval,
6811
bool (*handler)(const struct timeval *now,
6812
void *private_data),
6813
void *private_data);
6814
NTSTATUS allow_new_trans(struct trans_state *list, int mid);
6815
void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes);
6816
const char *smb_fn_name(int type);
6817
void add_to_common_flags2(uint32 v);
6818
void remove_from_common_flags2(uint32 v);
6819
void construct_reply_common_req(struct smb_request *req, char *outbuf);
6820
size_t req_wct_ofs(struct smb_request *req);
6821
void chain_reply(struct smb_request *req);
6822
bool req_is_in_chain(struct smb_request *req);
6823
void check_reload(time_t t);
6824
void smbd_process(void);
6826
/* The following definitions come from smbd/quotas.c */
6828
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
6829
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
6830
bool disk_quotas(const char *path,
6834
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
6835
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
6836
bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
6837
bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
6838
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
6839
bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
6841
/* The following definitions come from smbd/reply.c */
6843
NTSTATUS check_path_syntax(char *path);
6844
NTSTATUS check_path_syntax_wcard(char *path, bool *p_contains_wcard);
6845
NTSTATUS check_path_syntax_posix(char *path);
6846
size_t srvstr_get_path_wcard(TALLOC_CTX *ctx,
6854
bool *contains_wcard);
6855
size_t srvstr_get_path(TALLOC_CTX *ctx,
6863
size_t srvstr_get_path_req_wcard(TALLOC_CTX *mem_ctx, struct smb_request *req,
6864
char **pp_dest, const char *src, int flags,
6865
NTSTATUS *err, bool *contains_wcard);
6866
size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req,
6867
char **pp_dest, const char *src, int flags,
6869
bool check_fsp_open(connection_struct *conn, struct smb_request *req,
6871
bool check_fsp(connection_struct *conn, struct smb_request *req,
6873
bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req,
6875
bool fsp_belongs_conn(connection_struct *conn, struct smb_request *req,
6877
void reply_special(char *inbuf, size_t inbuf_len);
6878
void reply_tcon(struct smb_request *req);
6879
void reply_tcon_and_X(struct smb_request *req);
6880
void reply_unknown_new(struct smb_request *req, uint8 type);
6881
void reply_ioctl(struct smb_request *req);
6882
void reply_checkpath(struct smb_request *req);
6883
void reply_getatr(struct smb_request *req);
6884
void reply_setatr(struct smb_request *req);
6885
void reply_dskattr(struct smb_request *req);
6886
void reply_search(struct smb_request *req);
6887
void reply_fclose(struct smb_request *req);
6888
void reply_open(struct smb_request *req);
6889
void reply_open_and_X(struct smb_request *req);
6890
void reply_ulogoffX(struct smb_request *req);
6891
void reply_mknew(struct smb_request *req);
6892
void reply_ctemp(struct smb_request *req);
6893
NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
6894
uint32 dirtype, struct smb_filename *smb_fname,
6896
void reply_unlink(struct smb_request *req);
6897
void reply_readbraw(struct smb_request *req);
6898
void reply_lockread(struct smb_request *req);
6899
void reply_read(struct smb_request *req);
6900
void reply_read_and_X(struct smb_request *req);
6901
void error_to_writebrawerr(struct smb_request *req);
6902
void reply_writebraw(struct smb_request *req);
6903
void reply_writeunlock(struct smb_request *req);
6904
void reply_write(struct smb_request *req);
6905
bool is_valid_writeX_buffer(const uint8_t *inbuf);
6906
void reply_write_and_X(struct smb_request *req);
6907
void reply_lseek(struct smb_request *req);
6908
void reply_flush(struct smb_request *req);
6909
void reply_exit(struct smb_request *req);
6910
void reply_close(struct smb_request *req);
6911
void reply_writeclose(struct smb_request *req);
6912
void reply_lock(struct smb_request *req);
6913
void reply_unlock(struct smb_request *req);
6914
void reply_tdis(struct smb_request *req);
6915
void reply_echo(struct smb_request *req);
6916
void reply_printopen(struct smb_request *req);
6917
void reply_printclose(struct smb_request *req);
6918
void reply_printqueue(struct smb_request *req);
6919
void reply_printwrite(struct smb_request *req);
6920
void reply_mkdir(struct smb_request *req);
6921
void reply_rmdir(struct smb_request *req);
6922
NTSTATUS rename_internals_fsp(connection_struct *conn,
6924
const struct smb_filename *smb_fname_dst_in,
6926
bool replace_if_exists);
6927
NTSTATUS rename_internals(TALLOC_CTX *ctx,
6928
connection_struct *conn,
6929
struct smb_request *req,
6930
struct smb_filename *smb_fname_src,
6931
struct smb_filename *smb_fname_dst,
6933
bool replace_if_exists,
6936
uint32_t access_mask);
6937
void reply_mv(struct smb_request *req);
6938
NTSTATUS copy_file(TALLOC_CTX *ctx,
6939
connection_struct *conn,
6940
struct smb_filename *smb_fname_src,
6941
struct smb_filename *smb_fname_dst,
6944
bool target_is_directory);
6945
void reply_copy(struct smb_request *req);
6946
uint32 get_lock_pid(const uint8_t *data, int data_offset,
6947
bool large_file_format);
6948
uint64_t get_lock_count(const uint8_t *data, int data_offset,
6949
bool large_file_format);
6950
uint64_t get_lock_offset(const uint8_t *data, int data_offset,
6951
bool large_file_format, bool *err);
6952
void reply_lockingX(struct smb_request *req);
6953
void reply_readbmpx(struct smb_request *req);
6954
void reply_readbs(struct smb_request *req);
6955
void reply_setattrE(struct smb_request *req);
6956
void reply_writebmpx(struct smb_request *req);
6957
void reply_writebs(struct smb_request *req);
6958
void reply_getattrE(struct smb_request *req);
6960
/* The following definitions come from smbd/seal.c */
6962
uint16_t srv_enc_ctx(void);
6963
bool is_encrypted_packet(const uint8_t *inbuf);
6964
void srv_free_enc_buffer(char *buf);
6965
NTSTATUS srv_decrypt_buffer(char *buf);
6966
NTSTATUS srv_encrypt_buffer(char *buf, char **buf_out);
6967
NTSTATUS srv_request_encryption_setup(connection_struct *conn,
6968
unsigned char **ppdata,
6969
size_t *p_data_size,
6970
unsigned char **pparam,
6971
size_t *p_param_size);
6972
NTSTATUS srv_encryption_start(connection_struct *conn);
6973
void server_encryption_shutdown(void);
6975
/* The following definitions come from smbd/sec_ctx.c */
6977
bool unix_token_equal(const UNIX_USER_TOKEN *t1, const UNIX_USER_TOKEN *t2);
6978
bool push_sec_ctx(void);
6979
void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN *token);
6980
void set_root_sec_ctx(void);
6981
bool pop_sec_ctx(void);
6982
void init_sec_ctx(void);
6984
/* The following definitions come from smbd/server.c */
6986
int smbd_server_fd(void);
6987
int get_client_fd(void);
6988
struct event_context *smbd_event_context(void);
6989
struct messaging_context *smbd_messaging_context(void);
6990
struct memcache *smbd_memcache(void);
6991
void reload_printers(void);
6992
bool reload_services(bool test);
6993
void exit_server(const char *const explanation);
6994
void exit_server_cleanly(const char *const explanation);
6995
void exit_server_fault(void);
6997
/* The following definitions come from smbd/service.c */
6999
bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
7000
bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);
7001
void load_registry_shares(void);
7002
int add_home_service(const char *service, const char *username, const char *homedir);
7003
int find_service(fstring service);
7004
connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
7005
int snum, user_struct *vuser,
7009
connection_struct *make_connection(struct smbd_server_connection *sconn,
7010
const char *service_in, DATA_BLOB password,
7011
const char *pdev, uint16 vuid,
7013
void close_cnum(connection_struct *conn, uint16 vuid);
7015
/* The following definitions come from smbd/session.c */
7017
bool session_init(void);
7018
bool session_claim(user_struct *vuser);
7019
void session_yield(user_struct *vuser);
7020
int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
7022
/* The following definitions come from smbd/sesssetup.c */
7024
NTSTATUS parse_spnego_mechanisms(DATA_BLOB blob_in,
7025
DATA_BLOB *pblob_out,
7026
char **kerb_mechOID);
7027
void reply_sesssetup_and_X(struct smb_request *req);
7029
/* The following definitions come from smbd/share_access.c */
7031
bool token_contains_name_in_list(const char *username,
7033
const char *sharename,
7034
const struct nt_user_token *token,
7036
bool user_ok_token(const char *username, const char *domain,
7037
const struct nt_user_token *token, int snum);
7038
bool is_share_read_only_for_token(const char *username,
7040
const struct nt_user_token *token,
7041
connection_struct *conn);
7043
/* The following definitions come from smbd/srvstr.c */
7045
size_t srvstr_push_fn(const char *function, unsigned int line,
7046
const char *base_ptr, uint16 smb_flags2, void *dest,
7047
const char *src, int dest_len, int flags);
7048
ssize_t message_push_string(uint8 **outbuf, const char *str, int flags);
7050
/* The following definitions come from smbd/statcache.c */
7052
void stat_cache_add( const char *full_orig_name,
7053
char *translated_path,
7054
bool case_sensitive);
7055
bool stat_cache_lookup(connection_struct *conn,
7059
SMB_STRUCT_STAT *pst);
7060
void send_stat_cache_delete_message(const char *name);
7061
void stat_cache_delete(const char *name);
7062
unsigned int fast_string_hash(TDB_DATA *key);
7063
bool reset_stat_cache( void );
7065
/* The following definitions come from smbd/statvfs.c */
7067
int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
7069
/* The following definitions come from smbd/trans2.c */
7071
uint64_t smb_roundup(connection_struct *conn, uint64_t val);
7072
uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
7073
NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
7074
files_struct *fsp, const char *fname,
7075
const char *ea_name, struct ea_struct *pea);
7076
NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
7077
files_struct *fsp, const char *fname,
7078
char ***pnames, size_t *pnum_names);
7079
NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
7080
const struct smb_filename *smb_fname, struct ea_list *ea_list);
7081
struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t data_size, size_t *pbytes_used);
7082
void send_trans2_replies(connection_struct *conn,
7083
struct smb_request *req,
7088
int max_data_bytes);
7089
unsigned char *create_volume_objectid(connection_struct *conn, unsigned char objid[16]);
7090
NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
7091
connection_struct *conn,
7092
const struct smb_filename *smb_fname_old,
7093
const struct smb_filename *smb_fname_new);
7094
NTSTATUS smb_set_file_time(connection_struct *conn,
7096
const struct smb_filename *smb_fname,
7097
struct smb_file_time *ft,
7098
bool setting_write_time);
7099
void reply_findclose(struct smb_request *req);
7100
void reply_findnclose(struct smb_request *req);
7101
void reply_trans2(struct smb_request *req);
7102
void reply_transs2(struct smb_request *req);
7104
/* The following definitions come from smbd/uid.c */
7106
bool change_to_guest(void);
7107
void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid);
7108
bool change_to_user(connection_struct *conn, uint16 vuid);
7109
bool change_to_root_user(void);
7110
bool become_authenticated_pipe_user(pipes_struct *p);
7111
bool unbecome_authenticated_pipe_user(void);
7112
void become_root(void);
7113
void unbecome_root(void);
7114
bool become_user(connection_struct *conn, uint16 vuid);
7115
bool unbecome_user(void);
7117
/* The following definitions come from smbd/utmp.c */
7119
void sys_utmp_claim(const char *username, const char *hostname,
7120
const char *ip_addr_str,
7121
const char *id_str, int id_num);
7122
void sys_utmp_yield(const char *username, const char *hostname,
7123
const char *ip_addr_str,
7124
const char *id_str, int id_num);
7125
void sys_utmp_yield(const char *username, const char *hostname,
7126
const char *ip_addr_str,
7127
const char *id_str, int id_num);
7128
void sys_utmp_claim(const char *username, const char *hostname,
7129
const char *ip_addr_str,
7130
const char *id_str, int id_num);
7132
/* The following definitions come from smbd/vfs.c */
7134
NTSTATUS smb_register_vfs(int version, const char *name,
7135
const struct vfs_fn_pointers *fns);
7136
bool vfs_init_custom(connection_struct *conn, const char *vfs_object);
7137
void *vfs_add_fsp_extension_notype(vfs_handle_struct *handle,
7138
files_struct *fsp, size_t ext_size,
7139
void (*destroy_fn)(void *p_data));
7140
void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
7141
void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
7142
void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
7143
bool smbd_vfs_init(connection_struct *conn);
7144
NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname);
7145
ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count);
7146
ssize_t vfs_pread_data(files_struct *fsp, char *buf,
7147
size_t byte_count, SMB_OFF_T offset);
7148
ssize_t vfs_write_data(struct smb_request *req,
7152
ssize_t vfs_pwrite_data(struct smb_request *req,
7157
int vfs_allocate_file_space(files_struct *fsp, uint64_t len);
7158
int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len);
7159
int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len);
7160
SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_T n);
7161
const char *vfs_readdirname(connection_struct *conn, void *p,
7162
SMB_STRUCT_STAT *sbuf, char **talloced);
7163
int vfs_ChDir(connection_struct *conn, const char *path);
7164
char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn);
7165
NTSTATUS check_reduced_name(connection_struct *conn, const char *fname);
7166
int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname,
7167
SMB_STRUCT_STAT *psbuf);
7168
int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname,
7169
SMB_STRUCT_STAT *psbuf);
7170
NTSTATUS vfs_stat_fsp(files_struct *fsp);
7172
/* The following definitions come from torture/denytest.c */
7174
bool torture_denytest1(int dummy);
7175
bool torture_denytest2(int dummy);
7177
/* The following definitions come from torture/mangle_test.c */
7179
bool torture_mangle(int dummy);
7181
/* The following definitions come from torture/nbio.c */
7183
double nbio_total(void);
7184
void nb_alarm(int ignore);
7185
void nbio_shmem(int n);
7186
void nb_setup(struct cli_state *cli);
7187
void nb_unlink(const char *fname);
7188
void nb_createx(const char *fname,
7189
unsigned create_options, unsigned create_disposition, int handle);
7190
void nb_writex(int handle, int offset, int size, int ret_size);
7191
void nb_readx(int handle, int offset, int size, int ret_size);
7192
void nb_close(int handle);
7193
void nb_rmdir(const char *fname);
7194
void nb_rename(const char *oldname, const char *newname);
7195
void nb_qpathinfo(const char *fname);
7196
void nb_qfileinfo(int fnum);
7197
void nb_qfsinfo(int level);
7198
void nb_findfirst(const char *mask);
7199
void nb_flush(int fnum);
7200
void nb_deltree(const char *dname);
7201
void nb_cleanup(void);
7203
/* The following definitions come from torture/scanner.c */
7205
bool torture_trans2_scan(int dummy);
7206
bool torture_nttrans_scan(int dummy);
7208
/* The following definitions come from torture/torture.c */
7210
void start_timer(void);
7211
double end_timer(void);
7212
void *shm_setup(int size);
7213
bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
7214
char **hostname, char **sharename);
7215
void torture_open_connection_free_unclist(char **unc_list);
7216
bool torture_open_connection(struct cli_state **c, int conn_index);
7217
bool torture_cli_session_setup2(struct cli_state *cli, uint16 *new_vuid);
7218
bool torture_close_connection(struct cli_state *c);
7219
bool torture_ioctl_test(int dummy);
7220
bool torture_chkpath_test(int dummy);
7222
/* The following definitions come from torture/utable.c */
7224
bool torture_utable(int dummy);
7225
bool torture_casetable(int dummy);
7227
/* The following definitions come from utils/passwd_util.c */
7229
char *stdin_new_passwd( void);
7230
char *get_pass( const char *prompt, bool stdin_get);
7232
/* The following definitions come from winbindd/idmap.c */
7234
bool idmap_is_offline(void);
7235
bool idmap_is_online(void);
7236
NTSTATUS smb_register_idmap(int version, const char *name,
7237
struct idmap_methods *methods);
7238
NTSTATUS smb_register_idmap_alloc(int version, const char *name,
7239
struct idmap_alloc_methods *methods);
7240
void idmap_close(void);
7241
NTSTATUS idmap_init_cache(void);
7242
NTSTATUS idmap_allocate_uid(struct unixid *id);
7243
NTSTATUS idmap_allocate_gid(struct unixid *id);
7244
NTSTATUS idmap_set_uid_hwm(struct unixid *id);
7245
NTSTATUS idmap_set_gid_hwm(struct unixid *id);
7246
NTSTATUS idmap_backends_unixid_to_sid(const char *domname,
7248
NTSTATUS idmap_backends_sid_to_unixid(const char *domname,
7250
NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
7251
struct unixid *pxid);
7252
NTSTATUS idmap_set_mapping(const struct id_map *map);
7253
NTSTATUS idmap_remove_mapping(const struct id_map *map);
7255
/* The following definitions come from winbindd/idmap_cache.c */
7257
bool idmap_cache_find_sid2uid(const struct dom_sid *sid, uid_t *puid,
7259
bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired);
7260
void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid);
7261
bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid,
7263
bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired);
7264
void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid);
7267
/* The following definitions come from winbindd/idmap_nss.c */
7269
NTSTATUS idmap_nss_init(void);
7271
/* The following definitions come from winbindd/idmap_passdb.c */
7273
NTSTATUS idmap_passdb_init(void);
7275
/* The following definitions come from winbindd/idmap_tdb.c */
7277
bool idmap_tdb_tdb_close(TDB_CONTEXT *tdbctx);
7278
NTSTATUS idmap_alloc_tdb_init(void);
7279
NTSTATUS idmap_tdb_init(void);
7281
/* The following definitions come from winbindd/idmap_util.c */
7283
NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid);
7284
NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid);
7285
NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid);
7286
NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid);
7288
/* The following definitions come from winbindd/nss_info.c */
7291
/* The following definitions come from winbindd/nss_info_template.c */
7293
NTSTATUS nss_info_template_init( void );
7295
/* The following definitions come from lib/avahi.c */
7297
struct AvahiPoll *tevent_avahi_poll(TALLOC_CTX *mem_ctx,
7298
struct tevent_context *ev);
7300
/* The following definitions come from smbd/avahi_register.c */
7302
void *avahi_start_register(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
7307
struct fncall_context *fncall_context_init(TALLOC_CTX *mem_ctx,
7309
struct tevent_req *fncall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
7310
struct fncall_context *ctx,
7311
void (*fn)(void *private_data),
7312
void *private_data);
7313
int fncall_recv(struct tevent_req *req, int *perr);
7315
struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
7316
struct tevent_context *ev,
7317
const struct sockaddr_storage *addr,
7318
const char *called_name,
7319
const char *calling_name);
7320
NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
7322
NTSTATUS smbsock_connect(const struct sockaddr_storage *addr,
7323
const char *called_name, const char *calling_name,
7324
int *pfd, uint16_t *port);
7326
struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
7327
struct tevent_context *ev,
7328
const struct sockaddr_storage *addrs,
7329
const char **called_names,
7331
NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
7332
size_t *chosen_index, uint16_t *port);
7333
NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
7334
const char **called_names, size_t num_addrs,
7335
int *pfd, size_t *chosen_index, uint16_t *port);
7337
/* The following definitions come from rpc_server/srv_samr_nt.c */
7338
NTSTATUS access_check_object( SEC_DESC *psd, NT_USER_TOKEN *token,
7339
SE_PRIV *rights, uint32 rights_mask,
7340
uint32 des_access, uint32 *acc_granted,
7342
void map_max_allowed_access(const NT_USER_TOKEN *nt_token,
7343
const struct unix_user_token *unix_token,
7344
uint32_t *pacc_requested);
7346
/* The following definitions come from ../libds/common/flag_mapping.c */
7348
uint32_t ds_acb2uf(uint32_t acb);
7349
uint32_t ds_uf2acb(uint32_t uf);
7350
uint32_t ds_uf2atype(uint32_t uf);
7351
uint32_t ds_gtype2atype(uint32_t gtype);
7352
enum lsa_SidType ds_atype_map(uint32_t atype);
7354
1983
#endif /* _PROTO_H_ */