Code

Readded my changes - Testing now
[gosa.git] / gosa-si / gosa-si-server
index 07d1aadf5f94858f1c38d33854ebb01f43eb3153..29542324b1d5628adf6d59b2808c51224e534ca5 100755 (executable)
 #     REVISION:  ---
 #===============================================================================
 
-
-# TODO
-#
-# max_children wird momentan nicht mehr verwendet, jede eingehende nachricht bekommt ein eigenes POE child
+my $server_version = '$HeadURL: https://oss.gonicus.de/repositories/gosa/trunk/gosa-si/gosa-si-server $:$Rev$';
 
 use strict;
 use warnings;
@@ -54,6 +51,12 @@ use Net::LDAP;
 use Net::LDAP::Util qw(:escape);
 use Time::HiRes qw( usleep);
 
+# revision number of server and program name
+my $server_headURL;
+my $server_revision;
+my $server_status;
+our $prg= basename($0);
+
 my $db_module = "DBsqlite";
 {
 no strict "refs";
@@ -65,13 +68,6 @@ daemon_log("0 INFO: importing database module '$db_module'", 1);
 my $modules_path = "/usr/lib/gosa-si/modules";
 use lib "/usr/lib/gosa-si/modules";
 
-# revision number of server and program name
-my $server_version = '$HeadURL: https://oss.gonicus.de/repositories/gosa/trunk/gosa-si/gosa-si-server $:$Rev: 10826 $';
-my $server_headURL;
-my $server_revision;
-my $server_status;
-our $prg= basename($0);
-
 our $global_kernel;
 my ($foreground, $ping_timeout);
 my ($server);
@@ -868,48 +864,6 @@ sub open_socket {
 }
 
 
-#sub get_local_ip_for_remote_ip {
-#      my $remote_ip= shift;
-#      my $result="0.0.0.0";
-#
-#      if($remote_ip =~ /^(\d\d?\d?\.){3}\d\d?\d?$/) {
-#              if($remote_ip eq "127.0.0.1") {
-#                      $result = "127.0.0.1";
-#              } else {
-#                      my $PROC_NET_ROUTE= ('/proc/net/route');
-#
-#                      open(PROC_NET_ROUTE, "<$PROC_NET_ROUTE")
-#                              or die "Could not open $PROC_NET_ROUTE";
-#
-#                      my @ifs = <PROC_NET_ROUTE>;
-#
-#                      close(PROC_NET_ROUTE);
-#
-#                      # Eat header line
-#                      shift @ifs;
-#                      chomp @ifs;
-#                      foreach my $line(@ifs) {
-#                              my ($Iface,$Destination,$Gateway,$Flags,$RefCnt,$Use,$Metric,$Mask,$MTU,$Window,$IRTT)=split(/\s/, $line);
-#                              my $destination;
-#                              my $mask;
-#                              my ($d,$c,$b,$a)=unpack('a2 a2 a2 a2', $Destination);
-#                              $destination= sprintf("%d.%d.%d.%d", hex($a), hex($b), hex($c), hex($d));
-#                              ($d,$c,$b,$a)=unpack('a2 a2 a2 a2', $Mask);
-#                              $mask= sprintf("%d.%d.%d.%d", hex($a), hex($b), hex($c), hex($d));
-#                              if(new NetAddr::IP($remote_ip)->within(new NetAddr::IP($destination, $mask))) {
-#                                      # destination matches route, save mac and exit
-#                                      $result= &get_ip($Iface);
-#                                      last;
-#                              }
-#                      }
-#              }
-#      } else {
-#              daemon_log("0 WARNING: get_local_ip_for_remote_ip() was called with a non-ip parameter: '$remote_ip'", 1);
-#      }
-#      return $result;
-#}
-
-
 sub send_msg_to_target {
     my ($msg, $address, $encrypt_key, $msg_header, $session_id) = @_ ;
     my $error = 0;