From: Peter Müller Date: Wed, 15 Nov 2017 22:10:43 +0000 (+0100) Subject: display GeoIP information on active network connections X-Git-Tag: v2.19-core117~1^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea4620fc4abefc4e8c06e2f0f01c10cc4e45e554;p=people%2Fstevee%2Fipfire-2.x.git display GeoIP information on active network connections Display GeoIP information on active network connections in WebUI. Use newly implemented function in /var/ipfire/geoip-functions.pl . Signed-off-by: Peter Müller Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index 96f09012b7..e9e9e335cf 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -31,6 +31,7 @@ use Switch; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; +require "${General::swroot}/geoip-functions.pl"; my $colour_multicast = "#A0A0A0"; @@ -379,6 +380,7 @@ print < +   @@ -386,6 +388,7 @@ print < +   @@ -409,9 +412,15 @@ print < $Lang::tr{'source ip and port'} + + $Lang::tr{'country'} + $Lang::tr{'dest ip and port'} + + $Lang::tr{'country'} + $Lang::tr{'download'} /
$Lang::tr{'upload'} @@ -540,6 +549,12 @@ foreach my $line (@conntrack) { my $bytes_in = format_bytes($bytes[0]); my $bytes_out = format_bytes($bytes[1]); + # enumerate GeoIP information + my $srcccode = &GeoIP::lookup($sip_ret); + my $src_flag_icon = &GeoIP::get_flag_icon($srcccode); + my $dstccode = &GeoIP::lookup($dip_ret); + my $dst_flag_icon = &GeoIP::get_flag_icon($dstccode); + # Format TTL $ttl = format_time($ttl); @@ -601,6 +616,9 @@ foreach my $line (@conntrack) { $sport_extra + + $srcccode + $dip @@ -613,6 +631,9 @@ foreach my $line (@conntrack) { $dport_extra + + $dstccode + $bytes_in / $bytes_out