Utility code to determine os, check if network interface is up and if_nametoindex.