summaryrefslogtreecommitdiff
path: root/source4/libcli/dgram
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-04-08 05:34:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:28 -0500
commitf83e6ded9d31f819dba5e59e15c703d292716206 (patch)
tree37f141211a39f9aa5fe260068ba6ce6936caedde /source4/libcli/dgram
parente3775ee8501e2f15ee172970085c2c12e50da1cf (diff)
downloadsamba-f83e6ded9d31f819dba5e59e15c703d292716206.tar.gz
samba-f83e6ded9d31f819dba5e59e15c703d292716206.tar.bz2
samba-f83e6ded9d31f819dba5e59e15c703d292716206.zip
r6245: receive and parse the GETDC response in the NBT-DGRAM test. The test
now tries to bind to port 138 if possible, so if you run it as root and smbd/nmbd is not running then it works against windows servers (This used to be commit 52ccdb79bc922be52c24dd393323dbbee83a2aea)
Diffstat (limited to 'source4/libcli/dgram')
-rw-r--r--source4/libcli/dgram/libdgram.h6
-rw-r--r--source4/libcli/dgram/mailslot.c2
-rw-r--r--source4/libcli/dgram/netlogon.c16
3 files changed, 22 insertions, 2 deletions
diff --git a/source4/libcli/dgram/libdgram.h b/source4/libcli/dgram/libdgram.h
index 482fd86980..0b8157f0c6 100644
--- a/source4/libcli/dgram/libdgram.h
+++ b/source4/libcli/dgram/libdgram.h
@@ -124,5 +124,7 @@ NTSTATUS dgram_mailslot_netlogon_send(struct nbt_dgram_socket *dgmsock,
const char *dest_address,
struct nbt_name *src_name,
struct nbt_netlogon_packet *request);
-
-
+NTSTATUS dgram_mailslot_netlogon_parse(struct dgram_mailslot_handler *dgmslot,
+ TALLOC_CTX *mem_ctx,
+ struct nbt_dgram_packet *dgram,
+ struct nbt_netlogon_packet *netlogon);
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c
index 89aab9c874..3b7fcdcd81 100644
--- a/source4/libcli/dgram/mailslot.c
+++ b/source4/libcli/dgram/mailslot.c
@@ -64,6 +64,8 @@ struct dgram_mailslot_handler *dgram_mailslot_listen(struct nbt_dgram_socket *dg
DLIST_ADD(dgmsock->mailslot_handlers, dgmslot);
talloc_set_destructor(dgmslot, dgram_mailslot_destructor);
+ EVENT_FD_READABLE(dgmsock->fde);
+
return dgmslot;
}
diff --git a/source4/libcli/dgram/netlogon.c b/source4/libcli/dgram/netlogon.c
index 1f3a3d6c62..c76264eea4 100644
--- a/source4/libcli/dgram/netlogon.c
+++ b/source4/libcli/dgram/netlogon.c
@@ -56,3 +56,19 @@ NTSTATUS dgram_mailslot_netlogon_send(struct nbt_dgram_socket *dgmsock,
return status;
}
+
+/*
+ parse a netlogon response. The packet must be a valid mailslot packet
+*/
+NTSTATUS dgram_mailslot_netlogon_parse(struct dgram_mailslot_handler *dgmslot,
+ TALLOC_CTX *mem_ctx,
+ struct nbt_dgram_packet *dgram,
+ struct nbt_netlogon_packet *netlogon)
+{
+ DATA_BLOB *data = &dgram->data.msg.body.smb.body.trans.data;
+ NTSTATUS status;
+
+ status = ndr_pull_struct_blob(data, mem_ctx, netlogon,
+ (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
+ return status;
+}