Changeset 139


Ignore:
Timestamp:
May 12, 2014, 6:54:01 PM (11 years ago)
Author:
g7moreau
Message:
  • Add two MAC address model possible use in HP switch
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r138 r139  
    343343   my $mac_address = shift;
    344344
     345   # D07E-28D1-7AB8 or d07e28-d17ab8
     346   if ($mac_address =~ m{^ (?: [0-9A-Fa-f]{4} -){2} [0-9A-Fa-f]{4} $}xms
     347      or $mac_address =~ m{^ [0-9A-Fa-f]{6} - [0-9A-Fa-f]{6} $}xms) {
     348      $mac_address =~ s/-//g;
     349      return join q{:}, unpack('(A2)*', uc($mac_address));
     350      }
     351
    345352   return join q{:}, map { substr( uc("00$_"), -2) } split m/ [:-] /xms, $mac_address;
    346353   }
Note: See TracChangeset for help on using the changeset viewer.