Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Problems with au ADSL/network setup



David J Iannucci writes:

 > That sounds like broken software to me. I've never seen an IP
 > address in such a format ("dotted octal"?), and I've been around the
 > UNIX and TCP/IP world a rather long time (though it sounds like not
 > as long as you :=).
 > 
 > When written in the dotted notation, it's always supposed to be
 > decimal, no?

The answer, as far as I can tell, is "no".  That is, there's no
RFC for this.  The source would be RFC 952 or an update, but none of
them address the issue of *string* representation of IP addresses.[1]
The ABNF in RFC 952 looks like this:

      <address> ::= <octet> "." <octet> "." <octet> "." <octet>
      <octet> ::= <0 to 255 decimal>

Octets are typically allowed to be represented in octal, decimal, or
hexadecimal as convenient in RFCs.  In ABNF, the word "decimal" above
refers to the representation of "255" (hint, it's not decimal 173 ;-),
not to the representation of <octet>.

N.B. This doesn't prevent other protocols from restricting to
decimal.  But host tables need not use decimal in "dotted decimal".

To expand on Kalin's answer, the actual implementation from BSD is in
the standard function inet_aton(3).  Apple's man page explicitly
documents the octal and hexadecimal formats, which are chosen byte by
byte.  The glibc man page is typically butt-headed, documenting the
possibility only in an example.

My guess is that historically the scanf format "%i" is used to read
dotted addresses.  Dunno if that's what glibc uses.



Footnotes: 
[1]  Well, there are at least 20 updates to RFC 952 and its
successors.  I may have missed something.




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links