From: Stefan Metzmacher Date: Wed, 30 Nov 2011 07:35:33 +0000 (+0100) Subject: s4:libcli/raw: remove unused functions X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=52dd549eb64ea9b79bd4cbeba0fa4183aad7bb4c;p=kai%2Fsamba.git s4:libcli/raw: remove unused functions metze --- diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index d0867b20235..6a305fe223b 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -428,74 +428,3 @@ _PUBLIC_ void smbcli_sock_dead(struct smbcli_socket *sock) sock->sock = NULL; } -/**************************************************************************** - Set socket options on a open connection. -****************************************************************************/ -void smbcli_sock_set_options(struct smbcli_socket *sock, const char *options) -{ - socket_set_option(sock->sock, options, NULL); -} - -/**************************************************************************** -resolve a hostname and connect -****************************************************************************/ -_PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports, - TALLOC_CTX *mem_ctx, - struct resolve_context *resolve_ctx, - struct tevent_context *event_ctx, - const char *socket_options) -{ - int name_type = NBT_NAME_SERVER; - const char *address; - NTSTATUS status; - struct nbt_name nbt_name; - char *name, *p; - TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); - struct smbcli_socket *result; - - if (event_ctx == NULL) { - DEBUG(0, ("Invalid NULL event context passed in as parameter\n")); - return NULL; - } - - if (tmp_ctx == NULL) { - DEBUG(0, ("talloc_new failed\n")); - return NULL; - } - - name = talloc_strdup(tmp_ctx, host); - if (name == NULL) { - DEBUG(0, ("talloc_strdup failed\n")); - talloc_free(tmp_ctx); - return NULL; - } - - /* allow hostnames of the form NAME#xx and do a netbios lookup */ - if ((p = strchr(name, '#'))) { - name_type = strtol(p+1, NULL, 16); - *p = 0; - } - - make_nbt_name(&nbt_name, host, name_type); - - status = resolve_name_ex(resolve_ctx, 0, 0, &nbt_name, tmp_ctx, &address, event_ctx); - if (!NT_STATUS_IS_OK(status)) { - talloc_free(tmp_ctx); - return NULL; - } - - status = smbcli_sock_connect(mem_ctx, address, ports, name, resolve_ctx, - event_ctx, - socket_options, &result); - - if (!NT_STATUS_IS_OK(status)) { - DEBUG(9, ("smbcli_sock_connect failed: %s\n", - nt_errstr(status))); - talloc_free(tmp_ctx); - return NULL; - } - - talloc_free(tmp_ctx); - - return result; -} diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h index 1009f4353a4..b3d32273b22 100644 --- a/source4/libcli/raw/libcliraw.h +++ b/source4/libcli/raw/libcliraw.h @@ -379,11 +379,6 @@ NTSTATUS smb_raw_trans(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, struct smb_trans2 *parms); -struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports, - TALLOC_CTX *mem_ctx, - struct resolve_context *resolve_ctx, - struct tevent_context *event_ctx, - const char *socket_options); void smbcli_sock_dead(struct smbcli_socket *sock); #endif /* __LIBCLI_RAW__H__ */