@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, false); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@Override public boolean isMCGlobal() { // Check if we have a prefix of 1110 if (!isMulticastAddress()) { return false; } int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN); /* * Now check the boundaries of the global space if we have an address * that is prefixed by something less than 111000000000000000000001 * (fortunately we don't have to worry about sign after shifting 8 bits * right) it is not multicast. ( < 224.0.1.0) */ if (address >>> 8 < 0xE00001) { return false; } /* * Now check the high boundary which is prefixed by 11101110 = 0xEE. If * the value is higher than this than it is not MCGlobal ( > * 238.255.255.255 ) */ if (address >>> 24 > 0xEE) { return false; } return true; }
@JRubyMethod(name = "ipv4_multicast?") public IRubyObject ipv4_multicast_p(ThreadContext context) { if (getAddressFamily() == AF_INET) { return context.runtime.newBoolean(getInet4Address().isMulticastAddress()); } return context.fals; }
@JRubyMethod(name = "ipv4_multicast?") public IRubyObject ipv4_multicast_p(ThreadContext context) { if (getAddressFamily() == AF_INET) { return context.runtime.newBoolean(getInet4Address().isMulticastAddress()); } return context.fals; }