]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/logs.cgi/firewalllog.dat
firewalllog.dat: Proper display protocol names.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / logs.cgi / firewalllog.dat
index e326d65c0ae06d2838b794f3e8050a39ba2534fe..73596d8cdc072d4c60dccecf8d9e54084425d284 100644 (file)
@@ -325,6 +325,8 @@ print <<END
 END
 ;
 
+# Generate hash to translate protocol numbers into protocol names.
+my %protocols = &General::generateProtoTransHash();
 
 $lines = 0;
 foreach $_ (@log)
@@ -354,6 +356,12 @@ foreach $_ (@log)
        # Get the country code.
        my $ccode = &Location::Functions::lookup_country_code($srcaddr);
 
+       # Lookup if the grabbed protocol is part of the protocols hash.
+       if (exists ($protocols{$proto})) {
+               # Translate protocol number into protocol name.
+               $proto = $protocols{$proto};
+       }
+
        my $servi = uc(getservbyport($srcport, lc($proto)));
        if ($servi ne '' && $srcport < 1024) {
                $srcport = "$srcport($servi)";