/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* (C) Copyright IBM Corp. 1999 All Rights Reserved.
* Copyright 1997 The Open Group Research Institute. All rights reserved.
*/
/**
* Implements the ASN.1 HostAddresses type.
*
* <xmp>
* HostAddresses -- NOTE: subtly different from rfc1510,
* -- but has a value mapping and encodes the same
* ::= SEQUENCE OF HostAddress
*
* HostAddress ::= SEQUENCE {
* addr-type [0] Int32,
* address [1] OCTET STRING
* }
* </xmp>
*
* <p>
* This definition reflects the Network Working Group RFC 4120
* specification available at
* <a href="http://www.ietf.org/rfc/rfc4120.txt">
*/
if (new_addresses != null) {
if (new_addresses[i] == null) {
throw new IOException("Cannot create a HostAddress");
} else {
}
}
}
}
}
throws UnknownHostException, KrbException {
}
}
}
}
return new_hostAddresses;
}
return true;
}
return false;
}
public int hashCode() {
if (hashCode == 0) {
int result = 17;
}
}
}
return hashCode;
}
if (this == obj) {
return true;
}
if (!(obj instanceof HostAddresses)) {
return false;
}
return false;
return false;
return false;
}
return true;
}
/**
* Constructs a new <code>HostAddresses</code> object.
* @param encoding a single DER-encoded value.
* @exception Asn1Exception if an error occurs while decoding an
* ASN1 encoded data.
* @exception IOException if an I/O error occurs while reading
* encoded data.
*/
throws Asn1Exception, IOException {
}
}
}
/**
* Encodes a <code>HostAddresses</code> object.
* @return byte array of encoded <code>HostAddresses</code> object.
* @exception Asn1Exception if an error occurs while decoding an
* ASN1 encoded data.
* @exception IOException if an I/O error occurs while reading
* encoded data.
*/
}
return temp.toByteArray();
}
/**
* Parse (unmarshal) a <code>HostAddresses</code> from a DER input stream.
* This form
* parsing might be used when expanding a value which is part of
* a constructed sequence and uses explicitly tagged type.
*
* @exception Asn1Exception if an Asn1Exception occurs.
* @param data the Der input stream value, which contains one or more
* marshaled value.
* @param explicitTag tag number.
* @param optional indicates if this data field is optional.
* @return an instance of <code>HostAddresses</code>.
*/
byte explicitTag, boolean optional)
throws Asn1Exception, IOException {
if ((optional) &&
return null;
} else {
return new HostAddresses(subDer);
}
}
/**
* Writes data field values in <code>HostAddresses</code> in FCC
* format to a <code>CCacheOutputStream</code>.
*
* @param cos a <code>CCacheOutputStream</code> to be written to.
* @exception IOException if an I/O exception occurs.
* @see sun.security.krb5.internal.ccache.CCacheOutputStream
*/
}
}
return null;
try {
}
// Should not happen since IP address given
return null;
}
}
}
/**
* Returns all the IP addresses of the local host.
*/
{
try {
{
}
if (DEBUG) {
+ hostname + " are: ");
if (inetAddresses[i] instanceof Inet4Address)
if (inetAddresses[i] instanceof Inet6Address)
}
}
return (new HostAddresses(hAddresses));
}
}
/**
* Creates a new HostAddresses instance from the supplied list
* of InetAddresses.
*/
{
if (inetAddresses == null)
{
return;
}
}
}