From 987e81b0ee681a25a8e3308169626a2206e3fd26 Mon Sep 17 00:00:00 2001 From: Luk Claes Date: Sat, 19 May 2012 17:15:23 +0200 Subject: s3:libsmb: get rid of cli_state_*_sockaddr Signed-off-by: Luk Claes Signed-off-by: Stefan Metzmacher --- source3/libnet/libnet_join.c | 3 ++- source3/libsmb/clientgen.c | 10 ---------- source3/libsmb/proto.h | 2 -- source3/libsmb/smb2cli_tcon.c | 2 +- source3/utils/net_rpc.c | 3 ++- source3/utils/net_rpc_join.c | 3 ++- source3/utils/net_rpc_printer.c | 5 +++-- source3/winbindd/winbindd_cm.c | 5 +++-- 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 1736ba65fa..2b832d8024 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -38,6 +38,7 @@ #include "../libcli/security/security.h" #include "passdb.h" #include "libsmb/libsmb.h" +#include "../libcli/smb/smbXcli_base.h" /**************************************************************** ****************************************************************/ @@ -1977,7 +1978,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx, create_local_private_krb5_conf_for_domain( r->out.dns_domain_name, r->out.netbios_domain_name, - NULL, cli_state_remote_sockaddr(cli), + NULL, smbXcli_conn_remote_sockaddr(cli->conn), cli_state_remote_name(cli)); if (r->out.domain_is_ad && r->in.account_ou && diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 3c15915375..53c2d36de2 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -360,16 +360,6 @@ void cli_shutdown(struct cli_state *cli) _cli_shutdown(cli); } -const struct sockaddr_storage *cli_state_local_sockaddr(struct cli_state *cli) -{ - return smbXcli_conn_local_sockaddr(cli->conn); -} - -const struct sockaddr_storage *cli_state_remote_sockaddr(struct cli_state *cli) -{ - return smbXcli_conn_remote_sockaddr(cli->conn); -} - const char *cli_state_remote_name(struct cli_state *cli) { return smbXcli_conn_remote_name(cli->conn); diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 42c368be30..2ece3378a1 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -171,8 +171,6 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, bool cli_state_encryption_on(struct cli_state *cli); void cli_nt_pipes_close(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); -const struct sockaddr_storage *cli_state_local_sockaddr(struct cli_state *cli); -const struct sockaddr_storage *cli_state_remote_sockaddr(struct cli_state *cli); const char *cli_state_remote_name(struct cli_state *cli); const char *cli_state_remote_realm(struct cli_state *cli); uint16_t cli_state_get_vc_num(struct cli_state *cli); diff --git a/source3/libsmb/smb2cli_tcon.c b/source3/libsmb/smb2cli_tcon.c index 8aa2a31296..c3f8fcc441 100644 --- a/source3/libsmb/smb2cli_tcon.c +++ b/source3/libsmb/smb2cli_tcon.c @@ -52,7 +52,7 @@ struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx, } state->cli = cli; - print_sockaddr(srv_ip, sizeof(srv_ip), cli_state_remote_sockaddr(cli)); + print_sockaddr(srv_ip, sizeof(srv_ip), smbXcli_conn_remote_sockaddr(cli->conn)); tcon_share = talloc_asprintf(state, "\\\\%s\\%s", srv_ip, share); diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index ad3f448c5e..3196b4f871 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -43,6 +43,7 @@ #include "libsmb/clirap.h" #include "nsswitch/libwbclient/wbclient.h" #include "passdb.h" +#include "libcli/smb/smbXcli_base.h" static int net_mode_share; static NTSTATUS sync_files(struct copy_clistate *cp_clistate, const char *mask); @@ -3981,7 +3982,7 @@ static NTSTATUS rpc_share_migrate_files_internals(struct net_context *c, /* open share source */ nt_status = connect_to_service(c, &cp_clistate.cli_share_src, - cli_state_remote_sockaddr(cli), + smbXcli_conn_remote_sockaddr(cli->conn), cli_state_remote_name(cli), info502.name, "A:"); if (!NT_STATUS_IS_OK(nt_status)) diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index 73ea3e0398..06a01c0608 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -31,6 +31,7 @@ #include "secrets.h" #include "rpc_client/init_lsa.h" #include "libsmb/libsmb.h" +#include "../libcli/smb/smbXcli_base.h" /* Macro for checking RPC error codes to make things more readable */ @@ -513,7 +514,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv) /* double-check, connection from scratch */ status = net_rpc_join_ok(c, domain, cli_state_remote_name(cli), - cli_state_remote_sockaddr(cli)); + smbXcli_conn_remote_sockaddr(cli->conn)); retval = NT_STATUS_IS_OK(status) ? 0 : -1; done: diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 5c2c797b90..7348595c98 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -28,6 +28,7 @@ #include "../libcli/security/security.h" #include "../libcli/registry/util_reg.h" #include "libsmb/libsmb.h" +#include "../libcli/smb/smbXcli_base.h" /* support itanium as well */ static const struct print_architecture_table_node archi_table[]= { @@ -1914,7 +1915,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, /* open print$-share on the src server */ nt_status = connect_to_service(c, &cli_share_src, - cli_state_remote_sockaddr(cli), + smbXcli_conn_remote_sockaddr(cli->conn), cli_state_remote_name(cli), "print$", "A:"); if (!NT_STATUS_IS_OK(nt_status)) @@ -1925,7 +1926,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, /* open print$-share on the dst server */ nt_status = connect_to_service(c, &cli_share_dst, - cli_state_remote_sockaddr(cli_dst), + smbXcli_conn_remote_sockaddr(cli_dst->conn), cli_state_remote_name(cli_dst), "print$", "A:"); if (!NT_STATUS_IS_OK(nt_status)) diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index f36cceaccc..08d843a994 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -77,6 +77,7 @@ #include "passdb.h" #include "messages.h" #include "auth/gensec/gensec.h" +#include "../libcli/smb/smbXcli_base.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND @@ -1424,7 +1425,7 @@ static void store_current_dc_in_gencache(const char *domain_name, } print_sockaddr(addr, sizeof(addr), - cli_state_remote_sockaddr(cli)); + smbXcli_conn_remote_sockaddr(cli->conn)); key = current_dc_key(talloc_tos(), domain_name); if (key == NULL) { @@ -2721,7 +2722,7 @@ void winbind_msg_ip_dropped(struct messaging_context *msg_ctx, } print_sockaddr(sockaddr, sizeof(sockaddr), - cli_state_local_sockaddr(domain->conn.cli)); + smbXcli_conn_local_sockaddr(domain->conn.cli->conn)); if (strequal(sockaddr, addr)) { cli_state_disconnect(domain->conn.cli); -- cgit