com.groupbyinc.flux.common.netty.util.NetUtil.class Maven / Gradle / Ivy
???? 27 -com/groupbyinc/flux/common/netty/util/NetUtil java/lang/Object NetUtil.java /com/groupbyinc/flux/common/netty/util/NetUtil$1
LOCALHOST4 Ljava/net/Inet4Address;
LOCALHOST6 Ljava/net/Inet6Address; LOCALHOST Ljava/net/InetAddress; LOOPBACK_IF Ljava/net/NetworkInterface; SOMAXCONN I IPV6_WORD_COUNT IPV6_MAX_CHAR_COUNT ' IPV6_BYTE_COUNT IPV6_MAX_CHAR_BETWEEN_SEPARATOR IPV6_MIN_SEPARATORS IPV6_MAX_SEPARATORS IPV4_MAX_CHAR_BETWEEN_SEPARATOR IPV4_SEPARATORS IPV4_PREFERRED Z IPV6_ADDRESSES_PREFERRED logger GLcom/groupbyinc/flux/common/netty/util/internal/logging/InternalLogger; sysctlGetInt '(Ljava/lang/String;)Ljava/lang/Integer; java/io/IOException ' java/lang/ProcessBuilder ) java/lang/String + sysctl - ([Ljava/lang/String;)V / 0
* 1 start ()Ljava/lang/Process; 3 4
* 5 java/lang/Process 7 getInputStream ()Ljava/io/InputStream; 9 :
8 ; java/io/InputStreamReader = (Ljava/io/InputStream;)V / ?
> @ java/io/BufferedReader B (Ljava/io/Reader;)V / D
C E readLine ()Ljava/lang/String; G H
C I
startsWith (Ljava/lang/String;)Z K L
, M length ()I O P
, Q java/io/InputStream S charAt (I)C U V
, W java/lang/Character Y isDigit (C)Z [ \
Z ] substring (II)Ljava/lang/String; _ `
, a java/lang/Integer c valueOf e &
d f close ()V h i
C j destroy l i
8 m java/lang/Throwable o i line Ljava/lang/String; is Ljava/io/InputStream; isr Ljava/io/InputStreamReader; br Ljava/io/BufferedReader; sysctlKey process Ljava/lang/Process; isIpV4StackPreferred ()Z ! isIpV6AddressesPreferred " ! ? "createByteArrayFromIpAddressString (Ljava/lang/String;)[B isValidIpV4Address ? L
? validIpV4ToBytes ? ?
? isValidIpV6Address ? L
? indexOf (I)I ? ?
, ?
getIPv6ByName (Ljava/lang/CharSequence;Z)[B ? ?
?
percentPos ipAddressString decimalDigit (Ljava/lang/String;I)I str pos ipv4WordToByte (Ljava/lang/String;II)B ? ?
? ip from toExclusive ret (II)I ? ?
, ? ? ?
? intToIpAddress (I)Ljava/lang/String; java/lang/StringBuilder ? (I)V / ?
? ? append (I)Ljava/lang/StringBuilder; ? ?
? ? (C)Ljava/lang/StringBuilder; ? ?
? ? toString ? H
? ? buf Ljava/lang/StringBuilder; bytesToIpAddress ([B)Ljava/lang/String; ([BII)Ljava/lang/String; ? ?
? bytes [B toAddressString ([BIZ)Ljava/lang/String; ? ?
? "java/lang/IllegalArgumentException ? / i
? ? length: ? -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? (expected: 4 or 16) ? (Ljava/lang/String;)V / ?
? ? offset isValidHexChar ? \
? isValidIPv4MappedChar ? \
? (Ljava/lang/String;II)Z ? ?
? colons
compressBegin tmpChar C ipv4Start j ipv4End end c wordLen isValidIpV4Word (Ljava/lang/CharSequence;II)Z java/lang/CharSequence ? ? W isValidNumericChar ? \
? c0 c2 c1 word Ljava/lang/CharSequence; len isValidIPv4MappedSeparators (BBZ)Z b0 B b1
mustBeZero isValidIPv4Mapped ([BIII)Z ? ?
@com/groupbyinc/flux/common/netty/util/internal/PlatformDependent isZero ([BII)Z
currentIndex compressLength ? ?
toExcluded getByName 1(Ljava/lang/CharSequence;)Ljava/net/Inet6Address; 2(Ljava/lang/CharSequence;Z)Ljava/net/Inet6Address;
java/net/UnknownHostException ? java/net/Inet6Address getByAddress .(Ljava/lang/String;[BI)Ljava/net/Inet6Address;
java/lang/RuntimeException (Ljava/lang/Throwable;)V /
e Ljava/net/UnknownHostException;
ipv4Mapped ? Q ? ?
$ 9com/groupbyinc/flux/common/netty/util/internal/StringUtil& decodeHexNibble (C)I()
'* tmp ipLength value begin ipv6Separators ipv4Separators
needsShift isCompressed toSocketAddressString 0(Ljava/net/InetSocketAddress;)Ljava/lang/String; java/net/InetSocketAddress6 getPort8 P
79 e ?
,; isUnresolved= ~
7> javaVersion@ P
A
getHostStringC H
7D getHostNameF H
7G newSocketAddressStringBuilder @(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/StringBuilder;IJ
K
getAddress ()Ljava/net/InetAddress;MN
7O *(Ljava/net/InetAddress;)Ljava/lang/String; ?Q
R java/net/Inet4AddressT
hostString sb address addr Ljava/net/InetSocketAddress; port '(Ljava/lang/String;I)Ljava/lang/String; host portStr ipv4 hostLen
stringBuilder +(Ljava/net/InetAddress;Z)Ljava/lang/String; ?b
c java/net/InetAddresse getHostAddressg H
fh Unhandled type: j -(Ljava/lang/Object;)Ljava/lang/StringBuilder; ?l
?m ()[BMo
fp [Ir toHexStringt ?
du inRangeEndExclusive (III)Zwx
y ::{ ??
currentLength isIpv4Mapped words currentStart
shortestStart shortestLength shortestEnd b
? this /Lcom/groupbyinc/flux/common/netty/util/NetUtil;
access$000 I()Lcom/groupbyinc/flux/common/netty/util/internal/logging/InternalLogger; # $ ?
access$100 % &
? x0 java/lang/Exception? java/net/SocketException? java.net.preferIPv4Stack? Acom/groupbyinc/flux/common/netty/util/internal/SystemPropertyUtil?
getBoolean (Ljava/lang/String;Z)Z??
?? java.net.preferIPv6Addresses? Lcom/groupbyinc/flux/common/netty/util/internal/logging/InternalLoggerFactory? getInstance Z(Ljava/lang/Class;)Lcom/groupbyinc/flux/common/netty/util/internal/logging/InternalLogger;??
?? -Djava.net.preferIPv4Stack: {}? java/lang/Boolean? (Z)Ljava/lang/Boolean; e?
?? Ecom/groupbyinc/flux/common/netty/util/internal/logging/InternalLogger? debug '(Ljava/lang/String;Ljava/lang/Object;)V???? "-Djava.net.preferIPv6Addresses: {}? localhost? ,(Ljava/lang/String;[B)Ljava/net/InetAddress;?
f? throwException?
? ?
? java/util/ArrayList?
? ? java/net/NetworkInterface? getNetworkInterfaces ()Ljava/util/Enumeration;??
?? java/util/List? java/util/Enumeration? hasMoreElements? ~?? nextElement ()Ljava/lang/Object;???? :com/groupbyinc/flux/common/netty/util/internal/SocketUtils? addressesFromNetworkInterface 4(Ljava/net/NetworkInterface;)Ljava/util/Enumeration;??
?? add (Ljava/lang/Object;)Z???? ;Failed to retrieve the list of available network interfaces? warn *(Ljava/lang/String;Ljava/lang/Throwable;)V???? iterator ()Ljava/util/Iterator;???? java/util/Iterator? hasNext? ~?? next???? isLoopbackAddress? ~
f?
isLoopback? ~
?? %Failed to find the loopback interface?? ??? Loopback interface: {} ({}, {})? getName? H
?? getDisplayName H
? ((Ljava/lang/String;[Ljava/lang/Object;)V?? getByInetAddress 3(Ljava/net/InetAddress;)Ljava/net/NetworkInterface;
? +Using hard-coded IPv6 localhost address: {}
+Using hard-coded IPv4 localhost address: {}
? java/security/AccessController doPrivileged 4(Ljava/security/PrivilegedAction;)Ljava/lang/Object;
intValue P
d Ljava/lang/Exception; iface
interfaces 4Ljava/util/Enumeration; Ljava/util/Enumeration; Ljava/net/SocketException; /Ljava/util/Enumeration; LOCALHOST4_BYTES LOCALHOST6_BYTES
localhost4
localhost6 ifaces -Ljava/util/List; Ljava/util/List;
loopbackIface loopbackAddr
ConstantValue Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions LocalVariableTypeTable
SourceFile InnerClasses 1
. . . . . . . . ! " ! # $ !
% &