]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/connections.cgi
Rudimentaere ISDN-Erkennung erstellt.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / connections.cgi
index aeaf0db6e5e8fff5801b163664cebd095b2175e8..0cf82d84facc71d116ab684f345de68cc094901a 100644 (file)
@@ -21,7 +21,7 @@ use strict;
 
 # enable only the following on debugging purpose
 #use warnings;
-use CGI::Carp 'fatalsToBrowser';
+#use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
@@ -40,9 +40,14 @@ open (ACTIVE, 'iptstate -1rbt |') or die 'Unable to open ip_conntrack';
 my @active = <ACTIVE>;
 close (ACTIVE);
 
-my @vpn = ('none');
-#open (ACTIVE, "/proc/net/ipsec_eroute") and @vpn = <ACTIVE>;
-#close (ACTIVE);
+my @vpn = ` route -n | grep ipsec | awk '{ print \$1" "\$3}'`;
+  foreach my $route (@vpn) {
+                chomp($route);
+                my @temp = split(/[\t ]+/, $route);
+                push(@network, $temp[0]);
+                push(@masklen, $temp[1]);
+                push(@colour, ${Header::colourvpn} );
+        }
 
 my $aliasfile = "${General::swroot}/ethernet/aliases";
 open(ALIASES, $aliasfile) or die 'Unable to open aliases file.';
@@ -122,15 +127,7 @@ if (-e "${General::swroot}/ovpn/settings") {
                 push(@masklen, $tempovpnsubnet[1]);
                 push(@colour, ${Header::colourovpn} );
 
-    if ( ($ovpnsettings{'ENABLED'} eq 'on') && open(IP, "${General::swroot}/red/local-ipaddress") ) {
-      # add RED:port / proto
-                  my $redip = <IP>;
-                  close(IP);
-                  chomp $redip;
-                  push(@network, $redip );
-                  push(@masklen, '255.255.255.255' );
-                  push(@colour, ${Header::colourovpn} );
-    }
+
     if ( ($ovpnsettings{'ENABLED_BLUE'} eq 'on') && $netsettings{'BLUE_DEV'} ) {
       # add BLUE:port / proto
             push(@network, $netsettings{'BLUE_ADDRESS'} );
@@ -272,8 +269,10 @@ foreach my $line (@active) {
     my ($sip, $sport) = split(':', $temp[0]);
     my ($dip, $dport) = split(':', $temp[1]);
     my $proto = $temp[2];
-    my $state = $temp[3];
-    my $ttl = $temp[4];
+    my $state; my $ttl;
+    if ( $proto eq "esp" ){$state = "";$ttl = $temp[3];}
+    elsif ( $proto eq "icmp" ){$state = "";$ttl = $temp[4];}
+    else{$state = $temp[3];$ttl = $temp[4];}
     
     next if( !(
                        (($cgiparams{'SEE_PROTO'}  eq $Lang::tr{'all'}) || ($proto  eq $cgiparams{'SEE_PROTO'} ))
@@ -329,7 +328,7 @@ foreach my $line (@active) {
         </a>
       </td>
       <td align='center'>$proto</td>
-      <td align='center' bgcolor="${Header::table1colour}">$state</td>
+      <td align='center'>$state</td>
       <td align='center'>$ttl</td>
     </tr>
 END