diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-21 11:18:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:03 -0500 |
commit | 2383787f199c51cdc202a3cef5822a9fe6b8774c (patch) | |
tree | 52419b4e736f5ae1727561a3c9831e899edb35c5 /source4/libcli/nbt/namequery.c | |
parent | f1aaef3015864f9323711127a4964a8eceff6a52 (diff) | |
download | samba-2383787f199c51cdc202a3cef5822a9fe6b8774c.tar.gz samba-2383787f199c51cdc202a3cef5822a9fe6b8774c.tar.bz2 samba-2383787f199c51cdc202a3cef5822a9fe6b8774c.zip |
r4891: - added a generic resolve_name() async interface in libcli/resolve/,
which will eventually try all resolution methods setup in smb.conf
- only resolution backend at the moment is bcast, which does a
parallel broadcast to all configured network interfaces, and takes
the first reply that comes in (this nicely demonstrates how to do
parallel requests using the async APIs)
- converted all the existing code to use the new resolve_name() api
- removed all the old nmb code (yay!)
(This used to be commit 239c310f255e43dd2d1c2433f666c9faaacbdce3)
Diffstat (limited to 'source4/libcli/nbt/namequery.c')
-rw-r--r-- | source4/libcli/nbt/namequery.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/source4/libcli/nbt/namequery.c b/source4/libcli/nbt/namequery.c index 23a63ede11..05d5e55491 100644 --- a/source4/libcli/nbt/namequery.c +++ b/source4/libcli/nbt/namequery.c @@ -209,69 +209,3 @@ NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock, } -/* - some test functions - will be removed when nbt is hooked in everywhere -*/ -void test_name_status(const char *name, const char *addr) -{ - struct nbt_name_status io; - NTSTATUS status; - TALLOC_CTX *tmp_ctx = talloc_new(NULL); - struct nbt_name_socket *nbtsock; - int i; - - nbtsock = nbt_name_socket_init(tmp_ctx, NULL); - - io.in.name.name = name; - io.in.name.scope = NULL; - io.in.name.type = NBT_NAME_CLIENT; - io.in.dest_addr = addr; - io.in.timeout = 5; - - status = nbt_name_status(nbtsock, tmp_ctx, &io); - if (!NT_STATUS_IS_OK(status)) { - printf("status failed for %s - %s\n", name, nt_errstr(status)); - talloc_free(tmp_ctx); - exit(1); - return; - } - - printf("Received %d names for %s\n", io.out.status.num_names, io.out.name.name); - for (i=0;i<io.out.status.num_names;i++) { - printf("\t%s#%02x 0x%04x\n", - io.out.status.names[i].name, - io.out.status.names[i].type, - io.out.status.names[i].nb_flags); - } - talloc_free(tmp_ctx); -} - - -void test_name_query(const char *name) -{ - struct nbt_name_query io; - NTSTATUS status; - TALLOC_CTX *tmp_ctx = talloc_new(NULL); - struct nbt_name_socket *nbtsock; - - nbtsock = nbt_name_socket_init(tmp_ctx, NULL); - - io.in.name.name = name; - io.in.name.scope = NULL; - io.in.name.type = NBT_NAME_SERVER; - io.in.dest_addr = "255.255.255.255"; - io.in.broadcast = True; - io.in.wins_lookup = False; - io.in.timeout = 5; - - status = nbt_name_query(nbtsock, tmp_ctx, &io); - if (!NT_STATUS_IS_OK(status)) { - printf("query failed for %s - %s\n", name, nt_errstr(status)); - } else { - printf("response %s is at %s\n", io.out.name.name, io.out.reply_addr); - test_name_status("*", io.out.reply_addr); - } - - talloc_free(tmp_ctx); -} - |