From 1c2ab212d96bbd642fd230b117c9940dae5e3767 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 22 Jul 1996 14:30:58 +0000 Subject: added lots of comments to the docs that Luke wrote on the internals of nmbd. I haven't been through all of them yet, but I'm getting there :-) (This used to be commit 9e411f2c9044104df60022da316379bd27e98b56) --- source3/namedbresp.doc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/namedbresp.doc') diff --git a/source3/namedbresp.doc b/source3/namedbresp.doc index 66f5a22124..4913d39e0e 100644 --- a/source3/namedbresp.doc +++ b/source3/namedbresp.doc @@ -46,3 +46,25 @@ expected response queue. the number of expected responses is decreased. this function is responsible for adding the response record created by make_response_queue_record() into the appropriate response record queue. + +----------------- +NOTE FROM TRIDGE: + +namedbresp.c is interesting because it implements a novel way of +getting most of the advantages of a multi-threaded nmbd daemon without +the portability problems. + +The NBT specs (rfc1001/1002) talk about the 16 bit IDs in the packets +as being used to ensure that packets are unique, and to stop packets +from being confused. It suggests incrementing the ID by 1 each time. + +Instead Luke uses these IDs to identify individual threads of control +in nmbd. So when nmbd sends out a NBT packet as part of some complex +processing, it adds to a linked list the information required to +continue the processing when the reply comes in (or it times +out). When a reply arrives this list can be searched to find the +matching query and the next step in the processing can be carried out. + +This is really good stuff, and allows for much more complex behaviour +than was possible with the old nmbd. +---------------- -- cgit