/*
* 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.
*/
/**
* Represents an SNMP IpAddress.
*
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
// CONSTRUCTORS
//-------------
/**
* Constructs a new <CODE>SnmpIpAddress</CODE> from the specified bytes array.
* @param bytes The four bytes composing the address.
* @exception IllegalArgumentException The length of the array is not equal to four.
*/
}
/**
* Constructs a new <CODE>SnmpIpAddress</CODE> from the specified long value.
* @param addr The initialization value.
*/
byte[] ipaddr = new byte[4];
}
/**
* Constructs a new <CODE>SnmpIpAddress</CODE> from a dot-formatted <CODE>String</CODE>.
* The dot-formatted <CODE>String</CODE> is formulated x.x.x.x .
* @param dotAddress The initialization value.
* @exception IllegalArgumentException The string does not correspond to an ip address.
*/
super(dotAddress) ;
if ((componentCount > 4) ||
throw new IllegalArgumentException(dotAddress) ;
}
}
/**
* Constructs a new <CODE>SnmpIpAddress</CODE> from four long values.
* @param b1 Byte 1.
* @param b2 Byte 2.
* @param b3 Byte 3.
* @param b4 Byte 4.
* @exception IllegalArgumentException A value is outside of [0-255].
*/
throw new IllegalArgumentException() ;
}
}
// PUBLIC METHODS
//---------------
/**
* Converts the address value to its byte array form.
* @return The byte array representation of the value.
*/
public byte[] byteValue() {
byte[] result = new byte[4] ;
return result ;
}
/**
* Converts the address to its <CODE>String</CODE> form.
* Same as <CODE>toString()</CODE>. Exists only to follow a naming scheme.
* @return The <CODE>String</CODE> representation of the value.
*/
return toString() ;
}
/**
* Extracts the ip address from an index OID and returns its
* value converted as an <CODE>SnmpOid</CODE>.
* @param index The index array.
* @param start The position in the index array.
* @return The OID representing the ip address value.
* @exception SnmpStatusException There is no ip address value
* available at the start position.
*/
try {
return new SnmpOid(
}
catch(IllegalArgumentException e) {
}
}
else {
}
}
/**
* Scans an index OID, skips the address value and returns the position
* of the next value.
* @param index The index array.
* @param start The position in the index array.
* @return The position of the next value.
* @exception SnmpStatusException There is no address value
* available at the start position.
*/
return start + 4 ;
}
else {
}
}
/**
* Appends an <CODE>SnmpOid</CODE> representing an <CODE>SnmpIpAddress</CODE> to another OID.
* @param source An OID representing an <CODE>SnmpIpAddress</CODE> value.
* @param dest Where source should be appended.
*/
throw new IllegalArgumentException() ;
}
}
/**
* Returns a textual description of the type object.
* @return ASN.1 textual description.
*/
return name ;
}
// PRIVATE METHODS
//----------------
/**
* Build Ip address from byte array.
*/
throw new IllegalArgumentException() ;
}
components = new long[4] ;
componentCount= 4;
}
// VARIABLES
//----------
/**
* Name of the type.
*/
}