[fpc-pascal] [NETWORK - LINUX ]: Calculate broadcast - network

Alexandre Leclerc alexandre.leclerc at gmail.com
Thu Oct 12 17:27:20 CEST 2006


2006/10/12, TOUZEAU DAVID <david.touzeau at fr.kaspersky.com>:
> <message>
> </message>
> Dear
>
> I develop a tool that change the network settings in /etc/network/interfaces
>
> the config file must be
> iface eth0 inet static
>          address 192.168.xx.xx
>          netmask 255.255.255.0
>          network 192.168.xx.0
>          broadcast 192.168.xx.255
>          gateway 192.168.xx.xx
>
>
> In this case when user type 10.1.1.2 and 255.255.0.0 i need to calculate
> the network address and broadcast.

For a class b network (based on your mask) that would be 10.1.255.255
for the broadcast and probably be 10.1.0.0 (?) for the network. More
info there: http://en.wikipedia.org/wiki/Broadcast_address

But all this is good for private networks only.

Hope this helps;
Best regards.

-- 
Alexandre Leclerc



More information about the fpc-pascal mailing list