From e60f695efb74c4b00e57c0cd8696402feb9b747d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 11 Oct 2013 14:45:19 -0400 Subject: [PATCH] Attempt to set ip and netmask remotely --- xCAT-server/lib/perl/xCAT/IPMI.pm | 2 +- xCAT-server/lib/xcat/plugins/ipmi.pm | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 61082f040..b4f9e467d 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -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 diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index db22c7a1f..17037036f 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -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);