Code

* gosa-si-server-nobus
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 May 2008 07:54:25 +0000 (07:54 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 May 2008 07:54:25 +0000 (07:54 +0000)
* under construction

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11093 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server-nobus
gosa-si/modules/ServerPackages.pm
gosa-si/tests/client.php

index 4fab869890287a40b1d083628adac29658f749df..dc94baabaec451e47b986fb34da861bcda814fcb 100755 (executable)
@@ -1068,6 +1068,7 @@ sub msg_to_decrypt {
         if (not $done) {
             if (($target eq $server_address) && (not exists $msg_hash->{'forward_to_gosa'})) {
                 $done = 1;
+                print STDERR "target is own address without forward_to_gosa-tag -> process here\n";
             }
         }
 
@@ -1077,6 +1078,7 @@ sub msg_to_decrypt {
             $res = $known_clients_db->select_dbentry($sql);
             if (keys(%$res) > 0) {
                 $done = 1;
+                print STDERR "target is a client address in known_clients -> process here\n";
             }
         }
 
@@ -1111,7 +1113,9 @@ sub msg_to_decrypt {
                     $heap->{'client'}->put($msg);
                 }
                 $done = 1;
+                print STDERR "target is own address with forward_to_gosa-tag -> forward to gosa\n";
             }
+
         }
 
         # target is a client address in foreign_clients -> forward to registration server
@@ -1128,6 +1132,7 @@ sub msg_to_decrypt {
                     &send_msg_to_target($msg, $regserver, $regserver_key, $header, $session_id);
                 }
                 $done = 1;
+                print STDERR "target is a client address in foreign_clients -> forward to registration server\n";
             }
         }
 
@@ -1139,6 +1144,7 @@ sub msg_to_decrypt {
                 my $hostkey = $res->{1}->{'hostkey'};
                 &send_msg_to_target($msg, $target, $hostkey, $header, $session_id);
                 $done = 1;
+                print STDERR "target is a server address -> forward to server\n";
             }
         }
 
@@ -1217,6 +1223,11 @@ sub process_task {
     if( $error == 0) {
         daemon_log("$session_id INFO: Incoming msg (session_id=$session_id) with header '".@{$msg_hash->{'header'}}[0]."'", 5); 
         daemon_log("$session_id DEBUG: Processing module ".$module, 7);
+
+        known_modules
+    }
+
+    if ($error == 0) { 
         $answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $session_id);
 
         if ( 0 < @{$answer_l} ) {
@@ -1264,12 +1275,12 @@ sub process_task {
                 # targets of msg are all gosa-si-server in known_server_db
                 elsif( $answer_target eq "KNOWN_SERVER" ) {
                     # answer is for all server in known_server
-                    my $sql_statement= "SELECT * FROM known_server";
+                    my $sql_statement= "SELECT * FROM $known_server_tn";
                     my $query_res = $known_server_db->select_dbentry( $sql_statement ); 
                     while( my ($hit_num, $hit) = each %{ $query_res } ) {    
                         my $host_name = $hit->{hostname};
                         my $host_key = $hit->{hostkey};
-                        $answer =~ s/KNOWN_SERVER/$host_name/g;
+                        $answer =~ s/<target>KNOWN_SERVER<\/target>/<target>$host_name<\/target>/g;
                         my $error = &send_msg_to_target($answer, $host_name, $host_key, $answer_header, $session_id);
                         &update_jobdb_status_for_send_msgs($answer, $error);
                     }
index d70afd40e6a34e6df05a8198261ddd7f803677dc..8e64273455bd42db862ec0c3152ba0a807dd6769 100644 (file)
@@ -63,6 +63,8 @@ sub process_incoming_msg {
         no strict 'refs';
         @out_msg_l = &{$event_hash->{$header}."::$header"}($msg, $msg_hash, $session_id);
     } else {
+        &main::daemon_Log("$session_id ERROR: ServerPackages: no event handler defined for '$header'", 1);
+        @out_msg_l = ();
     }
 
     return @out_msg_l;
index 325c38680dc227f5065b5c9b0c3064d0ae05b774..135bb44a1a25d8f2863f6003ebcee4d9bb798364 100755 (executable)
@@ -105,7 +105,8 @@ for($count = 1; $count <= $zahl; $count++)
     #$data = "<xml> <header>gosa_krb5_create_principal</header> <target>00:01:6c:9d:aa:16</target> <principal>horst@WIRECARD.SYS</principal><source>GOSA</source><max_life>666</max_life></xml>"; 
     #$data = "<xml> <header>gosa_krb5_modify_principal</header> <target>00:01:6c:9d:b9:fa</target> <principal>horst@WIRECARD.SYS</principal><source>GOSA</source><max_life>666</max_life></xml>"; 
 
-    $data = "<xml> <header>new_ping</header> <target>10.89.1.131:20081</target> <source>GOSA</source> <forward_to_gosa></forward_to_gosa> </xml>";
+    #$data = "<xml> <header>new_ping</header> <target>10.89.1.131:20083</target> <source>GOSA</source> <forward_to_gosa></forward_to_gosa> </xml>";
+    $data = "<xml> <header>new_ping</header> <target>00:0c:29:02:e5:4d</target> <source>GOSA</source> </xml>";
 
     $sock->write($data);
     $answer = "nothing";