--- In Kevin Cozens <> wrote:
>
> James Bridson wrote:
> > Take a look at the manual page for a standard strtol implementation. I
> > suspect a lot of the C/C++ based UNIX utilities use this to convert
> > numeric arguments.
>
> It turns out that it doesn't use strtol. I found the source for
ifconfig.c
> which pointed to inet_atou32() which calls inet_aton(). I found the
source for
> inet_aton() at
> http://www.koders.com/c/fid40139EC8462EA3F15ABA7B83D9A63EEB56C67312.aspx
>
> The comment on lines 77 and 78 state:
>
> Collect number up to ``.''. Values are specified as for C:
> 0x=hex, 0=octal, other=decimal.
>
> Out of curiousity, I entered "ifconfig eth0 192.168.0.0x32" and
found it set
> the IP address to 192.168.0.50 (decimal).
>
> --
> Cheers!
>
> Kevin.
>
> http://www.ve3syb.ca/ |"What are we going to do today, Borg?"
> Owner of Elecraft K2 #2172 |"Same thing we always do, Pinkutus:
> | Try to assimilate the world!"
> #include <disclaimer/favourite> | -Pinkutus & the Borg
>
Kevin,
Thanks for doing that.
It was bugging me enough that it wasn't in the man page and I was
getting motivated to look.
- Conjecture mode on -
Actually this "feature" is quite slick in an Undocumented *nix way. It
could be quite useful to a network developer who has/had to work with,
potentially, text-based diagnostic tools... the diagnostic tool may
have defaulted to hex display so what better way to handle that than
to build the conversion right into the command-line.
Those days, pre-1998, of developing network code didn't have Wireshark
, then Ethereal, and it's GUI front end available. So, not being
familiar with tcpdump, its predecessor, that's where I'd look next.
- Conjecture mode off -
>From time to time the *nix lore is fun to explore. So much open source
code and so little time...
----
Andy
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|