Adding Recursion Available bit to name_query and node_status_query
Christopher R. Hertel
crh at umn.edu
Mon May 13 10:05:03 GMT 2002
Richard Sharpe wrote:
> > > Any objections?
> > Nope.
> Actually, I was thinking that it would be useful to return the entire
> set of flags.
> This might be better than returning just one of them.
> Any further thoughts?
Well, you've got me thinking (always a dangerous thing to do). There
are three things that came to mind:
1) It would be nice to see the flags on the outgoing packet as well
as the repl[y|ies].
2) It might make sense produce this output on debug level 1, rather
than by default. Or perhaps incoming flags at -d1 and both sets
3) It would also be nice to see the RCode value in any error message
received (we may already provide the diagnostics).
For those just tuning in from home, here's a rundown of the flag
values we are talking about:
R - Reply bit.
This should always be set on packets received by nmblookup. It
would be an error if it wasn't.
OpCode - Operation Code.
Always 0x00 for queries (which is what nmblookup sends).
AA - Authoritative Answer.
Likewise. I *think* that the AA flag is a hold-over from the
DNS system (the basis for the NBT Name Service).
I would love to see this reported, however, because I am
wondering whether WINS Proxies (does anyone still use those?)
leave this bit clear.
TC - Truncation flag.
No one has, to my knowledge, ever implemented truncated Name
Service packets. According to the RFCs, if you get a packet
with the TC bit set, the you can negotiate the use of TCP.
(Yes, that would be TCP on port 137. No one ever implemented
that, as far as I know.) I believe that all implementations
ignore this bit (though I've not tested to see what Windows
does if this is set). I would be very surprised to see this
RD - Recursion Desired.
Only has meaning in request messages. Used to indicate that
the NBNS (WINS) server should be consulted.
There is a lengthy discussion of all of this in section 22.214.171.124
of my docs. The RD bit is used heavily to distinguish between
requests, queries, and demands. In reply messages, however, its
state is (probably) not significant at all. My guess is that it
will typically match the state of the RD bit in the request.
RA - Recursion Available.
Should only be set in messages which come from the NBNS (WINS)
server itself. Note that a machine that is running WINS will
also have a local name table. If the reply comes from the
local name table, then RA should be clear even if the same node
is running the NBNS (WINS) server.
B - Broadcast bit.
Set when the packet is being sent as a broadcast. Interesting
to play with this bit, particularly in conjunction with the RD
RCode - Result code.
0 for success, else an error code.
Christopher R. Hertel -)----- University of Minnesota
crh at nts.umn.edu Networking and Telecommunications Services
More information about the samba-technical