mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	Attempt to set ip and netmask remotely
This commit is contained in:
		@@ -113,7 +113,7 @@ my %rmcp_codes = ( #human friendly translations of rmcp+ code numbers
 | 
			
		||||
my $socket; #global socket for all sessions to share.  Fun fun
 | 
			
		||||
my $select = IO::Select->new();
 | 
			
		||||
 | 
			
		||||
my %bmc_handlers; #hash from bmc address to a live session management object.  
 | 
			
		||||
our %bmc_handlers; #hash from bmc address to a live session management object.  
 | 
			
		||||
#only one allowed at a time per bmc
 | 
			
		||||
my %sessions_waiting; #track session objects that may want to retry a packet, value is timestamp to 'wake' object for retransmit
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -698,6 +698,24 @@ sub setnetinfo {
 | 
			
		||||
        $dstip = inet_ntoa(inet_aton($dstip));
 | 
			
		||||
		my @dip = split /\./, $dstip;
 | 
			
		||||
		@cmd = (0x01,$channel_number,0x13,$1,0x00,0x00,$dip[0],$dip[1],$dip[2],$dip[3],0,0,0,0,0,0);
 | 
			
		||||
        } elsif ($subcommand =~ m/netmask/) {
 | 
			
		||||
                if ($argument =~ /\./) {
 | 
			
		||||
                        my @mask = split /\./, $argument;
 | 
			
		||||
                        foreach (0..3) {
 | 
			
		||||
                                $mask[$_] = $mask[$_] + 0;
 | 
			
		||||
                        }
 | 
			
		||||
                        @cmd = (0x01,$channel_number,0x6,@mask);
 | 
			
		||||
                }
 | 
			
		||||
        } elsif ($subcommand =~ m/ip/) {
 | 
			
		||||
                if ($argument =~ /\./) {
 | 
			
		||||
                        my @mask = split /\./, $argument;
 | 
			
		||||
                        foreach (0..3) {
 | 
			
		||||
                                $mask[$_] = $mask[$_] + 0;
 | 
			
		||||
                        }
 | 
			
		||||
                @cmd = (0x01,$channel_number,0x3,@mask);
 | 
			
		||||
        $xCAT::IPMI::bmc_handlers{$argument} = $sessdata->{ipmisession};
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	#elsif($subcommand eq "alert" ) {
 | 
			
		||||
	#    my $action=pop(@input);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user