Lines Matching defs:address

43  * When the subjectAltName extension contains a iPAddress, the address
47 * address. For IP Version 4, as specified in RFC 791, the octet string
56 * address range.[RFC 1519] For IPv6 addresses, the ipAddress field
71 private byte[] address;
88 * @params address the IP address
89 * @throws IOException if address is not a valid IPv4 or IPv6 address
91 public IPAddressName(byte[] address) throws IOException {
93 * A valid address must consist of 4 bytes of address and
94 * optional 4 bytes of 4 bytes of mask, or 16 bytes of address
97 if (address.length == 4 || address.length == 8) {
99 } else if (address.length == 16 || address.length == 32) {
104 this.address = address;
118 * of the address. If /n is used, n is a decimal number indicating how many
119 * of the leftmost contiguous bits of the address comprise the prefix for
124 * address
137 // Parse name into byte-value address components and optional
151 * Parse an IPv4 address.
153 * @param name IPv4 address with optional mask values
158 // Parse name into byte-value address components
161 address = InetAddress.getByName(name).getAddress();
163 address = new byte[8];
169 // parse base address
173 System.arraycopy(host, 0, address, 0, 4);
174 System.arraycopy(mask, 0, address, 4, 4);
179 * Parse an IPv6 address.
181 * @param name String IPv6 address with optional /<prefix length>
182 * If /<prefix length> is present, address[] array will
191 address = InetAddress.getByName(name).getAddress();
193 address = new byte[32];
196 System.arraycopy(base, 0, address, 0, 16);
211 // copy mask bytes into mask portion of address
213 address[MASKSIZE+i] = maskArray[i];
231 out.putOctetString(address);
243 return "IPAddress: " + enc.encodeBuffer(address);
259 //IPv4 address or subdomain
261 System.arraycopy(address, 0, host, 0, 4);
263 if (address.length == 8) {
265 System.arraycopy(address, 4, mask, 0, 4);
270 //IPv6 address or subdomain
272 System.arraycopy(address, 0, host, 0, 16);
274 if (address.length == 32) {
280 maskBytes[i-16] = address[i];
305 return address.clone();
322 if (other.length != address.length)
325 if (address.length == 8 || address.length == 32) {
328 int maskLen = address.length/2;
332 maskedThis[i] = (byte)(address[i] & address[i+maskLen]);
339 for (int i=maskLen; i < address.length; i++)
340 if (address[i] != other[i])
346 return Arrays.equals(other, address);
358 for (int i=0; i<address.length; i++)
359 retval += address[i] * i;
382 * address range.[RFC 1519] For IPv6 addresses, the ipAddress field
404 if (otherAddress.length == 4 && address.length == 4)
407 else if ((otherAddress.length == 8 && address.length == 8) ||
408 (otherAddress.length == 32 && address.length == 32)) {
410 // See if one address fully encloses the other address
415 int maskOffset = address.length/2;
417 if ((byte)(address[i] & address[i+maskOffset]) != address[i])
421 if (!(((byte)(address[i+maskOffset] & otherAddress[i+maskOffset]) == address[i+maskOffset]) &&
422 ((byte)(address[i] & address[i+maskOffset]) == (byte)(otherAddress[i] & address[i+maskOffset])))) {
425 if (!(((byte)(otherAddress[i+maskOffset] & address[i+maskOffset]) == otherAddress[i+maskOffset]) &&
426 ((byte)(otherAddress[i] & otherAddress[i+maskOffset]) == (byte)(address[i] & otherAddress[i+maskOffset])))) {
444 //Other is a subnet, this is a host address
448 // Mask this address by other address mask and compare to other address
449 // If all match, then this address is in other address subnet
450 if ((address[i] & otherAddress[i+maskOffset]) != otherAddress[i])
457 } else if (address.length == 8 || address.length == 32) {
458 //This is a subnet, other is a host address
460 int maskOffset = address.length/2;
462 // Mask other address by this address mask and compare to this address
463 if ((otherAddress[i] & address[i+maskOffset]) != address[i])