*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "lib/socket/socket.h"
#define CHECK_VALUE(v, correct) do { \
#define CHECK_STRING(v, correct) do { \
if ((v) != (correct) && \
- ((v)==NULL || (correct)==NULL || StrCaseCmp(v, correct) != 0)) { \
+ ((v)==NULL || (correct)==NULL || strcasecmp_m(v, correct) != 0)) { \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
CHECK_STRING(io.out.wins_server, address);
CHECK_VALUE(io.out.rcode, 0);
- if (name->type != NBT_NAME_MASTER &&
+ if (name->type != NBT_NAME_MASTER &&
name->type != NBT_NAME_LOGON &&
+ name->type != NBT_NAME_BROWSER &&
(nb_flags & NBT_NM_GROUP)) {
printf("Try to register as non-group\n");
io.in.nb_flags &= ~NBT_NM_GROUP;
{
struct nbt_name name;
BOOL ret = True;
- uint32_t r = (unsigned)(random() % (100000));
+ uint32_t r = (uint32_t)(random() % (100000));
name.name = talloc_asprintf(mem_ctx, "_TORTURE-%5u", r);
name.type = NBT_NAME_LOGON;
ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H | NBT_NM_GROUP);
+ name.type = NBT_NAME_BROWSER;
+ ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H | NBT_NM_GROUP);
+
name.scope = "example";
name.type = 0x72;
ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H);
NTSTATUS status;
BOOL ret = True;
- name.name = lp_parm_string(-1, "torture", "host");
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
/* do an initial name resolution to find its IP */
- status = resolve_name(&name, mem_ctx, &address);
+ status = resolve_name(&name, mem_ctx, &address, NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to resolve %s - %s\n",
name.name, nt_errstr(status));