Commit fab358d9 authored by David Johnson's avatar David Johnson

* libsetup.pm: client side motelogconfig helper function

parent 9a23ad9a
......@@ -20,7 +20,7 @@ use Exporter;
TBBackGround TBForkCmd vnodejailsetup plabsetup vnodeplabsetup
jailsetup dojailconfig findiface libsetup_getvnodeid
ixpsetup libsetup_refresh gettopomap getfwconfig gettiptunnelconfig
gettraceconfig genhostsfile
gettraceconfig genhostsfile getmotelogconfig
TBDebugTimeStamp TBDebugTimeStampsOn
......@@ -1010,6 +1010,36 @@ sub gettiptunnelconfig($)
return 0;
}
#
# Get motelog configuration.
#
sub getmotelogconfig($)
{
my ($rptr) = @_;
my @motelogs = ();
if (tmcc(TMCCCMD_MOTELOG, undef, \@tmccresults) < 0) {
warn("*** WARNING: Could not get motelog config from server!\n");
return -1;
}
my $pat = q(MOTELOGID=([-\w]+) CLASSFILE=([\.]+) SPECFILE=([\.]*));
foreach my $str (@tmccresults) {
if ($str =~ /$pat/) {
push(@motelogs, { "MOTELOGID" => $1,
"CLASSFILE" => $2,
"SPECFILE" => $3
});
}
else {
warn("*** WARNING: Bad motelog line: $str\n");
}
}
@$rptr = @motelogs;
return 0;
}
my %fwvars = ();
#
......
......@@ -32,6 +32,7 @@ use Exporter;
TMCCCMD_BOOTERRNO TMCCCMD_BOOTLOG TMCCCMD_BATTERY TMCCCMD_USERENV
TMCCCMD_TIPTUNNELS TMCCCMD_TRACEINFO TMCCCMD_ELVINDPORT
TMCCCMD_PLABEVENTKEYS
TMCCCMD_MOTELOG
);
# Must come after package declaration!
......@@ -173,6 +174,7 @@ my %commandset =
"traceinfo" => {TAG => "traceinfo"},
"elvindport" => {TAG => "elvindport"},
"plabeventkeys" => {TAG => "plabeventkeys"},
"motelog" => {TAG => "motelog"},
);
#
......@@ -229,6 +231,7 @@ sub TMCCCMD_TIPTUNNELS (){ $commandset{"tiptunnels"}->{TAG}; }
sub TMCCCMD_TRACEINFO (){ $commandset{"traceinfo"}->{TAG}; }
sub TMCCCMD_ELVINDPORT (){ $commandset{"elvindport"}->{TAG}; }
sub TMCCCMD_PLABEVENTKEYS(){ $commandset{"plabeventkeys"}->{TAG}; }
sub TMCCCMD_MOTELOG() { $commandset{"motelog"}->{TAG}; }
#
# Caller uses this routine to set configuration of this library
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment