Changeset 33
- Timestamp:
- 05/10/05 17:01:40 (4 years ago)
- Files:
-
- trunk/server/admin/perl/info (modified) (2 diffs)
- trunk/server/admin/perl/lbs-lib.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/server/admin/perl/info
r14 r33 1 1 #!/usr/bin/perl 2 2 # 3 # $Id : info 1686 2004-12-16 13:58:09Z root$3 # $Id$ 4 4 # 5 # Linbox Rescue Server6 # Copyright (C) 2005 Linbox FAS7 #8 # This program is free software; you can redistribute it and/or9 # modify it under the terms of the GNU General Public License10 # as published by the Free Software Foundation; either version 211 # of the License, or (at your option) any later version.12 #13 # This program is distributed in the hope that it will be useful,14 # but WITHOUT ANY WARRANTY; without even the implied warranty of15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 # GNU General Public License for more details.17 #18 # You should have received a copy of the GNU General Public License19 # along with this program; if not, write to the Free Software20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.21 5 22 6 my $devicelist; … … 58 42 sub getclass { 59 43 my ($class,$subclass)=@_; 60 $class=sprintf "%02x",hex($class); 61 $subclass=sprintf "%02x",hex($subclass); 62 44 45 if ($subclass eq "") { 46 $subclass=substr $class,2,2; 47 $class=substr $class,0,2; 48 } else { 49 $class=sprintf "%02x",hex($class); 50 $subclass=sprintf "%02x",hex($subclass); 51 } 52 63 53 open(REF,$devicelist) or die; 64 54 while (<REF>) trunk/server/admin/perl/lbs-lib.pl
r14 r33 542 542 543 543 544 # $macaddr etherGetMacByName (\%einfo, $name )544 # $macaddr etherGetMacByName (\%einfo, $name, $isshortname ?) 545 545 # Retourne une adresse MAC a partir d'un nom d'hote. 546 546 # Se base sur la structure retournee par etherLoad(). 547 # si shortname est defini, tronque chaque nom en version courte (nom netbios 548 # en principe) 547 549 # 548 550 sub etherGetMacByName … … 550 552 my $einfo = shift ; 551 553 my $name = shift ; 554 my $isshortname = shift ; 552 555 my ($k,$v, $l) ; 553 556 … … 558 561 $v = ${$einfo}{$k} ; 559 562 $l = lc( $$v[1] ) ; 563 $l =~ s|.*/|| if defined($isshortname); 560 564 return $k if ($l eq $name) ; 561 565 }
