public final class io.netty.util.internal.MacAddressUtil
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: io.netty.util.internal.MacAddressUtil
super_class: java.lang.Object
{
private static final io.netty.util.internal.logging.InternalLogger logger;
descriptor: Lio/netty/util/internal/logging/InternalLogger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final int EUI64_MAC_ADDRESS_LENGTH;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 8
private static final int EUI48_MAC_ADDRESS_LENGTH;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 6
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc Lio/netty/util/internal/MacAddressUtil;
invokestatic io.netty.util.internal.logging.InternalLoggerFactory.getInstance:(Ljava/lang/Class;)Lio/netty/util/internal/logging/InternalLogger;
putstatic io.netty.util.internal.MacAddressUtil.logger:Lio/netty/util/internal/logging/InternalLogger;
1: return
LocalVariableTable:
Start End Slot Name Signature
public static byte[] bestAvailableMac();
descriptor: ()[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=10, args_size=0
0: getstatic io.netty.util.internal.EmptyArrays.EMPTY_BYTES:[B
astore 0
start local 0 1: getstatic io.netty.util.NetUtil.LOCALHOST4:Ljava/net/Inet4Address;
astore 1
start local 1 2: new java.util.LinkedHashMap
dup
invokespecial java.util.LinkedHashMap.<init>:()V
astore 2
start local 2 3: invokestatic java.net.NetworkInterface.getNetworkInterfaces:()Ljava/util/Enumeration;
astore 3
start local 3 4: aload 3
ifnull 16
5: goto 12
6: StackMap locals: byte[] java.net.InetAddress java.util.Map java.util.Enumeration
StackMap stack:
aload 3
invokeinterface java.util.Enumeration.nextElement:()Ljava/lang/Object;
checkcast java.net.NetworkInterface
astore 4
start local 4 7: aload 4
invokestatic io.netty.util.internal.SocketUtils.addressesFromNetworkInterface:(Ljava/net/NetworkInterface;)Ljava/util/Enumeration;
astore 5
start local 5 8: aload 5
invokeinterface java.util.Enumeration.hasMoreElements:()Z
ifeq 12
9: aload 5
invokeinterface java.util.Enumeration.nextElement:()Ljava/lang/Object;
checkcast java.net.InetAddress
astore 6
start local 6 10: aload 6
invokevirtual java.net.InetAddress.isLoopbackAddress:()Z
ifne 12
11: aload 2
aload 4
aload 6
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 6 end local 5 end local 4 12: StackMap locals:
StackMap stack:
aload 3
invokeinterface java.util.Enumeration.hasMoreElements:()Z
ifne 6
end local 3 13: goto 16
StackMap locals: byte[] java.net.InetAddress java.util.Map
StackMap stack: java.net.SocketException
14: astore 3
start local 3 15: getstatic io.netty.util.internal.MacAddressUtil.logger:Lio/netty/util/internal/logging/InternalLogger;
ldc "Failed to retrieve the list of available network interfaces"
aload 3
invokeinterface io.netty.util.internal.logging.InternalLogger.warn:(Ljava/lang/String;Ljava/lang/Throwable;)V
end local 3 16: StackMap locals:
StackMap stack:
aload 2
invokeinterface java.util.Map.entrySet:()Ljava/util/Set;
invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
astore 4
goto 43
StackMap locals: byte[] java.net.InetAddress java.util.Map top java.util.Iterator
StackMap stack:
17: aload 4
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.util.Map$Entry
astore 3
start local 3 18: aload 3
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
checkcast java.net.NetworkInterface
astore 5
start local 5 19: aload 3
invokeinterface java.util.Map$Entry.getValue:()Ljava/lang/Object;
checkcast java.net.InetAddress
astore 6
start local 6 20: aload 5
invokevirtual java.net.NetworkInterface.isVirtual:()Z
ifeq 22
21: goto 43
22: StackMap locals: byte[] java.net.InetAddress java.util.Map java.util.Map$Entry java.util.Iterator java.net.NetworkInterface java.net.InetAddress
StackMap stack:
aload 5
invokestatic io.netty.util.internal.SocketUtils.hardwareAddressFromNetworkInterface:(Ljava/net/NetworkInterface;)[B
astore 7
start local 7 23: goto 27
end local 7 StackMap locals:
StackMap stack: java.net.SocketException
24: astore 8
start local 8 25: getstatic io.netty.util.internal.MacAddressUtil.logger:Lio/netty/util/internal/logging/InternalLogger;
ldc "Failed to get the hardware address of a network interface: {}"
aload 5
aload 8
invokeinterface io.netty.util.internal.logging.InternalLogger.debug:(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
26: goto 43
end local 8 start local 7 27: StackMap locals: byte[]
StackMap stack:
iconst_0
istore 8
start local 8 28: aload 0
aload 7
invokestatic io.netty.util.internal.MacAddressUtil.compareAddresses:([B[B)I
istore 9
start local 9 29: iload 9
ifge 32
30: iconst_1
istore 8
31: goto 40
StackMap locals: int int
StackMap stack:
32: iload 9
ifne 40
33: aload 1
aload 6
invokestatic io.netty.util.internal.MacAddressUtil.compareAddresses:(Ljava/net/InetAddress;Ljava/net/InetAddress;)I
istore 9
34: iload 9
ifge 37
35: iconst_1
istore 8
36: goto 40
StackMap locals:
StackMap stack:
37: iload 9
ifne 40
38: aload 0
arraylength
aload 7
arraylength
if_icmpge 40
39: iconst_1
istore 8
40: StackMap locals:
StackMap stack:
iload 8
ifeq 43
41: aload 7
astore 0
42: aload 6
astore 1
end local 9 end local 8 end local 7 end local 6 end local 5 end local 3 43: StackMap locals: byte[] java.net.InetAddress java.util.Map top java.util.Iterator
StackMap stack:
aload 4
invokeinterface java.util.Iterator.hasNext:()Z
ifne 17
44: aload 0
getstatic io.netty.util.internal.EmptyArrays.EMPTY_BYTES:[B
if_acmpne 46
45: aconst_null
areturn
46: StackMap locals: byte[] java.net.InetAddress java.util.Map
StackMap stack:
aload 0
arraylength
tableswitch { // 6 - 6
6: 47
default: 54
}
47: StackMap locals:
StackMap stack:
bipush 8
newarray 8
astore 3
start local 3 48: aload 0
iconst_0
aload 3
iconst_0
iconst_3
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
49: aload 3
iconst_3
iconst_m1
bastore
50: aload 3
iconst_4
bipush -2
bastore
51: aload 0
iconst_3
aload 3
iconst_5
iconst_3
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
52: aload 3
astore 0
53: goto 55
end local 3 54: StackMap locals:
StackMap stack:
aload 0
bipush 8
invokestatic java.util.Arrays.copyOf:([BI)[B
astore 0
55: StackMap locals:
StackMap stack:
aload 0
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
1 56 0 bestMacAddr [B
2 56 1 bestInetAddr Ljava/net/InetAddress;
3 56 2 ifaces Ljava/util/Map<Ljava/net/NetworkInterface;Ljava/net/InetAddress;>;
4 13 3 interfaces Ljava/util/Enumeration<Ljava/net/NetworkInterface;>;
7 12 4 iface Ljava/net/NetworkInterface;
8 12 5 addrs Ljava/util/Enumeration<Ljava/net/InetAddress;>;
10 12 6 a Ljava/net/InetAddress;
15 16 3 e Ljava/net/SocketException;
18 43 3 entry Ljava/util/Map$Entry<Ljava/net/NetworkInterface;Ljava/net/InetAddress;>;
19 43 5 iface Ljava/net/NetworkInterface;
20 43 6 inetAddr Ljava/net/InetAddress;
23 24 7 macAddr [B
27 43 7 macAddr [B
25 27 8 e Ljava/net/SocketException;
28 43 8 replace Z
29 43 9 res I
48 54 3 newAddr [B
Exception table:
from to target type
3 13 14 Class java.net.SocketException
22 23 24 Class java.net.SocketException
public static byte[] defaultMachineId();
descriptor: ()[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=0
0: invokestatic io.netty.util.internal.MacAddressUtil.bestAvailableMac:()[B
astore 0
start local 0 1: aload 0
ifnonnull 8
2: bipush 8
newarray 8
astore 0
3: invokestatic io.netty.util.internal.PlatformDependent.threadLocalRandom:()Ljava/util/Random;
aload 0
invokevirtual java.util.Random.nextBytes:([B)V
4: getstatic io.netty.util.internal.MacAddressUtil.logger:Lio/netty/util/internal/logging/InternalLogger;
5: ldc "Failed to find a usable hardware address from the network interfaces; using random bytes: {}"
6: aload 0
invokestatic io.netty.util.internal.MacAddressUtil.formatAddress:([B)Ljava/lang/String;
7: invokeinterface io.netty.util.internal.logging.InternalLogger.warn:(Ljava/lang/String;Ljava/lang/Object;)V
8: StackMap locals: byte[]
StackMap stack:
aload 0
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
1 9 0 bestMacAddr [B
public static byte[] parseMAC(java.lang.String);
descriptor: (Ljava/lang/String;)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=7, args_size=1
start local 0 0: aload 0
invokevirtual java.lang.String.length:()I
lookupswitch { // 2
17: 1
23: 5
default: 9
}
1: StackMap locals:
StackMap stack:
aload 0
iconst_2
invokevirtual java.lang.String.charAt:(I)C
istore 2
start local 2 2: iload 2
invokestatic io.netty.util.internal.MacAddressUtil.validateMacSeparator:(C)V
3: bipush 6
newarray 8
astore 1
start local 1 4: goto 10
end local 2 end local 1 5: StackMap locals:
StackMap stack:
aload 0
iconst_2
invokevirtual java.lang.String.charAt:(I)C
istore 2
start local 2 6: iload 2
invokestatic io.netty.util.internal.MacAddressUtil.validateMacSeparator:(C)V
7: bipush 8
newarray 8
astore 1
start local 1 8: goto 10
end local 2 end local 1 9: StackMap locals:
StackMap stack:
new java.lang.IllegalArgumentException
dup
ldc "value is not supported [MAC-48, EUI-48, EUI-64]"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
start local 1 start local 2 10: StackMap locals: byte[] int
StackMap stack:
aload 1
arraylength
iconst_1
isub
istore 3
start local 3 11: iconst_0
istore 4
start local 4 12: iconst_0
istore 5
start local 5 13: goto 21
14: StackMap locals: int int int
StackMap stack:
iload 4
iconst_2
iadd
istore 6
start local 6 15: aload 1
iload 5
aload 0
iload 4
invokestatic io.netty.util.internal.StringUtil.decodeHexByte:(Ljava/lang/CharSequence;I)B
bastore
16: aload 0
iload 6
invokevirtual java.lang.String.charAt:(I)C
iload 2
if_icmpeq 20
17: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "expected separator '"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 2
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
ldc " but got '"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
18: aload 0
iload 6
invokevirtual java.lang.String.charAt:(I)C
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
ldc "' at index: "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
iload 6
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
19: invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
end local 6 20: StackMap locals:
StackMap stack:
iinc 5 1
iinc 4 3
StackMap locals:
StackMap stack:
21: iload 5
iload 3
if_icmplt 14
end local 5 22: aload 1
iload 3
aload 0
iload 4
invokestatic io.netty.util.internal.StringUtil.decodeHexByte:(Ljava/lang/CharSequence;I)B
bastore
23: aload 1
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 24 0 value Ljava/lang/String;
4 5 1 machineId [B
8 9 1 machineId [B
10 24 1 machineId [B
2 5 2 separator C
6 9 2 separator C
10 24 2 separator C
11 24 3 end I
12 24 4 j I
13 22 5 i I
15 20 6 sIndex I
MethodParameters:
Name Flags
value
private static void validateMacSeparator(char);
descriptor: (C)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=5, locals=1, args_size=1
start local 0 0: iload 0
bipush 58
if_icmpeq 2
iload 0
bipush 45
if_icmpeq 2
1: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "unsupported separator: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 0
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
ldc " (expected: [:-])"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 separator C
MethodParameters:
Name Flags
separator
public static java.lang.String formatAddress(byte[]);
descriptor: ([B)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=7, locals=6, args_size=1
start local 0 0: new java.lang.StringBuilder
dup
bipush 24
invokespecial java.lang.StringBuilder.<init>:(I)V
astore 1
start local 1 1: aload 0
dup
astore 5
arraylength
istore 4
iconst_0
istore 3
goto 5
StackMap locals: byte[] java.lang.StringBuilder top int int byte[]
StackMap stack:
2: aload 5
iload 3
baload
istore 2
start local 2 3: aload 1
ldc "%02x:"
iconst_1
anewarray java.lang.Object
dup
iconst_0
iload 2
sipush 255
iand
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
pop
end local 2 4: iinc 3 1
StackMap locals:
StackMap stack:
5: iload 3
iload 4
if_icmplt 2
6: aload 1
iconst_0
aload 1
invokevirtual java.lang.StringBuilder.length:()I
iconst_1
isub
invokevirtual java.lang.StringBuilder.substring:(II)Ljava/lang/String;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 addr [B
1 7 1 buf Ljava/lang/StringBuilder;
3 4 2 b B
MethodParameters:
Name Flags
addr
static int compareAddresses(byte[], byte[]);
descriptor: ([B[B)I
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=7, args_size=2
start local 0 start local 1 0: aload 1
ifnull 1
aload 1
arraylength
bipush 6
if_icmpge 2
1: StackMap locals:
StackMap stack:
iconst_1
ireturn
2: StackMap locals:
StackMap stack:
iconst_1
istore 2
start local 2 3: aload 1
dup
astore 6
arraylength
istore 5
iconst_0
istore 4
goto 9
StackMap locals: byte[] byte[] int top int int byte[]
StackMap stack:
4: aload 6
iload 4
baload
istore 3
start local 3 5: iload 3
ifeq 8
iload 3
iconst_1
if_icmpeq 8
6: iconst_0
istore 2
7: goto 10
end local 3 8: StackMap locals:
StackMap stack:
iinc 4 1
StackMap locals:
StackMap stack:
9: iload 4
iload 5
if_icmplt 4
10: StackMap locals: byte[] byte[] int
StackMap stack:
iload 2
ifeq 12
11: iconst_1
ireturn
12: StackMap locals:
StackMap stack:
aload 1
iconst_0
baload
iconst_1
iand
ifeq 14
13: iconst_1
ireturn
14: StackMap locals:
StackMap stack:
aload 1
iconst_0
baload
iconst_2
iand
ifne 18
15: aload 0
arraylength
ifeq 17
aload 0
iconst_0
baload
iconst_2
iand
ifne 17
16: iconst_0
ireturn
17: StackMap locals:
StackMap stack:
iconst_m1
ireturn
18: StackMap locals:
StackMap stack:
aload 0
arraylength
ifeq 20
aload 0
iconst_0
baload
iconst_2
iand
ifne 20
19: iconst_1
ireturn
20: StackMap locals:
StackMap stack:
iconst_0
ireturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 21 0 current [B
0 21 1 candidate [B
3 21 2 onlyZeroAndOne Z
5 8 3 b B
MethodParameters:
Name Flags
current
candidate
private static int compareAddresses(java.net.InetAddress, java.net.InetAddress);
descriptor: (Ljava/net/InetAddress;Ljava/net/InetAddress;)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokestatic io.netty.util.internal.MacAddressUtil.scoreAddress:(Ljava/net/InetAddress;)I
aload 1
invokestatic io.netty.util.internal.MacAddressUtil.scoreAddress:(Ljava/net/InetAddress;)I
isub
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 current Ljava/net/InetAddress;
0 1 1 candidate Ljava/net/InetAddress;
MethodParameters:
Name Flags
current
candidate
private static int scoreAddress(java.net.InetAddress);
descriptor: (Ljava/net/InetAddress;)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokevirtual java.net.InetAddress.isAnyLocalAddress:()Z
ifne 1
aload 0
invokevirtual java.net.InetAddress.isLoopbackAddress:()Z
ifeq 2
1: StackMap locals:
StackMap stack:
iconst_0
ireturn
2: StackMap locals:
StackMap stack:
aload 0
invokevirtual java.net.InetAddress.isMulticastAddress:()Z
ifeq 4
3: iconst_1
ireturn
4: StackMap locals:
StackMap stack:
aload 0
invokevirtual java.net.InetAddress.isLinkLocalAddress:()Z
ifeq 6
5: iconst_2
ireturn
6: StackMap locals:
StackMap stack:
aload 0
invokevirtual java.net.InetAddress.isSiteLocalAddress:()Z
ifeq 8
7: iconst_3
ireturn
8: StackMap locals:
StackMap stack:
iconst_4
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 addr Ljava/net/InetAddress;
MethodParameters:
Name Flags
addr
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lio/netty/util/internal/MacAddressUtil;
}
SourceFile: "MacAddressUtil.java"
InnerClasses:
public abstract Entry = java.util.Map$Entry of java.util.Map