s3-docs: Adapt version in man ldbrename.
[Samba.git] / source4 / torture / nbt / browse.c
bloba0e7b7d9caea75f670a41526dbc2f581ec2e817e
1 /*
2 Unix SMB/CIFS implementation.
4 Browse service
6 (C) Jelmer Vernooij 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "includes.h"
23 #include "librpc/gen_ndr/nbt.h"
24 #include "libcli/resolve/resolve.h"
25 #include "torture/torture.h"
28 test nbt dgram operations
30 bool torture_nbt_browse(struct torture_context *torture)
32 const char *address;
33 struct nbt_name name;
34 TALLOC_CTX *mem_ctx = talloc_new(NULL);
35 NTSTATUS status;
36 bool ret = true;
38 name.name = lp_workgroup();
39 name.type = NBT_NAME_BROWSER;
40 name.scope = NULL;
42 /* do an initial name resolution to find its IP */
43 status = resolve_name(&name, mem_ctx, &address, torture->ev);
44 if (!NT_STATUS_IS_OK(status)) {
45 printf("Failed to resolve %s - %s\n",
46 name.name, nt_errstr(status));
47 talloc_free(mem_ctx);
48 return false;
51 talloc_free(mem_ctx);
53 return ret;