Bernard wrote:

> I get on the console:
> 
> kernel: martian source 0100007f for 029061cb, dev eth0
> kernel: ll header: ff ff ff ff ff ff 00 04 27 46 4b 40 08 06
> 
> which I interpreted as:
> 
> source 127.0.0.1 destination 203.97.144.02

# ./ipmask -Ri 0x0100007f
127.0.0.1
# ./ipmask -Ri 0x029061cb
203.97.144.2

Yup.  Looks right :-)

ipmask now supports reversed hexadecimal IPs, and also has a saner
handling of the -p option (pretty print).  Now, -p is recognized for all
options, and will print nicely anywhere.  If no display option is
chosen, -p is automatic.  I also added support for name lookups; don't
know if I announced this or not.  There is a package in:
http://leaf.sourceforge.net/pub/oxygen/packages/ipmask.lrp

# ./ipmask -R 0x029061cb 
IP Address: 203.97.144.2
Official name: b1-lqy-isl2.wlg.tsnz.net
Network range: 203.97.144.1 - 203.97.144.254
Broadcast address: 203.97.144.255
Broadcast address (BSD): 203.97.144.0
CIDR: 203.97.144.0/8
Subnet mask: 255.255.255.0
Cisco wildcard mask: 0.0.0.255
Network: 203.97.144.0
Hexadecimal: CB619002 (reversed: 029061CB)
# ./ipmask

ipmask version 0.3, Copyright (C) 2001  David Douthitt
<[EMAIL PROTECTED]>
ipmask comes with ABSOLUTELY NO WARRANTY; for details see the COPYING
file
that accompained this distribution. This is free software, and you are
welcome
to redistribute it under the terms of GNU PUBLIC LICENSE.

Usage:   ipmask [ -BbCcinrsxNmopR ] <ip> [ -m netmask ]

Display Options:

        -B      Display only broadcast address (BSD - obsolete)
        -b      Display only broadcast address
        -C      Display only Cisco wildcard mask
        -c      Display only CIDR
        -i      Display only IP
        -n      Display only network address
        -r      Display only range of valid addresses
        -s      Display subnet mask only
        -x      Display only hexadecimal IP

Modifiers:

        -N      No name lookups
        -m      Use this net mask
        -o      Official name (do a name lookup)
        -p      Pretty formatted display of all results
        -R      Hexadecimal IP address is in reversed order

ipmask is designed to assist in finding out things like masks and names,
and to do so in a fashion that permits easy use in scripts.

Is something like this worth being "associated" with LEAF or is it too
small?  I could put this up on Freshmeat I suppose - I always thought
something like this would be out there, but no one seems to have done
it.

_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to