mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
s4:libcli/raw: remove unused functions
metze
This commit is contained in:
parent
b21f344079
commit
52dd549eb6
@ -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;
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user