Attempt to set ip and netmask remotely

This commit is contained in:
Jarrod Johnson 2013-10-11 14:45:19 -04:00
parent d3c49894d5
commit 8376bfab67
2 changed files with 19 additions and 1 deletions

View File

@ -114,7 +114,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

View File

@ -710,6 +710,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);