diff options
-rw-r--r-- | source4/libcli/raw/clisocket.c | 71 | ||||
-rw-r--r-- | source4/libcli/raw/libcliraw.h | 5 |
2 files changed, 0 insertions, 76 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index d0867b2023..6a305fe223 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 1009f4353a..b3d32273b2 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__ */ |