Adding Recursion Available bit to name_query and node_status_query

Richard Sharpe rsharpe at
Mon May 13 14:42:01 GMT 2002

On Mon, 13 May 2002, Christopher R. Hertel wrote:

> 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
>    at -d2.
> 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
>      bit set.
> 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
>      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
>      bit.
> RCode - Result code.
>      0 for success, else an error code.

These would be nice, except that I have found that these bits are all 
separate BOOLs in the decoded structure, instead of being a bit-field.

I will have to re-assemble them :-(

Richard Sharpe, rsharpe at, rsharpe at, 
sharpe at

More information about the samba-technical mailing list