From ca73b902f18deda1d8b76ad3f8f6f0c4f78f6835 Mon Sep 17 00:00:00 2001 From: yinle Date: Fri, 13 Dec 2013 01:19:04 -0800 Subject: [PATCH] Add lsslp unicast support --- xCAT-server/lib/xcat/plugins/lsslp.pm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index 74e66424e..af9a1893b 100644 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -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);