While working on a custom packet injector for Linux, I had to calculate the network and broadcast IP addresses given an IP address and a netmask. After searching on Google I found that the calculations are some very simple bitwise operations. To get the network address perform a bitwise AND on the IP address and [...]
Archive of posts filed under the Programming category.