History log of /openwrt/package/base-files/files/bin/ipcalc.sh
Revision Date Author Comments
# 4ce04ce6 16-Dec-2013 Jo-Philipp Wich <jow@openwrt.org>

base-files: ipcalc.sh: support bit length as netmask parameter

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39100 3c298f89-4303-0410-b956-a3cf2f4a3e73


# d723a387 09-Dec-2013 Luka Perkov <luka@openwrt.org>

[package] base-files: fix whitespaces

Signed-off-by: Luka Perkov <luka@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39006 3c298f89-4303-0410-b956-a3cf2f4a3e73


# a6a3bd8d 23-Dec-2012 Jo-Philipp Wich <jow@openwrt.org>

base-files: ipcalc.sh: fix broken calculations on 64bit systems

Calculate complements by using awk's xor() function with a mask of 0xffffffff
instead of relying on the compl() function which appears to produce broken
results on certain 64bit architectures.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34875 3c298f89-4303-0410-b956-a3cf2f4a3e73


# d68b4d1b 18-May-2011 Jo-Philipp Wich <jow@openwrt.org>

[PATCH] ipcalc.sh CIDR notation
Hi,

the attached patch makes ipcalc.sh accept IP/Netmask combinations in
CIDR notation. Before you could only do:

# sh ipcalc.sh 192.168.0.0 255.255.255.0 1 10
IP=192.168.0.0
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
PREFIX=24
START=192.168.0.1
END=192.168.0.11

with this patch you can also execute it with:

sh ipcalc.sh 192.168.0.0/24 1 10
IP=192.168.0.0
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
PREFIX=24
START=192.168.0.1
END=192.168.0.11

The patch is based on #1260 [1], i just changed one line to calculate
the START end END ips right. I wonder why that never got included. If
there is no reason not to do i would like to ask you to commit that
patch, because its a functionality i (and probably others) miss quite often.

Btw, i also fixed 4 useless tabs, that might look a bit strange in the
patch.

Regards, Manuel


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26930 3c298f89-4303-0410-b956-a3cf2f4a3e73


# fba51e7b 13-Feb-2011 Felix Fietkau <nbd@openwrt.org>

base-files: remove a stale reference to /usr/lib/common.awk (thx, swalker)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25528 3c298f89-4303-0410-b956-a3cf2f4a3e73


# 04ec55e7 12-Feb-2011 Felix Fietkau <nbd@openwrt.org>

base-files: /usr/lib/common.awk is only used by /bin/ipcalc.sh, move the code there

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25495 3c298f89-4303-0410-b956-a3cf2f4a3e73


# 2d5e31ea 29-Jun-2009 Jo-Philipp Wich <jow@openwrt.org>

[package] base-files: ipcalc.sh: fix off-by-one in range-calculation


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16619 3c298f89-4303-0410-b956-a3cf2f4a3e73


# 947bab0a 17-Mar-2007 Felix Fietkau <nbd@openwrt.org>

upgrade dnsmasq to latest version, rewrite dnsmasq init script for uci, rename /bin/ipcalc to /bin/ipcalc.sh (fixes #1452)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6595 3c298f89-4303-0410-b956-a3cf2f4a3e73