+ $_[0] =~ s|/\d+$||;
+ # if ($ptonok) {
+ # if ($_[0] =~ /:/) {
+ # if (inet_pton(AF_INET6, $_[0])) {
+ # return ($_[0] =~ /([:0-9a-f]+)/);
+ # }
+ # } else {
+ # if (inet_pton(AF_INET, $_[0])) {
+ # return ($_[0] =~ /([\.\d]+)/);
+ # }
+ # }
+ # } else {
+ if ($_[0] =~ /:/) {
+ return ($_[0] =~ /^((?:\:?\:?[0-9a-f]{0,4}){1,8}\:?\:?)$/i);
+ } else {
+ return ($_[0] =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/);
+ }
+# }
+ return undef;
+}
+
+# is it a zulu time hhmmZ
+sub is_ztime
+{
+ return $_[0] =~ /^(?:(?:2[0-3])|(?:[01][0-9]))[0-5][0-9]Z$/;