final byte[] networkAddressBytes = networkAddress.getAddress(); if (address instanceof Inet4Address && networkAddress instanceof Inet4Address) { final int maskBits = nwsl(0xFFFFFFFF, 32 - networkMask); final int addr = getInt(addressBytes, 0) & maskBits; final int netAddr = getInt(networkAddressBytes, 0) & maskBits; return addr == netAddr; } else if (address instanceof Inet6Address && networkAddress instanceof Inet6Address) { final long maskHigh = nwsl(0xFFFFFFFFFFFFFFFFL, 64 - networkMask); final long maskLow = nwsl(0xFFFFFFFFFFFFFFFFL, 128 - networkMask); final long addrHigh = getLong(addressBytes, 0) & maskHigh; final long addrLow = getLong(addressBytes, 8) & maskLow; final long netAddrHigh = getLong(networkAddressBytes, 0) & maskHigh; final long netAddrLow = getLong(networkAddressBytes, 8) & maskLow; return addrHigh == netAddrHigh && addrLow == netAddrLow; } else {
static URI getUri(final JBossEJBProperties.ConnectionConfiguration connectionConfiguration, final OptionMap connectionOptions) { final String host = connectionConfiguration.getHost(); if (host == null) { return null; } final int port = connectionConfiguration.getPort(); if (port == -1) { return null; } final String scheme; final String protocol = connectionConfiguration.getProtocol(); if (protocol == null) { if (connectionOptions.get(Options.SECURE, false) && connectionOptions.get(Options.SSL_ENABLED, false)) { scheme = "remote+https"; } else { scheme = "remote+http"; } } else { scheme = protocol; } try { return new URI(scheme, null, NetworkUtil.formatPossibleIpv6Address(host), port, null, null, null); } catch (URISyntaxException e) { return null; } } }
static URI getUri(final JBossEJBProperties.ConnectionConfiguration connectionConfiguration, final OptionMap connectionOptions) { final String host = connectionConfiguration.getHost(); if (host == null) { return null; } final int port = connectionConfiguration.getPort(); if (port == -1) { return null; } final String scheme; final String protocol = connectionConfiguration.getProtocol(); if (protocol == null) { if (connectionOptions.get(Options.SECURE, false) && connectionOptions.get(Options.SSL_ENABLED, false)) { scheme = "remote+https"; } else { scheme = "remote+http"; } } else { scheme = protocol; } try { return new URI(scheme, null, NetworkUtil.formatPossibleIpv6Address(host), port, null, null, null); } catch (URISyntaxException e) { return null; } } }
final byte[] networkAddressBytes = networkAddress.getAddress(); if (address instanceof Inet4Address && networkAddress instanceof Inet4Address) { final int maskBits = nwsl(0xFFFFFFFF, 32 - networkMask); final int addr = getInt(addressBytes, 0) & maskBits; final int netAddr = getInt(networkAddressBytes, 0) & maskBits; return addr == netAddr; } else if (address instanceof Inet6Address && networkAddress instanceof Inet6Address) { final long maskHigh = nwsl(0xFFFFFFFFFFFFFFFFL, 64 - networkMask); final long maskLow = nwsl(0xFFFFFFFFFFFFFFFFL, 128 - networkMask); final long addrHigh = getLong(addressBytes, 0) & maskHigh; final long addrLow = getLong(addressBytes, 8) & maskLow; final long netAddrHigh = getLong(networkAddressBytes, 0) & maskHigh; final long netAddrLow = getLong(networkAddressBytes, 8) & maskLow; return addrHigh == netAddrHigh && addrLow == netAddrLow; } else {
static URI getUri(final JBossEJBProperties.ConnectionConfiguration connectionConfiguration, final OptionMap connectionOptions) { final String host = connectionConfiguration.getHost(); if (host == null) { return null; } final int port = connectionConfiguration.getPort(); if (port == -1) { return null; } final String scheme; final String protocol = connectionConfiguration.getProtocol(); if (protocol == null) { if (connectionOptions.get(Options.SECURE, false) && connectionOptions.get(Options.SSL_ENABLED, false)) { scheme = "remote+https"; } else { scheme = "remote+http"; } } else { scheme = protocol; } try { return new URI(scheme, null, NetworkUtil.formatPossibleIpv6Address(host), port, null, null, null); } catch (URISyntaxException e) { return null; } } }
final byte[] networkAddressBytes = networkAddress.getAddress(); if (address instanceof Inet4Address && networkAddress instanceof Inet4Address) { final int maskBits = nwsl(0xFFFFFFFF, 32 - networkMask); final int addr = getInt(addressBytes, 0) & maskBits; final int netAddr = getInt(networkAddressBytes, 0) & maskBits; return addr == netAddr; } else if (address instanceof Inet6Address && networkAddress instanceof Inet6Address) { final long maskHigh = nwsl(0xFFFFFFFFFFFFFFFFL, 64 - networkMask); final long maskLow = nwsl(0xFFFFFFFFFFFFFFFFL, 128 - networkMask); final long addrHigh = getLong(addressBytes, 0) & maskHigh; final long addrLow = getLong(addressBytes, 8) & maskLow; final long netAddrHigh = getLong(networkAddressBytes, 0) & maskHigh; final long netAddrLow = getLong(networkAddressBytes, 8) & maskLow; return addrHigh == netAddrHigh && addrLow == netAddrLow; } else {