[ntp:questions] what is the meaning of dash in the type field of ntpq -p output?
Brian Utterback
brian.utterback at oracle.com
Sat Jun 22 14:41:38 UTC 2013
A long standing question that I have been asked is what is the mean of a
dask ("-") in the type field of the output of "ntpq -p". The type field
is decoded from the destination address. Here is the code that
determines the type:
ch = (char)(((dummy&0xf0000000)==0xe0000000) ? 'm' :
((dummy&0x000000ff)==0x000000ff) ? 'b' :
((dummy&0xffffffff)==0x7f000001) ? 'l' :
((dummy&0xffffffe0)==0x00000000) ? '-' :
'u');
From this we can see that if the first octet of the IP is 224, then it
is mutlicast. If the last octet is 255, then it is boradcast. If it is
127.0.0.1 then is it is localhost. If everything except the last 5 bits
are zero, then it is the dash. And if it isn't any of these, then it is
unicast.
Of course, all of these definitions have problems, but I am totally
flummoxed by the "-" test. I can't figure out what it is trying to find
at all. Any ideas?
--
blu
Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. - Martin Golding
-----------------------------------------------------------------------|
Brian Utterback - Solaris RPE, Oracle Corporation.
Ph:603-262-3916, Em:brian.utterback at oracle.com
More information about the questions
mailing list