[yast-devel] IP netmask broadcast address calculator
Hello, I am looking for a "IP address calculator" in YCP. For example when I have IP address and netmask I like to get the resulting broadcast address (not only for 8 16 24 bit netmasks). Or when I have only a IP host or network address, I like to get the usual netmask for it depending on the address block, e.g. 127.x.x.x -> 255.0.0.0 10.x.x.x -> 255.0.0.0 192.168.x.x -> 255.255.255.0 (or 255.255.0.0 ?) In particular it would be nice if it accepts the various ways to specify the netmask, e.g. nnn.nnn.nnn.nnn/mm versus nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm I guess there is already code in whatever YCP module but where is it? Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Johannes Meixner wrote:
Hello,
I am looking for a "IP address calculator" in YCP.
For example when I have IP address and netmask I like to get the resulting broadcast address (not only for 8 16 24 bit netmasks).
Or when I have only a IP host or network address, I like to get the usual netmask for it depending on the address block, e.g. 127.x.x.x -> 255.0.0.0 10.x.x.x -> 255.0.0.0 192.168.x.x -> 255.255.255.0 (or 255.255.0.0 ?)
What about this: http://forgeftp.novell.com/yast/doc/SL11.1/modules/IP.html#ComputeBroadcast
In particular it would be nice if it accepts the various ways to specify the netmask, e.g. nnn.nnn.nnn.nnn/mm versus nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
http://forgeftp.novell.com/yast/doc/SL11.1/modules/Netmask.html#FromBits http://forgeftp.novell.com/yast/doc/SL11.1/modules/Netmask.html#ToBits
I guess there is already code in whatever YCP module but where is it?
See http://forgeftp.novell.com/yast/doc/SL11.1/modules/index.html Bye Lukas
participants (2)
-
Johannes Meixner
-
Lukas Ocilka