summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_wins.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-06-05 11:30:43 +0200
committerVolker Lendecke <vl@samba.org>2011-06-05 12:10:15 +0200
commit5a6368f1e2a4348fdcdc062b2546eb45bf943aed (patch)
tree46c5ec9e08e8bc246eb92537879fb7be240fbbcb /source3/winbindd/winbindd_wins.c
parent2ce68d93f3eb38e6122dddc8bcd30795c48d07b7 (diff)
downloadsamba-5a6368f1e2a4348fdcdc062b2546eb45bf943aed.tar.gz
samba-5a6368f1e2a4348fdcdc062b2546eb45bf943aed.tar.bz2
samba-5a6368f1e2a4348fdcdc062b2546eb45bf943aed.zip
s3:winbind: Convert WINBINDD_WINS_BYIP to the async API
Diffstat (limited to 'source3/winbindd/winbindd_wins.c')
-rw-r--r--source3/winbindd/winbindd_wins.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/source3/winbindd/winbindd_wins.c b/source3/winbindd/winbindd_wins.c
index 5ac6109411..a468b0f8b3 100644
--- a/source3/winbindd/winbindd_wins.c
+++ b/source3/winbindd/winbindd_wins.c
@@ -27,26 +27,6 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
-static struct node_status *lookup_byaddr_backend(TALLOC_CTX *mem_ctx,
- const char *addr, int *count)
-{
- struct sockaddr_storage ss;
- struct nmb_name nname;
- struct node_status *result;
- NTSTATUS status;
-
- make_nmb_name(&nname, "*", 0);
- if (!interpret_string_addr(&ss, addr, AI_NUMERICHOST)) {
- return NULL;
- }
- status = node_status_query(mem_ctx, &nname, &ss,
- &result, count, NULL);
- if (!NT_STATUS_IS_OK(status)) {
- return NULL;
- }
- return result;
-}
-
static struct sockaddr_storage *lookup_byname_backend(TALLOC_CTX *mem_ctx,
const char *name,
int *count)
@@ -95,57 +75,6 @@ static struct sockaddr_storage *lookup_byname_backend(TALLOC_CTX *mem_ctx,
return return_ss;
}
-/* Get hostname from IP */
-
-void winbindd_wins_byip(struct winbindd_cli_state *state)
-{
- fstring response;
- int i, count, maxlen, size;
- struct node_status *status;
-
- /* Ensure null termination */
- state->request->data.winsreq[sizeof(state->request->data.winsreq)-1]='\0';
-
- DEBUG(3, ("[%5lu]: wins_byip %s\n", (unsigned long)state->pid,
- state->request->data.winsreq));
-
- *response = '\0';
- maxlen = sizeof(response) - 1;
-
- if ((status = lookup_byaddr_backend(
- state->mem_ctx, state->request->data.winsreq, &count))) {
- size = strlen(state->request->data.winsreq);
- if (size > maxlen) {
- TALLOC_FREE(status);
- request_error(state);
- return;
- }
- fstrcat(response,state->request->data.winsreq);
- fstrcat(response,"\t");
- for (i = 0; i < count; i++) {
- /* ignore group names */
- if (status[i].flags & 0x80) continue;
- if (status[i].type == 0x20) {
- size = sizeof(status[i].name) + strlen(response);
- if (size > maxlen) {
- TALLOC_FREE(status);
- request_error(state);
- return;
- }
- fstrcat(response, status[i].name);
- fstrcat(response, " ");
- }
- }
- /* make last character a newline */
- response[strlen(response)-1] = '\n';
- TALLOC_FREE(status);
- }
- strlcpy(state->response->data.winsresp,
- response,
- sizeof(state->response->data.winsresp));
- request_ok(state);
-}
-
/* Get IP from hostname */
void winbindd_wins_byname(struct winbindd_cli_state *state)