2 package org.smallfoot.wwn;
4 import java.math.BigInteger;
39 else if (wwn.matches(
"2[0-9a-f]{3}000dec[0-9a-f]{6}"))
41 else if (wwn.matches(
"2[0-9a-f]{3}001560[0-9a-f]{6}"))
43 else if (wwn.matches(
"2[0-9a-f]{3}00215a[0-9a-f]{6}"))
45 else if (wwn.matches(
"2[0-9a-f]{3}547fee[0-9a-f]{6}"))
65 String res = super.toString();
66 if (null == res) res =
"";
70 BigInteger portOuiSer[] =
wwn.divideAndRemainder(
new BigInteger(
"1000000",16));
73 BigInteger portOui[] = portOuiSer[0].divideAndRemainder(
new BigInteger(
"1000000",16));
78 return res + String.format(
"Cisco-%06x:%d",portOuiSer[1].intValue(),portOui[0].intValue() % (1 << 12) );
80 return res + String.format(
"Cisco-%06x-%06x:%d",portOui[1].intValue(),portOuiSer[1].intValue(),portOui[0].intValue() % (1 << 12) );
90 BigInteger serPort[] =
wwn.divideAndRemainder(
new BigInteger(
"1000000000000",16));
91 return String.format(
"%03x",serPort[0].intValue() % (1 << 12));