From 76480dba70002a5e43a59319c3cc6b41e8388330 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 31 Dec 2005 08:42:01 +0000 Subject: r12639: - do some tests with 0x20 0x1B names - do some tests with 0xBF and 0xBE, this shows that the '+' padding should be done by the client metze (This used to be commit 5a257ba9811b247a0df2b44c99df00f59dacc1e0) --- source4/torture/nbt/wins.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/wins.c') diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index 76f26ac1c0..37e9688a60 100644 --- a/source4/torture/nbt/wins.c +++ b/source4/torture/nbt/wins.c @@ -25,8 +25,8 @@ #define CHECK_VALUE(v, correct) do { \ if ((v) != (correct)) { \ - printf("(%s) Incorrect value %s=%d - should be %d\n", \ - __location__, #v, v, correct); \ + printf("(%s) Incorrect value %s=%d (0x%X) - should be %d (0x%X)\n", \ + __location__, #v, v, v, correct, correct); \ ret = False; \ }} while (0) @@ -40,7 +40,7 @@ #define CHECK_NAME(_name, correct) do { \ CHECK_STRING((_name).name, (correct).name); \ - CHECK_VALUE((_name).type, (correct).type); \ + CHECK_VALUE((uint8_t)(_name).type, (uint8_t)(correct).type); \ CHECK_STRING((_name).scope, (correct).scope); \ } while (0) @@ -293,7 +293,7 @@ static BOOL nbt_test_wins(TALLOC_CTX *mem_ctx, const char *address) uint32_t r = (uint32_t)(random() % (100000)); name.name = talloc_asprintf(mem_ctx, "_TORTURE-%5u", r); - + name.type = NBT_NAME_CLIENT; name.scope = NULL; ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); @@ -303,12 +303,24 @@ static BOOL nbt_test_wins(TALLOC_CTX *mem_ctx, const char *address) ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H | NBT_NM_GROUP); + name.type = NBT_NAME_SERVER; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + 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.type = NBT_NAME_PDC; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + + name.type = 0xBF; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + + name.type = 0xBE; + ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); + name.scope = "example"; name.type = 0x72; ret &= nbt_test_wins_name(mem_ctx, address, &name, NBT_NODE_H); -- cgit