/*
* 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.
*/
public class SctpNet {
new GetPropertyAction("os.name"));
// Value of jdk.net.revealLocalAddress
private static boolean revealLocalAddress;
// True if jdk.net.revealLocalAddress had been read
private static volatile boolean propRevealLocalAddr;
/* -- Miscellaneous SCTP utilities -- */
private static boolean IPv4MappedAddresses() {
/* Solaris supports IPv4Mapped Addresses with bindx */
return true;
} /* else { //other OS/implementations */
return false;
}
throw new AlreadyBoundException();
}
}
throws IOException {
}
}
}
/**
* @param oneToOne
* if {@code true} returns a one-to-one sctp socket, otherwise
* returns a one-to-many sctp socket
*/
}
throws IOException {
}
throws IOException {
}
return set;
}
SocketAddress[] saa)
{
}
return set;
}
{
return sa;
if (!propRevealLocalAddr) {
try {
new PrivilegedExceptionAction<String>() {
return System.getProperty(
"jdk.net.revealLocalAddress");
}
}));
} catch (Exception e) {
// revealLocalAddress is false
}
propRevealLocalAddr = true;
}
if (!revealLocalAddress) {
try{
//Security check passed
} catch (SecurityException e) {
//Return loopback address
return new InetSocketAddress(
}
}
// Security check passed or jdk.net.revealLocalAddress set to true
return sa;
}
throws IOException {
}
return set;
}
int assocId)
throws IOException {
throw new IllegalArgumentException("Invalid option value");
throw new IllegalArgumentException("Invalid option value");
throw new IllegalArgumentException("Invalid option value");
} else {
}
} else {
throw new AssertionError("Unknown socket option");
}
}
throws IOException {
throw new IllegalArgumentException(
"SCTP_SET_PEER_PRIMARY_ADDR cannot be retrieved");
int[] values = new int[2];
} else {
throw new AssertionError("Unknown socket option");
}
}
throws IOException {
throw new IllegalArgumentException("Invalid option value");
throw new AssertionError("Should not reach here");
{
if (i < 0)
throw new IllegalArgumentException(
if (i < 0)
if (i > 65535)
if (i < 0 || i > 2)
throw new IllegalArgumentException(
"Invalid value for SCTP_FRAGMENT_INTERLEAVE");
}
int arg;
} else {
}
}
throws IOException {
throw new AssertionError("Should not reach here");
if (!(name instanceof SctpStdSocketOption))
throw new AssertionError("Should not reach here");
} else {
}
}
throws IOException {
}
}
/* Native Methods */
throws IOException;
throws IOException;
throws IOException;
int port) throws IOException;
throws IOException;
/* retVals [0] maxInStreams, [1] maxOutStreams */
throws IOException;
static native void init();
static {
init();
}
}