[Turn off line numbering]1: arg value, @args; 2: var parts; 3: 4: // DNS Hostnames are not used due to the extreme slowdown it would 5: // cause to _ALL_ services 6: if (match_regexp(value, "[^0-9.]")) 7: throw(~type, "Invalid Internet Host IP address or subnet: " + value); 8: parts = explode(value, "."); 9: if (listlen(parts) < 2) 10: throw(~type, "Do you really want to deny an entire class A network?"); 11: if (listlen(parts) > 4) 12: throw(~type, "Invalid IP Address: " + parts.join(".")); 13: return parts.join(".");
// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit