Add lsslp unicast support

This commit is contained in:
yinle 2013-12-13 01:19:04 -08:00
parent 22e3c40f09
commit ca73b902f1

View File

@ -277,7 +277,7 @@ sub parse_args {
# Process command-line flags
#############################################
if (!GetOptions( \%opt,
qw(h|help V|Verbose v|version i=s x z w r s=s e=s t=s m c n C=s T=s I flexdiscover updatehosts vpdtable))) {
qw(h|help V|Verbose v|version i=s x z w r s=s e=s t=s m c n C=s T=s I u range=s flexdiscover updatehosts vpdtable))) {
return( usage() );
}
@ -419,6 +419,21 @@ sub parse_args {
if ( exists( $opt{n} )) {
$globalopt{n} = 1;
}
##############################################
# unicast
##############################################
if ( exists( $opt{u} )) {
$globalopt{u} = 1;
unless (exists( $opt{s} ) and exists ($opt{range})) {
return( usage( "-u should be used with -s and --range" ));
}
$globalopt{range} = $opt{range};
}
if (exists( $opt{range} )) {
unless (exists( $opt{u} )) {
return( usage( "range is used in unicast mode" ));
}
}
##############################################
# warn for no discovered nodes in database
@ -560,6 +575,10 @@ sub invoke_dodiscover {
$arg{Time} = $globalopt{T} if($globalopt{T});
$arg{nomsg} = 1 if($globalopt{z} or $globalopt{x});
$arg{reqcallback} = $request->{callback} if($request->{callback});
if ($globalopt{u}) {
$arg{unicast} = 1;
$arg{range} = $globalopt{range};
}
my ($searchmacsref,$sendcount,$rsp) = xCAT::SLP::dodiscover(%arg);