perfsonar-dev - [pS-dev] [GEANT/SA2/SA2T3-OPPD] r620 - in branches/perfsonar-oppd-new-architect: bin etc/oppd-mdm lib/perfSONAR lib/perfSONAR/DataStruct
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/SA2T3-OPPD] r620 - in branches/perfsonar-oppd-new-architect: bin etc/oppd-mdm lib/perfSONAR lib/perfSONAR/DataStruct
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/SA2T3-OPPD] r620 - in branches/perfsonar-oppd-new-architect: bin etc/oppd-mdm lib/perfSONAR lib/perfSONAR/DataStruct
- Date: Mon, 9 Aug 2010 09:28:27 +0100
Author: dfn.calim
Date: 2010-08-09 09:28:27 +0100 (Mon, 09 Aug 2010)
New Revision: 620
Modified:
branches/perfsonar-oppd-new-architect/bin/oppd.pl
branches/perfsonar-oppd-new-architect/etc/oppd-mdm/oppd.conf
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
Log:
Debbugging fix
Modified: branches/perfsonar-oppd-new-architect/bin/oppd.pl
===================================================================
--- branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-07-30 07:13:26
UTC (rev 619)
+++ branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-08-09 08:28:27
UTC (rev 620)
@@ -835,15 +835,19 @@
#Create a DataStruct
my $ds = perfSONAR::DataStruct->new($soap_message->uri,
$nmwg_message);
- if ($ds->{ERROROCCUR}){
+ my $nmwg_response;
+ if ($ds->{ERROROCCUR} == 1){
#Do here response on error
$log->error("A error occured in creating data struct");
+ $nmwg_response = $ds->{RETURNMSG};
}
+ else{
+ $ds->{SERVICES} = \%services;
+ #Run $ds
+ perfSONAR->handle_request($ds);
+ $nmwg_response = $ds->{REQUESTMSG};
+ }
- $ds->{SERVICES} = \%services;
- #Run $ds
- perfSONAR->handle_request($ds);
- my $nmwg_response = $ds->{REQUESTMSG};
#TODO $nmwg_message <-> $nmwg_response? clone?
#TODO what about header?
$soap_message->body($nmwg_response->as_dom()->documentElement);
Modified: branches/perfsonar-oppd-new-architect/etc/oppd-mdm/oppd.conf
===================================================================
--- branches/perfsonar-oppd-new-architect/etc/oppd-mdm/oppd.conf
2010-07-30 07:13:26 UTC (rev 619)
+++ branches/perfsonar-oppd-new-architect/etc/oppd-mdm/oppd.conf
2010-08-09 08:28:27 UTC (rev 620)
@@ -17,7 +17,7 @@
# Default: on
#
# Example:
-# detach off
+detach off
#
#detach on
@@ -150,7 +150,7 @@
# Default: /var/run/oppd.pid
#
# Example:
-# pidfile off
+pidfile off
#
#pidfile "/var/run/oppd.pid"
@@ -450,20 +450,6 @@
#
#ssl_ca_path [FILL ME]
-#
-# ssl_trusted_webserver_cn - CN of certificate whose owner is allowed to use
this oppd
-#
-# If you want to restrict access to an oppd instance, you may specify the CN
-# of the certificate whose owner is allowed to execute any perfSONAR
requests.
-# All other users, including those with a valid certificate signed by one of
the
-# CAs listed in the $ssl_ca_path directory or the CA specified in
$ssl_ca_file.
-#
-# Default: none
-#
-# Example:
-# ssl_trusted_webserver_cn enoc enoc-troubleshooting.gridops.org
-#
-#ssl_trusted_webserver_cn [FILL ME]
###############################################################################
#
Modified:
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-07-30 07:13:26 UTC (rev 619)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-08-09 08:28:27 UTC (rev 620)
@@ -51,55 +51,8 @@
"http://ggf.org/ns/nmwg/tools/iperf/2.0/",
"owamp",
"bwctl"
- );
-
- $self->{"known_parameters"} = {
- src => 1,
- dst => 1,
- interval => 1,
- duration => 1,
- windowSize => 1,
- protocol => 1,
- bufferSize => 1,
- bandwidth => 1,
- login => 1,
- password => 1,
- TOS => 1,
-
- #more owamp
- count => 1,
- timeout => 1,
- size => 1,
- units => 1,
- send_schedule => 1,
- percentile => 1,
- one_way => 1,
- DSCP => 1,
- PHB => 1,
- enddelay => 1,
- startdelay => 1,
- bucket_width => 1,
- intermediates => 1,
- output => 1,
- port => 1,
- portrange => 1,
- individual => 1, #TODO check this parameter
- };
-
- $self->{"unsupported_parameters"} = {
- advisoryWindowsize => 1,
- scheduleInterval => 1,
- numberOfTests => 1,
- latest => 1,
- alpha => 1,
-
- #owamp specific
- save_summary => 1,
- directory => 1,
- no_summary => 1,
- };
+ );
-
bless $self, $class;
return $self;
}
@@ -117,7 +70,8 @@
$ds->{REQUESTMSG} = $nmwg;
#Check messagetype
- if (!$self->NMWGcheckMessagetype($messagetype,$ds)){
+ if (!$self->NMWGcheckMessagetype($messagetype,\$ds)){
+ $self->{LOGGER}->error("Error in checking message type");
$ds->{ERROROCCUR} = 1;
return;
}
@@ -125,6 +79,7 @@
($ds->{SERVICE} = $ds->{URI}) =~ s/^.*\/services\///;
$ds->{SERVICE} =~ s/\/$//;
$self->{LOGGER}->info("Requested service: $ds->{SERVICE}");
+
if (!$ds->{SERVICE}){
croak "Service $self->{SERVICE} not known!";
}
@@ -135,8 +90,8 @@
#hashes from document
my ($errorstring, $metaid) = $ds->{REQUESTMSG}->parse_all;
if($errorstring){
- $self->{LOGGER}->info($errorstring);
- $ds->{REQUESTMSG}->return_result_code("error.common.parse_error",
"$errorstring", $metaid);
+ $self->{LOGGER}->error($errorstring);
+ $$ds->{RETURNMSG} =
$ds->{REQUESTMSG}->return_result_code("error.common.parse_error",
"$errorstring", $metaid);
$self->{ERROROCCUR} = 1;
return;
}
@@ -144,15 +99,15 @@
#check if at least one metadata and one data element is in message
if(!($ds->{REQUESTMSG}->{"metadataIDs"})){
$errorstring = "No metadata definition in message.";
- $self->{LOGGER}->info($errorstring);
- $ds->{REQUESTMSG}->return_result_code("error.common.message",
"$errorstring", "message");
+ $self->{LOGGER}->error($errorstring);
+ $$ds->{RETURNMSG} =
$ds->{REQUESTMSG}->return_result_code("error.common.message", "$errorstring",
"message");
$ds->{ERROROCCUR} = 1;
return;
}
if(!(defined $ds->{REQUESTMSG}->{"dataIDs"})){
$errorstring = "No data trigger in message.";
- $self->{LOGGER}->info($errorstring);
- $ds->{REQUESTMSG}->return_result_code("error.common.message",
"$errorstring", "message");
+ $self->{LOGGER}->error($errorstring);
+ $$ds->{RETURNMSG} =
$ds->{REQUESTMSG}->return_result_code("error.common.message", "$errorstring",
"message");
$ds->{ERROROCCUR} = 1;
return;
}
@@ -161,6 +116,7 @@
foreach my $meta (keys %{$ds->{REQUESTMSG}->{"metadataIDs"}}){
#check for unknown eventTypes
my $et = $ds->{REQUESTMSG}->{"metadataIDs"}{$meta}{"eventType"};
+
if ($et =~ /admin/){ #dispatch to Echo module
$ds->{RETURNMSG} =
perfSONAR::Echo::handle_echo_request($ds->{REQUESTMSG}, $ds->{SERVICE});
$ds->{ERROROCCUR} = 1;
@@ -222,9 +178,9 @@
}#End foreach my $k
}# End foreach my $key
- my $error = $self->checkParams(%parameters);
+ my $error = $self->checkParams($ds, %parameters);
if ($error){
- $self->{LOGGER}->info($error);
+ $self->{LOGGER}->error($error);
$ds->{REQUESTMSG}->return_result_code("ERROR",
$ds->{SERVICE},$error, $ds->{REQUESTMSG}->{"dataIDs"}{$dataid}{"metaref"});
$ds->{ERROROCCUR} = 1;
return;
@@ -289,39 +245,38 @@
sub NMWGcheckMessagetype{
my ($self,$messagetype,$ds) = @_;
+
if ($messagetype eq "ErrorResponse"){ #error from authentication!
- $ds->{RETURNMSG} = $ds->{REQUESTMSG};
+ $$ds->{RETURNMSG} = $$ds->{REQUESTMSG};
return -1;
- }
+ }
if ($messagetype eq "AuthNEERequest"){ #authorization rquest to dummy AS
require perfSONAR::AS;
- $ds->{RETURNMSG} = perfSONAR::AS::dummy();
+ $$ds->{RETURNMSG} = perfSONAR::AS::dummy();
return -1;
}
if ($messagetype eq "SetupDataRequest"){
- $ds->{REQUESTMSG}->set_message_type("SetupDataResponse");
- return 1;
+ $$ds->{REQUESTMSG}->set_message_type("SetupDataResponse");
}
elsif ($messagetype eq "MeasurementRequest"){
- $ds->{REQUESTMSG}->set_message_type("MeasurementResponse");
- return 1;
+ $$$ds->{REQUESTMSG}->set_message_type("MeasurementResponse");
}
- elsif ($messagetype eq "MetadataKeyRequest"){
- $ds->{REQUESTMSG}->set_message_type("MetadataKeyResponse");
+ elsif ($messagetype eq "MetadataKeyRequest"){
+ $$ds->{REQUESTMSG}->set_message_type("MetadataKeyResponse");
+ }
+ elsif ($messagetype =~ /EchoRequest/){
+ $$ds->{REQUESTMSG}->set_message_type("EchoResponse");
+ }
+ else {
+ my $errorstring = "Unknown messagetype: $messagetype";
+ $self->{LOGGER}->error($errorstring);
+ $$ds->{REQUESTMSG}->set_message_type("ErrorResponse");
+ $$ds->{RETURNMSG} =
$$ds->{REQUESTMSG}->return_result_code("error.common.action_not_supported",
"$errorstring", "message");
+ return -1;
+ }
return 1;
- }
- elsif ($messagetype =~ /EchoRequest/){
- $ds->{REQUESTMSG}->set_message_type("EchoResponse");
- return 1;
- }
- else {
- my $errorstring = "Unknown messagetype: $messagetype";
- $self->{LOGGER}->info($errorstring);
- $ds->{REQUESTMSG}->set_message_type("ErrorResponse");
-
$self->{REQUESTMSG}->return_result_code("error.common.action_not_supported",
"$errorstring", "message");
- $ds->{RETURNMSG} = $ds->{REQUESTMSG};
- return 1;
- }
+ #$self->{LOGGER}->info("Messagetype: finish");
+ #$self->{LOGGER}->info(Dumper($ds));
}
=head2 checkParams()
@@ -332,9 +287,10 @@
=cut
#TODO return error message if unknown parameters to client
sub checkParams{
- my ($self,%parameters) = @_;
+ my ($self,$ds, %parameters) = @_;
my (@unknown,@unsupported, $error);
- #$self->{LOGGER}->info(Dumper(%parameters));
+ #$self->{LOGGER}->info(Dumper($ds->{"known_parameters"}));
+
foreach my $par (keys %parameters){
next if ($par eq "ns_prefix" ||
$par eq "param_ns_prefix" ||
@@ -345,12 +301,12 @@
$par eq "metaID" ||
$par eq "address" ||
$par eq "metadatakey");
- next if exists $self->{"known_parameters"}{$par};
- if (exists $self->{"unsupported_parameters"}->{$par}){
+ next if exists $ds->{"known_parameters"}{$par};
+ if (exists $ds->{"unsupported_parameters"}->{$par}){
push @unsupported, $par;
} else {
push @unknown, $par;
- $self->{LOGGER}->info(Dumper($par));
+ #$self->{LOGGER}->info(Dumper($par));
}
#more owamp
if ($parameters{"output"} && !($parameters{"output"} eq "per_packet"
||
@@ -370,6 +326,7 @@
my $error = "Unsupported parameters(s): " . join (", ",
@unsupported);
return $error;
}
+ return;
}
Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
2010-07-30 07:13:26 UTC (rev 619)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct.pm
2010-08-09 08:28:27 UTC (rev 620)
@@ -72,6 +72,53 @@
$self->{URI} = $uri;
}
+ $self->{"known_parameters"} = {
+ src => 1,
+ dst => 1,
+ interval => 1,
+ duration => 1,
+ windowSize => 1,
+ protocol => 1,
+ bufferSize => 1,
+ bandwidth => 1,
+ login => 1,
+ password => 1,
+ TOS => 1,
+
+ #more owamp
+ count => 1,
+ timeout => 1,
+ size => 1,
+ units => 1,
+ send_schedule => 1,
+ percentile => 1,
+ one_way => 1,
+ DSCP => 1,
+ PHB => 1,
+ enddelay => 1,
+ startdelay => 1,
+ bucket_width => 1,
+ intermediates => 1,
+ output => 1,
+ port => 1,
+ portrange => 1,
+ individual => 1, #TODO check this parameter
+ };
+
+ $self->{"unsupported_parameters"} = {
+ advisoryWindowsize => 1,
+ scheduleInterval => 1,
+ numberOfTests => 1,
+ latest => 1,
+ alpha => 1,
+
+ #owamp specific
+ save_summary => 1,
+ directory => 1,
+ no_summary => 1,
+ };
+
+
bless $self, $class;
#Look if message is nmwg message
- [pS-dev] [GEANT/SA2/SA2T3-OPPD] r620 - in branches/perfsonar-oppd-new-architect: bin etc/oppd-mdm lib/perfSONAR lib/perfSONAR/DataStruct, svn-noreply, 08/09/2010
Archive powered by MHonArc 2.6.16.