Changeset 1453
- Timestamp:
- 04/04/08 13:24:42 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/kindlund-simpler_agent/lib/HoneyClient/Manager/VM/Clone.pm
r1451 r1453 683 683 $LOG->info("Waiting for a valid IP address of clone VM (" . $self->{'config'} . ")."); 684 684 $ret = undef; 685 my $stubAgent = undef;686 685 my $logMsgPrinted = 0; 687 686 while (!defined($self->{'ip_address'}) or !defined($ret)) { … … 700 699 701 700 # Now, try contacting the Agent. 702 $s tubAgent= getClientHandle(namespace => "HoneyClient::Agent",703 address => $self->{'ip_address'},704 fault_handler => \&_handleFault);701 $self->{'_agent_handle'} = getClientHandle(namespace => "HoneyClient::Agent", 702 address => $self->{'ip_address'}, 703 fault_handler => \&_handleFault); 705 704 706 705 eval { 707 $som = $s tubAgent->getProperties(driver_name => $self->{'driver_name'});706 $som = $self->{'_agent_handle'}->getProperties(driver_name => $self->{'driver_name'}); 708 707 $ret = $som->result(); 709 708 }; … … 768 767 # Don't change the status field for any VM that has been marked 769 768 # as suspicious or compromised. 770 if (($self->{'status'} ne "suspicious") && 771 ($self->{'status'} ne "compromised")) { 772 $self->{'status'} = $args{'status'}; 769 if (($self->{'status'} eq "suspicious") || 770 ($self->{'status'} eq "compromised")) { 771 return $self; 772 } 773 774 # Change the status field. 775 $self->{'status'} = $args{'status'}; 776 777 # Update the corresponding client record in the Drone database. 778 if (defined($self->{'database_id'})) { 779 for ($self->{'status'}) { 780 if (/running/) { 781 HoneyClient::Manager::Database::set_client_running($self->{'database_id'}); 782 } elsif (/suspended/) { 783 HoneyClient::Manager::Database::set_client_suspended($self->{'database_id'}); 784 } elsif (/suspicious/) { 785 # TODO: Need to implement this properly. 786 } elsif (/compromised/) { 787 HoneyClient::Manager::Database::set_client_compromised($self->{'database_id'}); 788 } elsif (/deleted/) { 789 HoneyClient::Manager::Database::set_client_deleted($self->{'database_id'}); 790 } 791 } 773 792 } 774 793 … … 963 982 _vm_handle => undef, 964 983 984 # A SOAP handle to the Agent daemon. (This internal variable 985 # should never be modified externally.) 986 _agent_handle => undef, 987 965 988 # A variable indicated how long the object should wait for 966 # between subsequent retries to the HoneyClient::Manager::VM989 # between subsequent retries to any SOAP server 967 990 # daemon (in seconds). (This internal variable should never 968 991 # be modified externally.) … … 1161 1184 } 1162 1185 1186 # TODO: Comment this. 1187 sub something { 1188 1189 # Extract arguments. 1190 my ($self, %args) = @_; 1191 1192 # Sanity check: Make sure we've been fed an object. 1193 unless (ref($self)) { 1194 $LOG->error("Error: Function must be called in reference to a " . 1195 __PACKAGE__ . "->new() object!"); 1196 Carp::croak "Error: Function must be called in reference to a " . 1197 __PACKAGE__ . "->new() object!\n"; 1198 } 1199 1200 # Log resolved arguments. 1201 $LOG->debug(sub { 1202 # Make Dumper format more terse. 1203 $Data::Dumper::Terse = 1; 1204 $Data::Dumper::Indent = 0; 1205 Dumper(\%args); 1206 }); 1207 1208 # Sanity checks; check if any args were specified. 1209 my $argsExist = scalar(%args); 1210 1211 } 1212 1163 1213 ####################################################################### 1164 1214
