Mailinglist Archive: yast-devel (105 mails)

< Previous Next >
Re: [yast-devel] IP netmask broadcast address calculator
  • From: Lukas Ocilka <lukas.ocilka@xxxxxxx>
  • Date: Fri, 26 Sep 2008 09:43:03 +0200
  • Message-id: <48DC9287.3010306@xxxxxxx>
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

< Previous Next >
References