openwrt/package
Jo-Philipp Wich ed8f726dab 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

SVN-Revision: 26930
2011-05-18 09:50:06 +00:00
..
6in4
6to4
acx
acx-mac80211
admswconfig
apex
ar7-atm
arptables
avila-wdt
base-files ipcalc.sh CIDR notation Hi, 2011-05-18 09:50:06 +00:00
block-mount
bridge-utils
broadcom-diag
broadcom-wl
busybox
button-hotplug
comgt
compcache
crda
cyassl
dnsmasq
dropbear
e2fsprogs
ead
ebtables
ep80579-drivers
fconfig
firewall
fuse
gdb
goldfish-qemu
gpioctl
grub
hostap-driver
hostap-utils
hostapd
hotplug2
i2c-gpio-custom
ifenslave
iproute2
ipset
iptables
iw
ixp4xx-microcode
jshn
kernel
kexec-tools
libipfix
libjson-c
libnl
libnl-tiny
libpcap
libreadline
librpc
libtool
libubox
linux-atm
lqtapi
ltq-dsl
ltq-dsl-app
ltq-ifxos
ltq-kpi2udp
ltq-tapi
ltq-tapidemo
ltq-vmmc
lua
mac80211
madwifi
mmc_over_gpio
mountd
mtd
ncurses
nvram
ocf-crypto-headers
openssl
opkg
pjsip
ppp
pptp
ps3-utils
pwm-gpio-custom
px5g
qos-scripts
redboot-ar231x
relayd
robocfg
rotary-gpio-custom
rtc-rv5c386a
siit
soloscli
spi-ks8995
spidev_test
swconfig
switch
uboot-ar71xx
uboot-envtools
uboot-kirkwood
uboot-lantiq
uboot-omap35xx
uboot-xburst
ubsec_ssb
ubus
uci
udev
uhttpd
util-linux-ng
vsc73x5-ucode
w1-gpio-custom
wireless-tools
wprobe
wrt55agv2-spidevs
xfsprogs
yamonenv
zlib
Makefile