This function will take an IP address and either a subnet mask, or a mask length, and return a custom object with information about that subnet. The information you get is basic stuff like network address, the first and the last usable addresses, the broadcast address etc. But it will also tell you the class of the address, as well as if it’s a private address or not. If run without any parameters it will try to get the needed information from the host you are running it on.
As always, if you discover any bugs, or have any ideas for future improvement, drop me a line in the comments section below!