提交 60f91269 编写于 作者: C chegar

7041778: Move SCTP implementation out of sun.nio.ch and into its own package

Reviewed-by: alanb
上级 0aac167d
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
FILES_export = \ FILES_export = \
sun/nio/ch/SctpAssocChange.java \ sun/nio/ch/sctp/AssociationChange.java \
sun/nio/ch/SctpChannelImpl.java \ sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/SctpNet.java \ sun/nio/ch/sctp/SctpNet.java \
sun/nio/ch/SctpPeerAddrChange.java \ sun/nio/ch/sctp/PeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \ sun/nio/ch/sctp/ResultContainer.java \
sun/nio/ch/SctpServerChannelImpl.java \ sun/nio/ch/sctp/SctpServerChannelImpl.java \
sun/nio/ch/SctpStdSocketOption.java sun/nio/ch/sctp/SctpStdSocketOption.java
endif endif
...@@ -42,25 +42,25 @@ FILES_java = \ ...@@ -42,25 +42,25 @@ FILES_java = \
com/sun/nio/sctp/SendFailedNotification.java \ com/sun/nio/sctp/SendFailedNotification.java \
com/sun/nio/sctp/ShutdownNotification.java \ com/sun/nio/sctp/ShutdownNotification.java \
\ \
sun/nio/ch/SctpMessageInfoImpl.java \ sun/nio/ch/sctp/MessageInfoImpl.java \
sun/nio/ch/SctpStdSocketOption.java sun/nio/ch/sctp/SctpStdSocketOption.java
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
FILES_java += \ FILES_java += \
sun/nio/ch/SctpAssocChange.java \ sun/nio/ch/sctp/AssociationChange.java \
sun/nio/ch/SctpAssociationImpl.java \ sun/nio/ch/sctp/AssociationImpl.java \
sun/nio/ch/SctpChannelImpl.java \ sun/nio/ch/sctp/PeerAddrChange.java \
sun/nio/ch/SctpMultiChannelImpl.java \ sun/nio/ch/sctp/ResultContainer.java \
sun/nio/ch/SctpNet.java \ sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/SctpNotification.java \ sun/nio/ch/sctp/SctpMultiChannelImpl.java \
sun/nio/ch/SctpPeerAddrChange.java \ sun/nio/ch/sctp/SctpNet.java \
sun/nio/ch/SctpResultContainer.java \ sun/nio/ch/sctp/SctpNotification.java \
sun/nio/ch/SctpSendFailed.java \ sun/nio/ch/sctp/SctpServerChannelImpl.java \
sun/nio/ch/SctpServerChannelImpl.java \ sun/nio/ch/sctp/SendFailed.java \
sun/nio/ch/SctpShutdown.java sun/nio/ch/sctp/Shutdown.java
else else
FILES_java += \ FILES_java += \
sun/nio/ch/SctpChannelImpl.java \ sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \ sun/nio/ch/sctp/SctpMultiChannelImpl.java \
sun/nio/ch/SctpServerChannelImpl.java sun/nio/ch/sctp/SctpServerChannelImpl.java
endif endif
...@@ -47,14 +47,16 @@ include $(BUILDDIR)/common/Library.gmk ...@@ -47,14 +47,16 @@ include $(BUILDDIR)/common/Library.gmk
# #
# Find platform-specific C source files # Find platform-specific C source files
# #
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch/sctp
# #
# Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc # Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc
# #
OTHER_INCLUDES += \ OTHER_INCLUDES += \
-I$(SHARE_SRC)/native/sun/nio/ch \ -I$(SHARE_SRC)/native/sun/nio/ch \
-I$(SHARE_SRC)/native/sun/nio/ch/sctp \
-I$(SHARE_SRC)/native/java/net \ -I$(SHARE_SRC)/native/java/net \
-I$(PLATFORM_SRC)/native/sun/nio/ch \
-I$(PLATFORM_SRC)/native/java/net \ -I$(PLATFORM_SRC)/native/java/net \
-I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders -I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders
...@@ -75,5 +77,5 @@ endif # ifneq windows ...@@ -75,5 +77,5 @@ endif # ifneq windows
clean clobber:: clean clobber::
$(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp $(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp
$(RM) -r $(CLASSDESTDIR)/sun/nio/ch $(RM) -r $(CLASSDESTDIR)/sun/nio/ch/sctp
...@@ -25,30 +25,30 @@ ...@@ -25,30 +25,30 @@
SUNWprivate_1.1 { SUNWprivate_1.1 {
global: global:
Java_sun_nio_ch_SctpNet_init; Java_sun_nio_ch_sctp_SctpNet_init;
Java_sun_nio_ch_SctpNet_socket0; Java_sun_nio_ch_sctp_SctpNet_socket0;
Java_sun_nio_ch_SctpNet_bindx; Java_sun_nio_ch_sctp_SctpNet_bindx;
Java_sun_nio_ch_SctpNet_branch0; Java_sun_nio_ch_sctp_SctpNet_branch0;
Java_sun_nio_ch_SctpNet_listen0; Java_sun_nio_ch_sctp_SctpNet_listen0;
Java_sun_nio_ch_SctpNet_connect0; Java_sun_nio_ch_sctp_SctpNet_connect0;
Java_sun_nio_ch_SctpNet_close0; Java_sun_nio_ch_sctp_SctpNet_close0;
Java_sun_nio_ch_SctpNet_preClose0; Java_sun_nio_ch_sctp_SctpNet_preClose0;
Java_sun_nio_ch_SctpNet_getLocalAddresses0; Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_SctpNet_getRemoteAddresses0; Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_SctpNet_getPrimAddrOption0; Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPrimAddrOption0; Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0; Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0;
Java_sun_nio_ch_SctpNet_getInitMsgOption0; Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0;
Java_sun_nio_ch_SctpNet_setInitMsgOption0; Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0;
Java_sun_nio_ch_SctpNet_getIntOption0; Java_sun_nio_ch_sctp_SctpNet_getIntOption0;
Java_sun_nio_ch_SctpNet_setIntOption0; Java_sun_nio_ch_sctp_SctpNet_setIntOption0;
Java_sun_nio_ch_SctpNet_shutdown0; Java_sun_nio_ch_sctp_SctpNet_shutdown0;
Java_sun_nio_ch_SctpChannelImpl_initIDs; Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs;
Java_sun_nio_ch_SctpChannelImpl_checkConnect; Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect;
Java_sun_nio_ch_SctpChannelImpl_receive0; Java_sun_nio_ch_sctp_SctpChannelImpl_receive0;
Java_sun_nio_ch_SctpChannelImpl_send0; Java_sun_nio_ch_sctp_SctpChannelImpl_send0;
Java_sun_nio_ch_SctpServerChannelImpl_initIDs; Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs;
Java_sun_nio_ch_SctpServerChannelImpl_accept0; Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0;
JNI_OnLoad; JNI_OnLoad;
local: local:
*; *;
......
...@@ -94,7 +94,7 @@ public abstract class MessageInfo { ...@@ -94,7 +94,7 @@ public abstract class MessageInfo {
if (streamNumber < 0 || streamNumber > 65536) if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number"); throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(null, address, streamNumber); return new sun.nio.ch.sctp.MessageInfoImpl(null, address, streamNumber);
} }
/** /**
* Creates a {@code MessageInfo} instance suitable for use when * Creates a {@code MessageInfo} instance suitable for use when
...@@ -133,8 +133,8 @@ public abstract class MessageInfo { ...@@ -133,8 +133,8 @@ public abstract class MessageInfo {
if (streamNumber < 0 || streamNumber > 65536) if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number"); throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(association, address, return new sun.nio.ch.sctp.MessageInfoImpl(association,
streamNumber); address, streamNumber);
} }
/** /**
......
...@@ -162,7 +162,7 @@ public abstract class SctpChannel ...@@ -162,7 +162,7 @@ public abstract class SctpChannel
*/ */
public static SctpChannel open() throws public static SctpChannel open() throws
IOException { IOException {
return new sun.nio.ch.SctpChannelImpl((SelectorProvider)null); return new sun.nio.ch.sctp.SctpChannelImpl((SelectorProvider)null);
} }
/** /**
......
...@@ -162,7 +162,7 @@ public abstract class SctpMultiChannel ...@@ -162,7 +162,7 @@ public abstract class SctpMultiChannel
*/ */
public static SctpMultiChannel open() throws public static SctpMultiChannel open() throws
IOException { IOException {
return new sun.nio.ch.SctpMultiChannelImpl((SelectorProvider)null); return new sun.nio.ch.sctp.SctpMultiChannelImpl((SelectorProvider)null);
} }
/** /**
......
...@@ -98,7 +98,7 @@ public abstract class SctpServerChannel ...@@ -98,7 +98,7 @@ public abstract class SctpServerChannel
*/ */
public static SctpServerChannel open() throws public static SctpServerChannel open() throws
IOException { IOException {
return new sun.nio.ch.SctpServerChannelImpl((SelectorProvider)null); return new sun.nio.ch.sctp.SctpServerChannelImpl((SelectorProvider)null);
} }
/** /**
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
package com.sun.nio.sctp; package com.sun.nio.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import sun.nio.ch.SctpStdSocketOption; import sun.nio.ch.sctp.SctpStdSocketOption;
/** /**
* SCTP channels supports the socket options defined by this class * SCTP channels supports the socket options defined by this class
...@@ -50,7 +50,7 @@ public class SctpStandardSocketOptions { ...@@ -50,7 +50,7 @@ public class SctpStandardSocketOptions {
*/ */
public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = new public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = new
SctpStdSocketOption<Boolean>("SCTP_DISABLE_FRAGMENTS", Boolean.class, SctpStdSocketOption<Boolean>("SCTP_DISABLE_FRAGMENTS", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS); sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
/** /**
* Enables or disables explicit message completion. * Enables or disables explicit message completion.
...@@ -69,7 +69,7 @@ public class SctpStandardSocketOptions { ...@@ -69,7 +69,7 @@ public class SctpStandardSocketOptions {
*/ */
public static final SctpSocketOption<Boolean> SCTP_EXPLICIT_COMPLETE = new public static final SctpSocketOption<Boolean> SCTP_EXPLICIT_COMPLETE = new
SctpStdSocketOption<Boolean>("SCTP_EXPLICIT_COMPLETE", Boolean.class, SctpStdSocketOption<Boolean>("SCTP_EXPLICIT_COMPLETE", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE); sun.nio.ch.sctp.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE);
/** /**
* Fragmented interleave controls how the presentation of messages occur * Fragmented interleave controls how the presentation of messages occur
...@@ -120,7 +120,7 @@ public class SctpStandardSocketOptions { ...@@ -120,7 +120,7 @@ public class SctpStandardSocketOptions {
public static final SctpSocketOption<Integer> SCTP_FRAGMENT_INTERLEAVE = public static final SctpSocketOption<Integer> SCTP_FRAGMENT_INTERLEAVE =
new SctpStdSocketOption<Integer>("SCTP_FRAGMENT_INTERLEAVE", new SctpStdSocketOption<Integer>("SCTP_FRAGMENT_INTERLEAVE",
Integer.class, Integer.class,
sun.nio.ch.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE); sun.nio.ch.sctp.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE);
/** /**
* The maximum number of streams requested by the local endpoint during * The maximum number of streams requested by the local endpoint during
...@@ -171,7 +171,7 @@ public class SctpStandardSocketOptions { ...@@ -171,7 +171,7 @@ public class SctpStandardSocketOptions {
*/ */
public static final SctpSocketOption<Boolean> SCTP_NODELAY = public static final SctpSocketOption<Boolean> SCTP_NODELAY =
new SctpStdSocketOption<Boolean>("SCTP_NODELAY", Boolean.class, new SctpStdSocketOption<Boolean>("SCTP_NODELAY", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_NODELAY); sun.nio.ch.sctp.SctpStdSocketOption.SCTP_NODELAY);
/** /**
* Requests that the local SCTP stack use the given peer address as * Requests that the local SCTP stack use the given peer address as
...@@ -246,7 +246,7 @@ public class SctpStandardSocketOptions { ...@@ -246,7 +246,7 @@ public class SctpStandardSocketOptions {
*/ */
public static final SctpSocketOption<Integer> SO_SNDBUF = public static final SctpSocketOption<Integer> SO_SNDBUF =
new SctpStdSocketOption<Integer>("SO_SNDBUF", Integer.class, new SctpStdSocketOption<Integer>("SO_SNDBUF", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_SNDBUF); sun.nio.ch.sctp.SctpStdSocketOption.SO_SNDBUF);
/** /**
* The size of the socket receive buffer. * The size of the socket receive buffer.
...@@ -273,7 +273,7 @@ public class SctpStandardSocketOptions { ...@@ -273,7 +273,7 @@ public class SctpStandardSocketOptions {
*/ */
public static final SctpSocketOption<Integer> SO_RCVBUF = public static final SctpSocketOption<Integer> SO_RCVBUF =
new SctpStdSocketOption<Integer>("SO_RCVBUF", Integer.class, new SctpStdSocketOption<Integer>("SO_RCVBUF", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_RCVBUF); sun.nio.ch.sctp.SctpStdSocketOption.SO_RCVBUF);
/** /**
* Linger on close if data is present. * Linger on close if data is present.
...@@ -304,7 +304,7 @@ public class SctpStandardSocketOptions { ...@@ -304,7 +304,7 @@ public class SctpStandardSocketOptions {
*/ */
public static final SctpSocketOption<Integer> SO_LINGER = public static final SctpSocketOption<Integer> SO_LINGER =
new SctpStdSocketOption<Integer>("SO_LINGER", Integer.class, new SctpStdSocketOption<Integer>("SO_LINGER", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_LINGER); sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER);
/** /**
* This class is used to set the maximum number of inbound/outbound streams * This class is used to set the maximum number of inbound/outbound streams
......
...@@ -35,15 +35,15 @@ import sun.misc.*; ...@@ -35,15 +35,15 @@ import sun.misc.*;
* @since 1.4 * @since 1.4
*/ */
abstract class AbstractPollArrayWrapper { public abstract class AbstractPollArrayWrapper {
// Event masks // Event masks
static final short POLLIN = 0x0001; public static final short POLLIN = 0x0001;
static final short POLLOUT = 0x0004; public static final short POLLOUT = 0x0004;
static final short POLLERR = 0x0008; public static final short POLLERR = 0x0008;
static final short POLLHUP = 0x0010; public static final short POLLHUP = 0x0010;
static final short POLLNVAL = 0x0020; public static final short POLLNVAL = 0x0020;
static final short POLLREMOVE = 0x0800; public static final short POLLREMOVE = 0x0800;
// Miscellaneous constants // Miscellaneous constants
static final short SIZE_POLLFD = 8; static final short SIZE_POLLFD = 8;
......
...@@ -67,7 +67,7 @@ abstract class AbstractPollSelectorImpl ...@@ -67,7 +67,7 @@ abstract class AbstractPollSelectorImpl
this.channelOffset = offset; this.channelOffset = offset;
} }
void putEventOps(SelectionKeyImpl sk, int ops) { public void putEventOps(SelectionKeyImpl sk, int ops) {
synchronized (closeLock) { synchronized (closeLock) {
if (closed) if (closed)
throw new ClosedSelectorException(); throw new ClosedSelectorException();
......
...@@ -28,16 +28,16 @@ package sun.nio.ch; ...@@ -28,16 +28,16 @@ package sun.nio.ch;
// Constants for reporting I/O status // Constants for reporting I/O status
final class IOStatus { public final class IOStatus {
private IOStatus() { } private IOStatus() { }
static final int EOF = -1; // End of file public static final int EOF = -1; // End of file
static final int UNAVAILABLE = -2; // Nothing available (non-blocking) public static final int UNAVAILABLE = -2; // Nothing available (non-blocking)
static final int INTERRUPTED = -3; // System call interrupted public static final int INTERRUPTED = -3; // System call interrupted
static final int UNSUPPORTED = -4; // Operation not supported public static final int UNSUPPORTED = -4; // Operation not supported
static final int THROWN = -5; // Exception thrown in JNI code public static final int THROWN = -5; // Exception thrown in JNI code
static final int UNSUPPORTED_CASE = -6; // This case not supported public static final int UNSUPPORTED_CASE = -6; // This case not supported
// The following two methods are for use in try/finally blocks where a // The following two methods are for use in try/finally blocks where a
// status value needs to be normalized before being returned to the invoker // status value needs to be normalized before being returned to the invoker
...@@ -55,28 +55,28 @@ final class IOStatus { ...@@ -55,28 +55,28 @@ final class IOStatus {
// } // }
// //
static int normalize(int n) { public static int normalize(int n) {
if (n == UNAVAILABLE) if (n == UNAVAILABLE)
return 0; return 0;
return n; return n;
} }
static boolean check(int n) { public static boolean check(int n) {
return (n >= UNAVAILABLE); return (n >= UNAVAILABLE);
} }
static long normalize(long n) { public static long normalize(long n) {
if (n == UNAVAILABLE) if (n == UNAVAILABLE)
return 0; return 0;
return n; return n;
} }
static boolean check(long n) { public static boolean check(long n) {
return (n >= UNAVAILABLE); return (n >= UNAVAILABLE);
} }
// Return true iff n is not one of the IOStatus values // Return true iff n is not one of the IOStatus values
static boolean checkAll(long n) { public static boolean checkAll(long n) {
return ((n > EOF) || (n < UNSUPPORTED_CASE)); return ((n > EOF) || (n < UNSUPPORTED_CASE));
} }
......
...@@ -34,7 +34,7 @@ import java.nio.ByteBuffer; ...@@ -34,7 +34,7 @@ import java.nio.ByteBuffer;
* File-descriptor based I/O utilities that are shared by NIO classes. * File-descriptor based I/O utilities that are shared by NIO classes.
*/ */
class IOUtil { public class IOUtil {
private IOUtil() { } // No instantiation private IOUtil() { } // No instantiation
...@@ -309,7 +309,7 @@ class IOUtil { ...@@ -309,7 +309,7 @@ class IOUtil {
} }
} }
static FileDescriptor newFD(int i) { public static FileDescriptor newFD(int i) {
FileDescriptor fd = new FileDescriptor(); FileDescriptor fd = new FileDescriptor();
setfdVal(fd, i); setfdVal(fd, i);
return fd; return fd;
...@@ -326,10 +326,11 @@ class IOUtil { ...@@ -326,10 +326,11 @@ class IOUtil {
static native boolean drain(int fd) throws IOException; static native boolean drain(int fd) throws IOException;
static native void configureBlocking(FileDescriptor fd, boolean blocking) public static native void configureBlocking(FileDescriptor fd,
boolean blocking)
throws IOException; throws IOException;
static native int fdVal(FileDescriptor fd); public static native int fdVal(FileDescriptor fd);
static native void setfdVal(FileDescriptor fd, int value); static native void setfdVal(FileDescriptor fd, int value);
......
...@@ -33,7 +33,7 @@ import java.security.AccessController; ...@@ -33,7 +33,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
class Net { // package-private public class Net {
private Net() { } private Net() { }
...@@ -75,7 +75,7 @@ class Net { // package-private ...@@ -75,7 +75,7 @@ class Net { // package-private
return canJoin6WithIPv4Group0(); return canJoin6WithIPv4Group0();
} }
static InetSocketAddress checkAddress(SocketAddress sa) { public static InetSocketAddress checkAddress(SocketAddress sa) {
if (sa == null) if (sa == null)
throw new NullPointerException(); throw new NullPointerException();
if (!(sa instanceof InetSocketAddress)) if (!(sa instanceof InetSocketAddress))
...@@ -330,7 +330,7 @@ class Net { // package-private ...@@ -330,7 +330,7 @@ class Net { // package-private
// Due to oddities SO_REUSEADDR on windows reuse is ignored // Due to oddities SO_REUSEADDR on windows reuse is ignored
private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse); private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse);
static void bind(FileDescriptor fd, InetAddress addr, int port) public static void bind(FileDescriptor fd, InetAddress addr, int port)
throws IOException throws IOException
{ {
bind(UNSPEC, fd, addr, port); bind(UNSPEC, fd, addr, port);
...@@ -383,7 +383,7 @@ class Net { // package-private ...@@ -383,7 +383,7 @@ class Net { // package-private
private static native InetAddress localInetAddress(FileDescriptor fd) private static native InetAddress localInetAddress(FileDescriptor fd)
throws IOException; throws IOException;
static InetSocketAddress localAddress(FileDescriptor fd) public static InetSocketAddress localAddress(FileDescriptor fd)
throws IOException throws IOException
{ {
return new InetSocketAddress(localInetAddress(fd), localPort(fd)); return new InetSocketAddress(localInetAddress(fd), localPort(fd));
......
...@@ -36,7 +36,7 @@ import java.io.IOException; ...@@ -36,7 +36,7 @@ import java.io.IOException;
* @since 1.4 * @since 1.4
*/ */
interface SelChImpl extends Channel { public interface SelChImpl extends Channel {
FileDescriptor getFD(); FileDescriptor getFD();
......
...@@ -34,12 +34,12 @@ import java.nio.channels.spi.*; ...@@ -34,12 +34,12 @@ import java.nio.channels.spi.*;
* An implementation of SelectionKey for Solaris. * An implementation of SelectionKey for Solaris.
*/ */
class SelectionKeyImpl public class SelectionKeyImpl
extends AbstractSelectionKey extends AbstractSelectionKey
{ {
final SelChImpl channel; // package-private final SelChImpl channel; // package-private
final SelectorImpl selector; // package-private public final SelectorImpl selector;
// Index for a pollfd array in Selector that this key is registered with // Index for a pollfd array in Selector that this key is registered with
private int index; private int index;
...@@ -91,15 +91,15 @@ class SelectionKeyImpl ...@@ -91,15 +91,15 @@ class SelectionKeyImpl
// The nio versions of these operations do not care if a key // The nio versions of these operations do not care if a key
// has been invalidated. They are for internal use by nio code. // has been invalidated. They are for internal use by nio code.
void nioReadyOps(int ops) { // package-private public void nioReadyOps(int ops) {
readyOps = ops; readyOps = ops;
} }
int nioReadyOps() { // package-private public int nioReadyOps() {
return readyOps; return readyOps;
} }
SelectionKey nioInterestOps(int ops) { // package-private public SelectionKey nioInterestOps(int ops) {
if ((ops & ~channel().validOps()) != 0) if ((ops & ~channel().validOps()) != 0)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
channel.translateAndSetInterestOps(ops, this); channel.translateAndSetInterestOps(ops, this);
...@@ -107,7 +107,7 @@ class SelectionKeyImpl ...@@ -107,7 +107,7 @@ class SelectionKeyImpl
return this; return this;
} }
int nioInterestOps() { // package-private public int nioInterestOps() {
return interestOps; return interestOps;
} }
......
...@@ -36,7 +36,7 @@ import java.util.*; ...@@ -36,7 +36,7 @@ import java.util.*;
* Base Selector implementation class. * Base Selector implementation class.
*/ */
abstract class SelectorImpl public abstract class SelectorImpl
extends AbstractSelector extends AbstractSelector
{ {
...@@ -118,7 +118,7 @@ abstract class SelectorImpl ...@@ -118,7 +118,7 @@ abstract class SelectorImpl
protected abstract void implClose() throws IOException; protected abstract void implClose() throws IOException;
void putEventOps(SelectionKeyImpl sk, int ops) { } public void putEventOps(SelectionKeyImpl sk, int ops) { }
protected final SelectionKey register(AbstractSelectableChannel ch, protected final SelectionKey register(AbstractSelectableChannel ch,
int ops, int ops,
......
...@@ -40,7 +40,7 @@ import sun.misc.Cleaner; ...@@ -40,7 +40,7 @@ import sun.misc.Cleaner;
import sun.security.action.GetPropertyAction; import sun.security.action.GetPropertyAction;
class Util { public class Util {
// -- Caches -- // -- Caches --
...@@ -158,7 +158,7 @@ class Util { ...@@ -158,7 +158,7 @@ class Util {
/** /**
* Returns a temporary buffer of at least the given size * Returns a temporary buffer of at least the given size
*/ */
static ByteBuffer getTemporaryDirectBuffer(int size) { public static ByteBuffer getTemporaryDirectBuffer(int size) {
BufferCache cache = bufferCache.get(); BufferCache cache = bufferCache.get();
ByteBuffer buf = cache.get(size); ByteBuffer buf = cache.get(size);
if (buf != null) { if (buf != null) {
...@@ -178,7 +178,7 @@ class Util { ...@@ -178,7 +178,7 @@ class Util {
/** /**
* Releases a temporary buffer by returning to the cache or freeing it. * Releases a temporary buffer by returning to the cache or freeing it.
*/ */
static void releaseTemporaryDirectBuffer(ByteBuffer buf) { public static void releaseTemporaryDirectBuffer(ByteBuffer buf) {
offerFirstTemporaryDirectBuffer(buf); offerFirstTemporaryDirectBuffer(buf);
} }
...@@ -467,7 +467,7 @@ class Util { ...@@ -467,7 +467,7 @@ class Util {
private static boolean loaded = false; private static boolean loaded = false;
static void load() { public static void load() {
synchronized (Util.class) { synchronized (Util.class) {
if (loaded) if (loaded)
return; return;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.MessageInfo;
...@@ -31,7 +31,7 @@ import com.sun.nio.sctp.Association; ...@@ -31,7 +31,7 @@ import com.sun.nio.sctp.Association;
/** /**
* An implementation of a MessageInfo. * An implementation of a MessageInfo.
*/ */
public class SctpMessageInfoImpl extends MessageInfo { public class MessageInfoImpl extends MessageInfo {
private final SocketAddress address; private final SocketAddress address;
private final int bytes; /* 0 */ private final int bytes; /* 0 */
...@@ -43,7 +43,7 @@ public class SctpMessageInfoImpl extends MessageInfo { ...@@ -43,7 +43,7 @@ public class SctpMessageInfoImpl extends MessageInfo {
private long timeToLive; /* 0L */ private long timeToLive; /* 0L */
private int ppid; /* 0 */ private int ppid; /* 0 */
public SctpMessageInfoImpl(Association association, public MessageInfoImpl(Association association,
SocketAddress address, SocketAddress address,
int streamNumber) { int streamNumber) {
this.association = association; this.association = association;
...@@ -53,7 +53,7 @@ public class SctpMessageInfoImpl extends MessageInfo { ...@@ -53,7 +53,7 @@ public class SctpMessageInfoImpl extends MessageInfo {
} }
/* Invoked from native */ /* Invoked from native */
private SctpMessageInfoImpl(int assocId, private MessageInfoImpl(int assocId,
SocketAddress address, SocketAddress address,
int bytes, int bytes,
int streamNumber, int streamNumber,
...@@ -75,7 +75,7 @@ public class SctpMessageInfoImpl extends MessageInfo { ...@@ -75,7 +75,7 @@ public class SctpMessageInfoImpl extends MessageInfo {
} }
/** /**
* SctpMessageInfoImpl instances created from native will need to have their * MessageInfoImpl instances created from native will need to have their
* association set from the channel. * association set from the channel.
*/ */
void setAssociation(Association association) { void setAssociation(Association association) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpSocketOption;
......
...@@ -180,7 +180,7 @@ class DevPollSelectorImpl ...@@ -180,7 +180,7 @@ class DevPollSelectorImpl
((SelChImpl)selch).kill(); ((SelChImpl)selch).kill();
} }
void putEventOps(SelectionKeyImpl sk, int ops) { public void putEventOps(SelectionKeyImpl sk, int ops) {
if (closed) if (closed)
throw new ClosedSelectorException(); throw new ClosedSelectorException();
int fd = IOUtil.fdVal(sk.channel.getFD()); int fd = IOUtil.fdVal(sk.channel.getFD());
......
...@@ -181,7 +181,7 @@ class EPollSelectorImpl ...@@ -181,7 +181,7 @@ class EPollSelectorImpl
((SelChImpl)selch).kill(); ((SelChImpl)selch).kill();
} }
void putEventOps(SelectionKeyImpl sk, int ops) { public void putEventOps(SelectionKeyImpl sk, int ops) {
if (closed) if (closed)
throw new ClosedSelectorException(); throw new ClosedSelectorException();
pollWrapper.setInterest(sk.channel, ops); pollWrapper.setInterest(sk.channel, ops);
......
...@@ -37,21 +37,21 @@ package sun.nio.ch; ...@@ -37,21 +37,21 @@ package sun.nio.ch;
// always returns -1 and the signal(long) method has no effect. // always returns -1 and the signal(long) method has no effect.
class NativeThread { public class NativeThread {
// Returns an opaque token representing the native thread underlying the // Returns an opaque token representing the native thread underlying the
// invoking Java thread. On systems that do not require signalling, this // invoking Java thread. On systems that do not require signalling, this
// method always returns -1. // method always returns -1.
// //
static native long current(); public static native long current();
// Signals the given native thread so as to release it from a blocking I/O // Signals the given native thread so as to release it from a blocking I/O
// operation. On systems that do not require signalling, this method has // operation. On systems that do not require signalling, this method has
// no effect. // no effect.
// //
static native void signal(long nt); public static native void signal(long nt);
static native void init(); private static native void init();
static { static {
Util.load(); Util.load();
......
...@@ -41,9 +41,9 @@ import sun.misc.*; ...@@ -41,9 +41,9 @@ import sun.misc.*;
* @since 1.4 * @since 1.4
*/ */
class PollArrayWrapper extends AbstractPollArrayWrapper { public class PollArrayWrapper extends AbstractPollArrayWrapper {
static final short POLLCONN = POLLOUT; public static final short POLLCONN = POLLOUT;
// File descriptor to write for interrupt // File descriptor to write for interrupt
int interruptFD; int interruptFD;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.AssociationChangeNotification; import com.sun.nio.sctp.AssociationChangeNotification;
...@@ -30,7 +30,7 @@ import com.sun.nio.sctp.AssociationChangeNotification; ...@@ -30,7 +30,7 @@ import com.sun.nio.sctp.AssociationChangeNotification;
/** /**
* An implementation of AssociationChangeNotification * An implementation of AssociationChangeNotification
*/ */
public class SctpAssocChange extends AssociationChangeNotification public class AssociationChange extends AssociationChangeNotification
implements SctpNotification implements SctpNotification
{ {
/* static final ints so that they can be referenced from native */ /* static final ints so that they can be referenced from native */
...@@ -50,7 +50,7 @@ public class SctpAssocChange extends AssociationChangeNotification ...@@ -50,7 +50,7 @@ public class SctpAssocChange extends AssociationChangeNotification
private int maxInStreams; private int maxInStreams;
/* Invoked from native */ /* Invoked from native */
private SctpAssocChange(int assocId, private AssociationChange(int assocId,
int intEvent, int intEvent,
int maxOutStreams, int maxOutStreams,
int maxInStreams) { int maxInStreams) {
......
...@@ -22,15 +22,15 @@ ...@@ -22,15 +22,15 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Association;
/** /**
* An implementation of Association * An implementation of Association
*/ */
public class SctpAssociationImpl extends Association { public class AssociationImpl extends Association {
public SctpAssociationImpl(int associationID, public AssociationImpl(int associationID,
int maxInStreams, int maxInStreams,
int maxOutStreams) { int maxOutStreams) {
super(associationID, maxInStreams, maxOutStreams); super(associationID, maxInStreams, maxOutStreams);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Association;
...@@ -31,7 +31,7 @@ import com.sun.nio.sctp.PeerAddressChangeNotification; ...@@ -31,7 +31,7 @@ import com.sun.nio.sctp.PeerAddressChangeNotification;
/** /**
* An implementation of PeerAddressChangeNotification * An implementation of PeerAddressChangeNotification
*/ */
public class SctpPeerAddrChange extends PeerAddressChangeNotification public class PeerAddrChange extends PeerAddressChangeNotification
implements SctpNotification implements SctpNotification
{ {
/* static final ints so that they can be referenced from native */ /* static final ints so that they can be referenced from native */
...@@ -51,7 +51,7 @@ public class SctpPeerAddrChange extends PeerAddressChangeNotification ...@@ -51,7 +51,7 @@ public class SctpPeerAddrChange extends PeerAddressChangeNotification
private AddressChangeEvent event; private AddressChangeEvent event;
/* Invoked from native */ /* Invoked from native */
private SctpPeerAddrChange(int assocId, SocketAddress address, int intEvent) { private PeerAddrChange(int assocId, SocketAddress address, int intEvent) {
switch (intEvent) { switch (intEvent) {
case SCTP_ADDR_AVAILABLE : case SCTP_ADDR_AVAILABLE :
this.event = AddressChangeEvent.ADDR_AVAILABLE; this.event = AddressChangeEvent.ADDR_AVAILABLE;
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
/** /**
* Wraps the actual message or notification so that it can be * Wraps the actual message or notification so that it can be
* set and returned from the native receive implementation. * set and returned from the native receive implementation.
*/ */
public class SctpResultContainer { public class ResultContainer {
/* static final ints so that they can be referenced from native */ /* static final ints so that they can be referenced from native */
static final int NOTHING = 0; static final int NOTHING = 0;
static final int MESSAGE = 1; static final int MESSAGE = 1;
...@@ -63,47 +63,47 @@ public class SctpResultContainer { ...@@ -63,47 +63,47 @@ public class SctpResultContainer {
return (SctpNotification) value; return (SctpNotification) value;
} }
SctpMessageInfoImpl getMessageInfo() { MessageInfoImpl getMessageInfo() {
assert type() == MESSAGE; assert type() == MESSAGE;
if (value instanceof SctpMessageInfoImpl) if (value instanceof MessageInfoImpl)
return (SctpMessageInfoImpl) value; return (MessageInfoImpl) value;
return null; return null;
} }
SctpSendFailed getSendFailed() { SendFailed getSendFailed() {
assert type() == SEND_FAILED; assert type() == SEND_FAILED;
if (value instanceof SctpSendFailed) if (value instanceof SendFailed)
return (SctpSendFailed) value; return (SendFailed) value;
return null; return null;
} }
SctpAssocChange getAssociationChanged() { AssociationChange getAssociationChanged() {
assert type() == ASSOCIATION_CHANGED; assert type() == ASSOCIATION_CHANGED;
if (value instanceof SctpAssocChange) if (value instanceof AssociationChange)
return (SctpAssocChange) value; return (AssociationChange) value;
return null; return null;
} }
SctpPeerAddrChange getPeerAddressChanged() { PeerAddrChange getPeerAddressChanged() {
assert type() == PEER_ADDRESS_CHANGED; assert type() == PEER_ADDRESS_CHANGED;
if (value instanceof SctpPeerAddrChange) if (value instanceof PeerAddrChange)
return (SctpPeerAddrChange) value; return (PeerAddrChange) value;
return null; return null;
} }
SctpShutdown getShutdown() { Shutdown getShutdown() {
assert type() == SHUTDOWN; assert type() == SHUTDOWN;
if (value instanceof SctpShutdown) if (value instanceof Shutdown)
return (SctpShutdown) value; return (Shutdown) value;
return null; return null;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
...@@ -53,11 +53,20 @@ import com.sun.nio.sctp.MessageInfo; ...@@ -53,11 +53,20 @@ import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.NotificationHandler;
import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpSocketOption;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.IOStatus;
import sun.nio.ch.IOUtil;
import sun.nio.ch.NativeThread;
import sun.nio.ch.Net;
import sun.nio.ch.PollArrayWrapper;
import sun.nio.ch.SelChImpl;
import sun.nio.ch.SelectionKeyImpl;
import sun.nio.ch.Util;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*; import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
import static sun.nio.ch.SctpResultContainer.SEND_FAILED; import static sun.nio.ch.sctp.ResultContainer.SEND_FAILED;
import static sun.nio.ch.SctpResultContainer.ASSOCIATION_CHANGED; import static sun.nio.ch.sctp.ResultContainer.ASSOCIATION_CHANGED;
import static sun.nio.ch.SctpResultContainer.PEER_ADDRESS_CHANGED; import static sun.nio.ch.sctp.ResultContainer.PEER_ADDRESS_CHANGED;
import static sun.nio.ch.SctpResultContainer.SHUTDOWN; import static sun.nio.ch.sctp.ResultContainer.SHUTDOWN;
/** /**
* An implementation of an SctpChannel * An implementation of an SctpChannel
...@@ -745,7 +754,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -745,7 +754,7 @@ public class SctpChannelImpl extends SctpChannel
receiveInvoked.set(Boolean.TRUE); receiveInvoked.set(Boolean.TRUE);
try { try {
SctpResultContainer resultContainer = new SctpResultContainer(); ResultContainer resultContainer = new ResultContainer();
do { do {
resultContainer.clear(); resultContainer.clear();
synchronized (receiveLock) { synchronized (receiveLock) {
...@@ -775,7 +784,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -775,7 +784,7 @@ public class SctpChannelImpl extends SctpChannel
/* message or nothing */ /* message or nothing */
if (resultContainer.hasSomething()) { if (resultContainer.hasSomething()) {
/* Set the association before returning */ /* Set the association before returning */
SctpMessageInfoImpl info = MessageInfoImpl info =
resultContainer.getMessageInfo(); resultContainer.getMessageInfo();
synchronized (stateLock) { synchronized (stateLock) {
assert association != null; assert association != null;
...@@ -812,7 +821,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -812,7 +821,7 @@ public class SctpChannelImpl extends SctpChannel
private int receive(int fd, private int receive(int fd,
ByteBuffer dst, ByteBuffer dst,
SctpResultContainer resultContainer, ResultContainer resultContainer,
boolean peek) boolean peek)
throws IOException { throws IOException {
int pos = dst.position(); int pos = dst.position();
...@@ -837,7 +846,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -837,7 +846,7 @@ public class SctpChannelImpl extends SctpChannel
} }
private int receiveIntoNativeBuffer(int fd, private int receiveIntoNativeBuffer(int fd,
SctpResultContainer resultContainer, ResultContainer resultContainer,
ByteBuffer bb, ByteBuffer bb,
int rem, int rem,
int pos, int pos,
...@@ -854,7 +863,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -854,7 +863,7 @@ public class SctpChannelImpl extends SctpChannel
private InternalNotificationHandler internalNotificationHandler = private InternalNotificationHandler internalNotificationHandler =
new InternalNotificationHandler(); new InternalNotificationHandler();
private void handleNotificationInternal(SctpResultContainer resultContainer) private void handleNotificationInternal(ResultContainer resultContainer)
{ {
invokeNotificationHandler(resultContainer, invokeNotificationHandler(resultContainer,
internalNotificationHandler, null); internalNotificationHandler, null);
...@@ -869,8 +878,8 @@ public class SctpChannelImpl extends SctpChannel ...@@ -869,8 +878,8 @@ public class SctpChannelImpl extends SctpChannel
if (not.event().equals( if (not.event().equals(
AssociationChangeNotification.AssocChangeEvent.COMM_UP) && AssociationChangeNotification.AssocChangeEvent.COMM_UP) &&
association == null) { association == null) {
SctpAssocChange sac = (SctpAssocChange) not; AssociationChange sac = (AssociationChange) not;
association = new SctpAssociationImpl association = new AssociationImpl
(sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams());
} }
return HandlerResult.CONTINUE; return HandlerResult.CONTINUE;
...@@ -878,7 +887,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -878,7 +887,7 @@ public class SctpChannelImpl extends SctpChannel
} }
private <T> HandlerResult invokeNotificationHandler private <T> HandlerResult invokeNotificationHandler
(SctpResultContainer resultContainer, (ResultContainer resultContainer,
NotificationHandler<T> handler, NotificationHandler<T> handler,
T attachment) { T attachment) {
SctpNotification notification = resultContainer.notification(); SctpNotification notification = resultContainer.notification();
...@@ -1078,7 +1087,7 @@ public class SctpChannelImpl extends SctpChannel ...@@ -1078,7 +1087,7 @@ public class SctpChannelImpl extends SctpChannel
/* Native */ /* Native */
private static native void initIDs(); private static native void initIDs();
static native int receive0(int fd, SctpResultContainer resultContainer, static native int receive0(int fd, ResultContainer resultContainer,
long address, int length, boolean peek) throws IOException; long address, int length, boolean peek) throws IOException;
static native int send0(int fd, long address, int length, static native int send0(int fd, long address, int length,
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
...@@ -53,8 +53,17 @@ import com.sun.nio.sctp.MessageInfo; ...@@ -53,8 +53,17 @@ import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpMultiChannel; import com.sun.nio.sctp.SctpMultiChannel;
import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpSocketOption;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.NativeThread;
import sun.nio.ch.IOStatus;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Net;
import sun.nio.ch.PollArrayWrapper;
import sun.nio.ch.SelChImpl;
import sun.nio.ch.SelectionKeyImpl;
import sun.nio.ch.Util;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*; import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
import static sun.nio.ch.SctpResultContainer.*; import static sun.nio.ch.sctp.ResultContainer.*;
/** /**
* An implementation of SctpMultiChannel * An implementation of SctpMultiChannel
...@@ -466,7 +475,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -466,7 +475,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
receiveInvoked.set(Boolean.TRUE); receiveInvoked.set(Boolean.TRUE);
try { try {
SctpResultContainer resultContainer = new SctpResultContainer(); ResultContainer resultContainer = new ResultContainer();
do { do {
resultContainer.clear(); resultContainer.clear();
synchronized (receiveLock) { synchronized (receiveLock) {
...@@ -498,7 +507,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -498,7 +507,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
/* message or nothing */ /* message or nothing */
if (resultContainer.hasSomething()) { if (resultContainer.hasSomething()) {
/* Set the association before returning */ /* Set the association before returning */
SctpMessageInfoImpl info = MessageInfoImpl info =
resultContainer.getMessageInfo(); resultContainer.getMessageInfo();
info.setAssociation(lookupAssociation(info. info.setAssociation(lookupAssociation(info.
associationID())); associationID()));
...@@ -542,7 +551,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -542,7 +551,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
private int receive(int fd, private int receive(int fd,
ByteBuffer dst, ByteBuffer dst,
SctpResultContainer resultContainer) ResultContainer resultContainer)
throws IOException { throws IOException {
int pos = dst.position(); int pos = dst.position();
int lim = dst.limit(); int lim = dst.limit();
...@@ -566,7 +575,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -566,7 +575,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
} }
private int receiveIntoNativeBuffer(int fd, private int receiveIntoNativeBuffer(int fd,
SctpResultContainer resultContainer, ResultContainer resultContainer,
ByteBuffer bb, ByteBuffer bb,
int rem, int rem,
int pos) int pos)
...@@ -580,7 +589,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -580,7 +589,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
private InternalNotificationHandler internalNotificationHandler = private InternalNotificationHandler internalNotificationHandler =
new InternalNotificationHandler(); new InternalNotificationHandler();
private void handleNotificationInternal(SctpResultContainer resultContainer) private void handleNotificationInternal(ResultContainer resultContainer)
{ {
invokeNotificationHandler(resultContainer, invokeNotificationHandler(resultContainer,
internalNotificationHandler, null); internalNotificationHandler, null);
...@@ -592,12 +601,12 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -592,12 +601,12 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
@Override @Override
public HandlerResult handleNotification( public HandlerResult handleNotification(
AssociationChangeNotification not, Object unused) { AssociationChangeNotification not, Object unused) {
SctpAssocChange sac = (SctpAssocChange) not; AssociationChange sac = (AssociationChange) not;
/* Update map to reflect change in association */ /* Update map to reflect change in association */
switch (not.event()) { switch (not.event()) {
case COMM_UP : case COMM_UP :
Association newAssociation = new SctpAssociationImpl Association newAssociation = new AssociationImpl
(sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams());
addAssociation(newAssociation); addAssociation(newAssociation);
break; break;
...@@ -612,7 +621,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -612,7 +621,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
} }
private <T> HandlerResult invokeNotificationHandler( private <T> HandlerResult invokeNotificationHandler(
SctpResultContainer resultContainer, ResultContainer resultContainer,
NotificationHandler<T> handler, NotificationHandler<T> handler,
T attachment) { T attachment) {
HandlerResult result; HandlerResult result;
...@@ -956,7 +965,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel ...@@ -956,7 +965,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
/* Use common native implementation shared between /* Use common native implementation shared between
* one-to-one and one-to-many */ * one-to-one and one-to-many */
private static int receive0(int fd, private static int receive0(int fd,
SctpResultContainer resultContainer, ResultContainer resultContainer,
long address, long address,
int length) int length)
throws IOException{ throws IOException{
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.IOException; import java.io.IOException;
...@@ -34,6 +34,8 @@ import java.util.Set; ...@@ -34,6 +34,8 @@ import java.util.Set;
import java.util.HashSet; import java.util.HashSet;
import java.security.AccessController; import java.security.AccessController;
import sun.security.action.GetPropertyAction; import sun.security.action.GetPropertyAction;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Net;
import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpSocketOption;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*; import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.Notification; import com.sun.nio.sctp.Notification;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
...@@ -41,6 +41,15 @@ import com.sun.nio.sctp.SctpChannel; ...@@ -41,6 +41,15 @@ import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpServerChannel; import com.sun.nio.sctp.SctpServerChannel;
import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpSocketOption;
import com.sun.nio.sctp.SctpStandardSocketOptions; import com.sun.nio.sctp.SctpStandardSocketOptions;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.NativeThread;
import sun.nio.ch.IOStatus;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Net;
import sun.nio.ch.PollArrayWrapper;
import sun.nio.ch.SelChImpl;
import sun.nio.ch.SelectionKeyImpl;
import sun.nio.ch.Util;
/** /**
* An implementation of SctpServerChannel * An implementation of SctpServerChannel
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.net.SocketAddress; import java.net.SocketAddress;
...@@ -32,7 +32,7 @@ import com.sun.nio.sctp.SendFailedNotification; ...@@ -32,7 +32,7 @@ import com.sun.nio.sctp.SendFailedNotification;
/** /**
* An implementation of SendFailedNotification * An implementation of SendFailedNotification
*/ */
public class SctpSendFailed extends SendFailedNotification public class SendFailed extends SendFailedNotification
implements SctpNotification implements SctpNotification
{ {
private Association association; private Association association;
...@@ -45,7 +45,7 @@ public class SctpSendFailed extends SendFailedNotification ...@@ -45,7 +45,7 @@ public class SctpSendFailed extends SendFailedNotification
private int streamNumber; private int streamNumber;
/* Invoked from native */ /* Invoked from native */
private SctpSendFailed(int assocId, private SendFailed(int assocId,
SocketAddress address, SocketAddress address,
ByteBuffer buffer, ByteBuffer buffer,
int errorCode, int errorCode,
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.ShutdownNotification; import com.sun.nio.sctp.ShutdownNotification;
...@@ -30,7 +30,7 @@ import com.sun.nio.sctp.ShutdownNotification; ...@@ -30,7 +30,7 @@ import com.sun.nio.sctp.ShutdownNotification;
/** /**
* An implementation of ShutdownNotification * An implementation of ShutdownNotification
*/ */
public class SctpShutdown extends ShutdownNotification public class Shutdown extends ShutdownNotification
implements SctpNotification implements SctpNotification
{ {
private Association association; private Association association;
...@@ -39,7 +39,7 @@ public class SctpShutdown extends ShutdownNotification ...@@ -39,7 +39,7 @@ public class SctpShutdown extends ShutdownNotification
private int assocId; private int assocId;
/* Invoked from native */ /* Invoked from native */
private SctpShutdown(int assocId) { private Shutdown(int assocId) {
this.assocId = assocId; this.assocId = assocId;
} }
......
...@@ -32,21 +32,21 @@ ...@@ -32,21 +32,21 @@
#include "nio.h" #include "nio.h"
#include "net_util.h" #include "net_util.h"
#include "net_util_md.h" #include "net_util_md.h"
#include "sun_nio_ch_SctpNet.h" #include "sun_nio_ch_sctp_SctpNet.h"
#include "sun_nio_ch_SctpChannelImpl.h" #include "sun_nio_ch_sctp_SctpChannelImpl.h"
#include "sun_nio_ch_SctpAssocChange.h" #include "sun_nio_ch_sctp_AssociationChange.h"
#include "sun_nio_ch_SctpResultContainer.h" #include "sun_nio_ch_sctp_ResultContainer.h"
#include "sun_nio_ch_SctpPeerAddrChange.h" #include "sun_nio_ch_sctp_PeerAddrChange.h"
/* sizeof(union sctp_notification */ /* sizeof(union sctp_notification */
#define NOTIFICATION_BUFFER_SIZE 280 #define NOTIFICATION_BUFFER_SIZE 280
#define MESSAGE_IMPL_CLASS "sun/nio/ch/SctpMessageInfoImpl" #define MESSAGE_IMPL_CLASS "sun/nio/ch/sctp/MessageInfoImpl"
#define RESULT_CONTAINER_CLASS "sun/nio/ch/SctpResultContainer" #define RESULT_CONTAINER_CLASS "sun/nio/ch/sctp/ResultContainer"
#define SEND_FAILED_CLASS "sun/nio/ch/SctpSendFailed" #define SEND_FAILED_CLASS "sun/nio/ch/sctp/SendFailed"
#define ASSOC_CHANGE_CLASS "sun/nio/ch/SctpAssocChange" #define ASSOC_CHANGE_CLASS "sun/nio/ch/sctp/AssociationChange"
#define PEER_CHANGE_CLASS "sun/nio/ch/SctpPeerAddrChange" #define PEER_CHANGE_CLASS "sun/nio/ch/sctp/PeerAddrChange"
#define SHUTDOWN_CLASS "sun/nio/ch/SctpShutdown" #define SHUTDOWN_CLASS "sun/nio/ch/sctp/Shutdown"
struct controlData { struct controlData {
int assocId; int assocId;
...@@ -55,38 +55,40 @@ struct controlData { ...@@ -55,38 +55,40 @@ struct controlData {
unsigned int ppid; unsigned int ppid;
}; };
static jclass smi_class; /* sun.nio.ch.SctpMessageInfoImpl */ static jclass smi_class; /* sun.nio.ch.sctp.MessageInfoImpl */
static jmethodID smi_ctrID; /* sun.nio.ch.SctpMessageInfoImpl.<init> */ static jmethodID smi_ctrID; /* sun.nio.ch.sctp.MessageInfoImpl.<init> */
static jfieldID src_valueID; /* sun.nio.ch.SctpResultContainer.value */ static jfieldID src_valueID; /* sun.nio.ch.sctp.ResultContainer.value */
static jfieldID src_typeID; /* sun.nio.ch.SctpResultContainer.type */ static jfieldID src_typeID; /* sun.nio.ch.sctp.ResultContainer.type */
static jclass ssf_class; /* sun.nio.ch.SctpSendFailed */ static jclass ssf_class; /* sun.nio.ch.sctp.SendFailed */
static jmethodID ssf_ctrID; /* sun.nio.ch.SctpSendFailed.<init> */ static jmethodID ssf_ctrID; /* sun.nio.ch.sctp.SendFailed.<init> */
static jclass sac_class; /* sun.nio.ch.SctpAssociationChanged */ static jclass sac_class; /* sun.nio.ch.sctp.AssociationChange */
static jmethodID sac_ctrID; /* sun.nio.ch.SctpAssociationChanged.<init> */ static jmethodID sac_ctrID; /* sun.nio.ch.sctp.AssociationChange.<init> */
static jclass spc_class; /* sun.nio.ch.SctpPeerAddressChanged */ static jclass spc_class; /* sun.nio.ch.sctp.PeerAddressChanged */
static jmethodID spc_ctrID; /* sun.nio.ch.SctpPeerAddressChanged.<init> */ static jmethodID spc_ctrID; /* sun.nio.ch.sctp.PeerAddressChanged.<init> */
static jclass ss_class; /* sun.nio.ch.SctpShutdown */ static jclass ss_class; /* sun.nio.ch.sctp.Shutdown */
static jmethodID ss_ctrID; /* sun.nio.ch.SctpShutdown.<init> */ static jmethodID ss_ctrID; /* sun.nio.ch.sctp.Shutdown.<init> */
static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */ static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */
static jfieldID isa_portID; /* java.net.InetSocketAddress.port */ static jfieldID isa_portID; /* java.net.InetSocketAddress.port */
/* defined in SctpNet.c */ /* defined in SctpNet.c */
jobject SockAddrToInetSocketAddress(JNIEnv* env, struct sockaddr* addr); jobject SockAddrToInetSocketAddress(JNIEnv* env, struct sockaddr* addr);
jint handleSocketError(JNIEnv *env, jint errorValue);
/* use SocketChannelImpl's checkConnect implementation */ /* use SocketChannelImpl's checkConnect implementation */
extern jint Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv* env, extern jint Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv* env,
jobject this, jobject fdo, jboolean block, jboolean ready); jobject this, jobject fdo, jboolean block, jboolean ready);
/* /*
* Class: sun_nio_ch_SctpChannelImpl * Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: initIDs * Method: initIDs
* Signature: ()V * Signature: ()V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs
(JNIEnv *env, jclass klass) { (JNIEnv *env, jclass klass) {
jclass cls; jclass cls;
/* SctpMessageInfoImpl */ /* MessageInfoImpl */
cls = (*env)->FindClass(env, MESSAGE_IMPL_CLASS); cls = (*env)->FindClass(env, MESSAGE_IMPL_CLASS);
CHECK_NULL(cls); CHECK_NULL(cls);
smi_class = (*env)->NewGlobalRef(env, cls); smi_class = (*env)->NewGlobalRef(env, cls);
...@@ -95,7 +97,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs ...@@ -95,7 +97,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
"(ILjava/net/SocketAddress;IIZZI)V"); "(ILjava/net/SocketAddress;IIZZI)V");
CHECK_NULL(smi_ctrID); CHECK_NULL(smi_ctrID);
/* SctpResultContainer */ /* ResultContainer */
cls = (*env)->FindClass(env, RESULT_CONTAINER_CLASS); cls = (*env)->FindClass(env, RESULT_CONTAINER_CLASS);
CHECK_NULL(cls); CHECK_NULL(cls);
src_valueID = (*env)->GetFieldID(env, cls, "value", "Ljava/lang/Object;"); src_valueID = (*env)->GetFieldID(env, cls, "value", "Ljava/lang/Object;");
...@@ -103,7 +105,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs ...@@ -103,7 +105,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
src_typeID = (*env)->GetFieldID(env, cls, "type", "I"); src_typeID = (*env)->GetFieldID(env, cls, "type", "I");
CHECK_NULL(src_typeID); CHECK_NULL(src_typeID);
/* SctpSendFailed */ /* SendFailed */
cls = (*env)->FindClass(env, SEND_FAILED_CLASS); cls = (*env)->FindClass(env, SEND_FAILED_CLASS);
CHECK_NULL(cls); CHECK_NULL(cls);
ssf_class = (*env)->NewGlobalRef(env, cls); ssf_class = (*env)->NewGlobalRef(env, cls);
...@@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs ...@@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
"(ILjava/net/SocketAddress;Ljava/nio/ByteBuffer;II)V"); "(ILjava/net/SocketAddress;Ljava/nio/ByteBuffer;II)V");
CHECK_NULL(ssf_ctrID); CHECK_NULL(ssf_ctrID);
/* SctpAssocChange */ /* AssociationChange */
cls = (*env)->FindClass(env, ASSOC_CHANGE_CLASS); cls = (*env)->FindClass(env, ASSOC_CHANGE_CLASS);
CHECK_NULL(cls); CHECK_NULL(cls);
sac_class = (*env)->NewGlobalRef(env, cls); sac_class = (*env)->NewGlobalRef(env, cls);
...@@ -120,7 +122,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs ...@@ -120,7 +122,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
sac_ctrID = (*env)->GetMethodID(env, cls, "<init>", "(IIII)V"); sac_ctrID = (*env)->GetMethodID(env, cls, "<init>", "(IIII)V");
CHECK_NULL(sac_ctrID); CHECK_NULL(sac_ctrID);
/* SctpPeerAddrChange */ /* PeerAddrChange */
cls = (*env)->FindClass(env, PEER_CHANGE_CLASS); cls = (*env)->FindClass(env, PEER_CHANGE_CLASS);
CHECK_NULL(cls); CHECK_NULL(cls);
spc_class = (*env)->NewGlobalRef(env, cls); spc_class = (*env)->NewGlobalRef(env, cls);
...@@ -129,7 +131,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs ...@@ -129,7 +131,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
"(ILjava/net/SocketAddress;I)V"); "(ILjava/net/SocketAddress;I)V");
CHECK_NULL(spc_ctrID); CHECK_NULL(spc_ctrID);
/* sun.nio.ch.SctpShutdown */ /* Shutdown */
cls = (*env)->FindClass(env, SHUTDOWN_CLASS); cls = (*env)->FindClass(env, SHUTDOWN_CLASS);
CHECK_NULL(cls); CHECK_NULL(cls);
ss_class = (*env)->NewGlobalRef(env, cls); ss_class = (*env)->NewGlobalRef(env, cls);
...@@ -266,13 +268,13 @@ void handleSendFailed ...@@ -266,13 +268,13 @@ void handleSendFailed
} }
} }
/* create SctpSendFailed */ /* create SendFailed */
resultObj = (*env)->NewObject(env, ssf_class, ssf_ctrID, ssf->ssf_assoc_id, resultObj = (*env)->NewObject(env, ssf_class, ssf_ctrID, ssf->ssf_assoc_id,
isaObj, bufferObj, ssf->ssf_error, sri->sinfo_stream); isaObj, bufferObj, ssf->ssf_error, sri->sinfo_stream);
CHECK_NULL(resultObj); CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID, (*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_SEND_FAILED); sun_nio_ch_sctp_ResultContainer_SEND_FAILED);
} }
void handleAssocChange void handleAssocChange
...@@ -282,38 +284,38 @@ void handleAssocChange ...@@ -282,38 +284,38 @@ void handleAssocChange
switch (sac->sac_state) { switch (sac->sac_state) {
case SCTP_COMM_UP : case SCTP_COMM_UP :
state = sun_nio_ch_SctpAssocChange_SCTP_COMM_UP; state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_UP;
break; break;
case SCTP_COMM_LOST : case SCTP_COMM_LOST :
state = sun_nio_ch_SctpAssocChange_SCTP_COMM_LOST; state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_LOST;
break; break;
case SCTP_RESTART : case SCTP_RESTART :
state = sun_nio_ch_SctpAssocChange_SCTP_RESTART; state = sun_nio_ch_sctp_AssociationChange_SCTP_RESTART;
break; break;
case SCTP_SHUTDOWN_COMP : case SCTP_SHUTDOWN_COMP :
state = sun_nio_ch_SctpAssocChange_SCTP_SHUTDOWN; state = sun_nio_ch_sctp_AssociationChange_SCTP_SHUTDOWN;
break; break;
case SCTP_CANT_STR_ASSOC : case SCTP_CANT_STR_ASSOC :
state = sun_nio_ch_SctpAssocChange_SCTP_CANT_START; state = sun_nio_ch_sctp_AssociationChange_SCTP_CANT_START;
} }
/* create SctpAssociationChanged */ /* create AssociationChange */
resultObj = (*env)->NewObject(env, sac_class, sac_ctrID, sac->sac_assoc_id, resultObj = (*env)->NewObject(env, sac_class, sac_ctrID, sac->sac_assoc_id,
state, sac->sac_outbound_streams, sac->sac_inbound_streams); state, sac->sac_outbound_streams, sac->sac_inbound_streams);
CHECK_NULL(resultObj); CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID, (*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_ASSOCIATION_CHANGED); sun_nio_ch_sctp_ResultContainer_ASSOCIATION_CHANGED);
} }
void handleShutdown void handleShutdown
(JNIEnv* env, jobject resultContainerObj, struct sctp_shutdown_event* sse) { (JNIEnv* env, jobject resultContainerObj, struct sctp_shutdown_event* sse) {
/* create SctpShutdown */ /* create Shutdown */
jobject resultObj = (*env)->NewObject(env, ss_class, ss_ctrID, sse->sse_assoc_id); jobject resultObj = (*env)->NewObject(env, ss_class, ss_ctrID, sse->sse_assoc_id);
CHECK_NULL(resultObj); CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID, (*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_SHUTDOWN); sun_nio_ch_sctp_ResultContainer_SHUTDOWN);
} }
void handlePeerAddrChange void handlePeerAddrChange
...@@ -324,35 +326,35 @@ void handlePeerAddrChange ...@@ -324,35 +326,35 @@ void handlePeerAddrChange
switch (state) { switch (state) {
case SCTP_ADDR_AVAILABLE : case SCTP_ADDR_AVAILABLE :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_AVAILABLE; event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_AVAILABLE;
break; break;
case SCTP_ADDR_UNREACHABLE : case SCTP_ADDR_UNREACHABLE :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_UNREACHABLE; event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_UNREACHABLE;
break; break;
case SCTP_ADDR_REMOVED : case SCTP_ADDR_REMOVED :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_REMOVED; event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_REMOVED;
break; break;
case SCTP_ADDR_ADDED : case SCTP_ADDR_ADDED :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_ADDED; event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_ADDED;
break; break;
case SCTP_ADDR_MADE_PRIM : case SCTP_ADDR_MADE_PRIM :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_MADE_PRIM; event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM;
#ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ #ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */
break; break;
case SCTP_ADDR_CONFIRMED : case SCTP_ADDR_CONFIRMED :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_CONFIRMED; event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED;
#endif /* __linux__ */ #endif /* __linux__ */
} }
addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr); addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr);
/* create SctpPeerAddressChanged */ /* create PeerAddressChanged */
resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id, resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id,
addressObj, event); addressObj, event);
CHECK_NULL(resultObj); CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID, (*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_PEER_ADDRESS_CHANGED); sun_nio_ch_sctp_ResultContainer_PEER_ADDRESS_CHANGED);
} }
void handleUninteresting void handleUninteresting
...@@ -403,7 +405,7 @@ void handleMessage ...@@ -403,7 +405,7 @@ void handleMessage
isa = SockAddrToInetSocketAddress(env, sap); isa = SockAddrToInetSocketAddress(env, sap);
getControlData(msg, cdata); getControlData(msg, cdata);
/* create SctpMessageInfoImpl */ /* create MessageInfoImpl */
resultObj = (*env)->NewObject(env, smi_class, smi_ctrID, cdata->assocId, resultObj = (*env)->NewObject(env, smi_class, smi_ctrID, cdata->assocId,
isa, read, cdata->streamNumber, isa, read, cdata->streamNumber,
isEOR ? JNI_TRUE : JNI_FALSE, isEOR ? JNI_TRUE : JNI_FALSE,
...@@ -411,15 +413,15 @@ void handleMessage ...@@ -411,15 +413,15 @@ void handleMessage
CHECK_NULL(resultObj); CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID, (*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_MESSAGE); sun_nio_ch_sctp_ResultContainer_MESSAGE);
} }
/* /*
* Class: sun_nio_ch_SctpChannelImpl * Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: receive0 * Method: receive0
* Signature: (ILsun/nio/ch/SctpResultContainer;JIZ)I * Signature: (ILsun/nio/ch/sctp/ResultContainer;JIZ)I
*/ */
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0 JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0
(JNIEnv *env, jclass klass, jint fd, jobject resultContainerObj, (JNIEnv *env, jclass klass, jint fd, jobject resultContainerObj,
jlong address, jint length, jboolean peek) { jlong address, jint length, jboolean peek) {
SOCKADDR sa; SOCKADDR sa;
...@@ -505,11 +507,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0 ...@@ -505,11 +507,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0
} }
/* /*
* Class: sun_nio_ch_SctpChannelImpl * Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: send0 * Method: send0
* Signature: (IJILjava/net/SocketAddress;IIZI)I * Signature: (IJILjava/net/SocketAddress;IIZI)I
*/ */
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0 JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_send0
(JNIEnv *env, jclass klass, jint fd, jlong address, jint length, (JNIEnv *env, jclass klass, jint fd, jlong address, jint length,
jobject saTarget, jint assocId, jint streamNumber, jboolean unordered, jobject saTarget, jint assocId, jint streamNumber, jboolean unordered,
jint ppid) { jint ppid) {
...@@ -582,11 +584,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0 ...@@ -582,11 +584,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0
} }
/* /*
* Class: sun_nio_ch_SctpChannelImpl * Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: checkConnect * Method: checkConnect
* Signature: (Ljava/io/FileDescriptor;ZZ)I * Signature: (Ljava/io/FileDescriptor;ZZ)I
*/ */
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_checkConnect JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect
(JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready) { (JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready) {
return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this, return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this,
fdo, block, ready); fdo, block, ready);
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "nio.h" #include "nio.h"
#include "net_util.h" #include "net_util.h"
#include "net_util_md.h" #include "net_util_md.h"
#include "sun_nio_ch_SctpNet.h" #include "sun_nio_ch_sctp_SctpNet.h"
#include "sun_nio_ch_SctpStdSocketOption.h" #include "sun_nio_ch_sctp_SctpStdSocketOption.h"
static jclass isaCls = 0; static jclass isaCls = 0;
static jmethodID isaCtrID = 0; static jmethodID isaCtrID = 0;
...@@ -143,12 +143,12 @@ handleSocketError(JNIEnv *env, jint errorValue) ...@@ -143,12 +143,12 @@ handleSocketError(JNIEnv *env, jint errorValue)
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: init * Method: init
* Signature: ()V * Signature: ()V
*/ */
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_nio_ch_SctpNet_init Java_sun_nio_ch_sctp_SctpNet_init
(JNIEnv *env, jclass cl) { (JNIEnv *env, jclass cl) {
int sp[2]; int sp[2];
if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) { if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) {
...@@ -160,11 +160,11 @@ Java_sun_nio_ch_SctpNet_init ...@@ -160,11 +160,11 @@ Java_sun_nio_ch_SctpNet_init
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: socket0 * Method: socket0
* Signature: (Z)I * Signature: (Z)I
*/ */
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpNet_socket0
(JNIEnv *env, jclass klass, jboolean oneToOne) { (JNIEnv *env, jclass klass, jboolean oneToOne) {
int fd; int fd;
struct sctp_event_subscribe event; struct sctp_event_subscribe event;
...@@ -202,11 +202,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 ...@@ -202,11 +202,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: bindx * Method: bindx
* Signature: (I[Ljava/net/InetAddress;IIZ)V * Signature: (I[Ljava/net/InetAddress;IIZ)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_bindx
(JNIEnv *env, jclass klass, jint fd, jobjectArray addrs, jint port, (JNIEnv *env, jclass klass, jint fd, jobjectArray addrs, jint port,
jint addrsLength, jboolean add, jboolean preferIPv6) { jint addrsLength, jboolean add, jboolean preferIPv6) {
SOCKADDR *sap, *tmpSap; SOCKADDR *sap, *tmpSap;
...@@ -241,24 +241,24 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx ...@@ -241,24 +241,24 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: listen0 * Method: listen0
* Signature: (II)V * Signature: (II)V
*/ */
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_nio_ch_SctpNet_listen0 Java_sun_nio_ch_sctp_SctpNet_listen0
(JNIEnv *env, jclass cl, jint fd, jint backlog) { (JNIEnv *env, jclass cl, jint fd, jint backlog) {
if (listen(fd, backlog) < 0) if (listen(fd, backlog) < 0)
handleSocketError(env, errno); handleSocketError(env, errno);
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: connect0 * Method: connect0
* Signature: (ILjava/net/InetAddress;I)I * Signature: (ILjava/net/InetAddress;I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_sun_nio_ch_SctpNet_connect0 Java_sun_nio_ch_sctp_SctpNet_connect0
(JNIEnv *env, jclass clazz, int fd, jobject iao, jint port) { (JNIEnv *env, jclass clazz, int fd, jobject iao, jint port) {
SOCKADDR sa; SOCKADDR sa;
int sa_len = SOCKADDR_LEN; int sa_len = SOCKADDR_LEN;
...@@ -282,12 +282,12 @@ Java_sun_nio_ch_SctpNet_connect0 ...@@ -282,12 +282,12 @@ Java_sun_nio_ch_SctpNet_connect0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: close0 * Method: close0
* Signature: (I)V * Signature: (I)V
*/ */
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_nio_ch_SctpNet_close0 Java_sun_nio_ch_sctp_SctpNet_close0
(JNIEnv *env, jclass clazz, jint fd) { (JNIEnv *env, jclass clazz, jint fd) {
if (fd != -1) { if (fd != -1) {
int rv = close(fd); int rv = close(fd);
...@@ -297,12 +297,12 @@ Java_sun_nio_ch_SctpNet_close0 ...@@ -297,12 +297,12 @@ Java_sun_nio_ch_SctpNet_close0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: preClose0 * Method: preClose0
* Signature: (I)V * Signature: (I)V
*/ */
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_nio_ch_SctpNet_preClose0 Java_sun_nio_ch_sctp_SctpNet_preClose0
(JNIEnv *env, jclass clazz, jint fd) { (JNIEnv *env, jclass clazz, jint fd) {
if (preCloseFD >= 0) { if (preCloseFD >= 0) {
if (dup2(preCloseFD, fd) < 0) if (dup2(preCloseFD, fd) < 0)
...@@ -340,11 +340,11 @@ jobject SockAddrToInetSocketAddress ...@@ -340,11 +340,11 @@ jobject SockAddrToInetSocketAddress
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: getLocalAddresses0 * Method: getLocalAddresses0
* Signature: (I)[Ljava/net/SocketAddress; * Signature: (I)[Ljava/net/SocketAddress;
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_SctpNet_getLocalAddresses0 JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0
(JNIEnv *env, jclass klass, jint fd) { (JNIEnv *env, jclass klass, jint fd) {
void *addr_buf, *laddr; void *addr_buf, *laddr;
struct sockaddr* sap; struct sockaddr* sap;
...@@ -448,11 +448,11 @@ jobjectArray getRemoteAddresses ...@@ -448,11 +448,11 @@ jobjectArray getRemoteAddresses
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: getRemoteAddresses0 * Method: getRemoteAddresses0
* Signature: (II)[Ljava/net/SocketAddress; * Signature: (II)[Ljava/net/SocketAddress;
*/ */
JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_SctpNet_getRemoteAddresses0 JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0
(JNIEnv *env, jclass klass, jint fd, jint assocId) { (JNIEnv *env, jclass klass, jint fd, jint assocId) {
return getRemoteAddresses(env, fd, assocId); return getRemoteAddresses(env, fd, assocId);
} }
...@@ -465,13 +465,13 @@ int mapSocketOption ...@@ -465,13 +465,13 @@ int mapSocketOption
int level; int level;
int optname; int optname;
} const opts[] = { } const opts[] = {
{ sun_nio_ch_SctpStdSocketOption_SCTP_DISABLE_FRAGMENTS, IPPROTO_SCTP, SCTP_DISABLE_FRAGMENTS }, { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_DISABLE_FRAGMENTS, IPPROTO_SCTP, SCTP_DISABLE_FRAGMENTS },
{ sun_nio_ch_SctpStdSocketOption_SCTP_EXPLICIT_COMPLETE, IPPROTO_SCTP, SCTP_EXPLICIT_EOR }, { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_EXPLICIT_COMPLETE, IPPROTO_SCTP, SCTP_EXPLICIT_EOR },
{ sun_nio_ch_SctpStdSocketOption_SCTP_FRAGMENT_INTERLEAVE, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE }, { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_FRAGMENT_INTERLEAVE, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE },
{ sun_nio_ch_SctpStdSocketOption_SCTP_NODELAY, IPPROTO_SCTP, SCTP_NODELAY }, { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_NODELAY, IPPROTO_SCTP, SCTP_NODELAY },
{ sun_nio_ch_SctpStdSocketOption_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF }, { sun_nio_ch_sctp_SctpStdSocketOption_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF },
{ sun_nio_ch_SctpStdSocketOption_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF }, { sun_nio_ch_sctp_SctpStdSocketOption_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF },
{ sun_nio_ch_SctpStdSocketOption_SO_LINGER, SOL_SOCKET, SO_LINGER } }; { sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER, SOL_SOCKET, SO_LINGER } };
int i; int i;
for (i=0; i<(int)(sizeof(opts) / sizeof(opts[0])); i++) { for (i=0; i<(int)(sizeof(opts) / sizeof(opts[0])); i++) {
...@@ -487,11 +487,11 @@ int mapSocketOption ...@@ -487,11 +487,11 @@ int mapSocketOption
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: setIntOption0 * Method: setIntOption0
* Signature: (III)V * Signature: (III)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setIntOption0
(JNIEnv *env, jclass klass, jint fd, jint opt, int arg) { (JNIEnv *env, jclass klass, jint fd, jint opt, int arg) {
int klevel, kopt; int klevel, kopt;
int result; int result;
...@@ -505,7 +505,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 ...@@ -505,7 +505,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0
return; return;
} }
if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) { if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) {
parg = (void *)&linger; parg = (void *)&linger;
arglen = sizeof(linger); arglen = sizeof(linger);
if (arg >= 0) { if (arg >= 0) {
...@@ -522,16 +522,16 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 ...@@ -522,16 +522,16 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0
if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) { if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) {
JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
"sun_nio_ch_SctpNet.setIntOption0"); "sun_nio_ch_sctp_SctpNet.setIntOption0");
} }
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: getIntOption0 * Method: getIntOption0
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_getIntOption0
(JNIEnv *env, jclass klass, jint fd, jint opt) { (JNIEnv *env, jclass klass, jint fd, jint opt) {
int klevel, kopt; int klevel, kopt;
int result; int result;
...@@ -545,7 +545,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 ...@@ -545,7 +545,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0
return -1; return -1;
} }
if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) { if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) {
arg = (void *)&linger; arg = (void *)&linger;
arglen = sizeof(linger); arglen = sizeof(linger);
} else { } else {
...@@ -559,18 +559,18 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 ...@@ -559,18 +559,18 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0
return -1; return -1;
} }
if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER)
return linger.l_onoff ? linger.l_linger : -1; return linger.l_onoff ? linger.l_linger : -1;
else else
return result; return result;
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: getPrimAddrOption0 * Method: getPrimAddrOption0
* Signature: (II)Ljava/net/SocketAddress; * Signature: (II)Ljava/net/SocketAddress;
*/ */
JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0 JNIEXPORT jobject JNICALL Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0
(JNIEnv *env, jclass klass, jint fd, jint assocId) { (JNIEnv *env, jclass klass, jint fd, jint assocId) {
struct sctp_setprim prim; struct sctp_setprim prim;
unsigned int prim_len = sizeof(prim); unsigned int prim_len = sizeof(prim);
...@@ -588,11 +588,11 @@ JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0 ...@@ -588,11 +588,11 @@ JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: setPrimAddrOption0 * Method: setPrimAddrOption0
* Signature: (IILjava/net/InetAddress;I)V * Signature: (IILjava/net/InetAddress;I)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0
(JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) { (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) {
struct sctp_setprim prim; struct sctp_setprim prim;
struct sockaddr* sap = (struct sockaddr*)&prim.ssp_addr; struct sockaddr* sap = (struct sockaddr*)&prim.ssp_addr;
...@@ -612,11 +612,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 ...@@ -612,11 +612,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: setPeerPrimAddrOption0 * Method: setPeerPrimAddrOption0
* Signature: (IILjava/net/InetAddress;I)V * Signature: (IILjava/net/InetAddress;I)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0
(JNIEnv *env, jclass klass, jint fd, jint assocId, (JNIEnv *env, jclass klass, jint fd, jint assocId,
jobject iaObj, jint port, jboolean preferIPv6) { jobject iaObj, jint port, jboolean preferIPv6) {
struct sctp_setpeerprim prim; struct sctp_setpeerprim prim;
...@@ -638,11 +638,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 ...@@ -638,11 +638,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: getInitMsgOption0 * Method: getInitMsgOption0
* Signature: (I[I)V * Signature: (I[I)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0
(JNIEnv *env, jclass klass, jint fd, jintArray retVal) { (JNIEnv *env, jclass klass, jint fd, jintArray retVal) {
struct sctp_initmsg sctp_initmsg; struct sctp_initmsg sctp_initmsg;
unsigned int sim_len = sizeof(sctp_initmsg); unsigned int sim_len = sizeof(sctp_initmsg);
...@@ -661,11 +661,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0 ...@@ -661,11 +661,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: setInitMsgOption0 * Method: setInitMsgOption0
* Signature: (III)V * Signature: (III)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0
(JNIEnv *env, jclass klass, jint fd, jint inArg, jint outArg) { (JNIEnv *env, jclass klass, jint fd, jint inArg, jint outArg) {
struct sctp_initmsg sctp_initmsg; struct sctp_initmsg sctp_initmsg;
...@@ -682,11 +682,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0 ...@@ -682,11 +682,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: shutdown0 * Method: shutdown0
* Signature: (II)V * Signature: (II)V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_shutdown0
(JNIEnv *env, jclass klass, jint fd, jint assocId) { (JNIEnv *env, jclass klass, jint fd, jint assocId) {
int rv; int rv;
struct msghdr msg[1]; struct msghdr msg[1];
...@@ -738,11 +738,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0 ...@@ -738,11 +738,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0
} }
/* /*
* Class: sun_nio_ch_SctpNet * Class: sun_nio_ch_sctp_SctpNet
* Method: branch * Method: branch
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_branch0 JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_branch0
(JNIEnv *env, jclass klass, jint fd, jint assocId) { (JNIEnv *env, jclass klass, jint fd, jint assocId) {
int newfd = 0; int newfd = 0;
if ((newfd = nio_sctp_peeloff(fd, assocId)) < 0) { if ((newfd = nio_sctp_peeloff(fd, assocId)) < 0) {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* questions. * questions.
*/ */
#include "sun_nio_ch_SctpServerChannelImpl.h" #include "sun_nio_ch_sctp_SctpServerChannelImpl.h"
extern void Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(JNIEnv* env, extern void Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(JNIEnv* env,
jclass c); jclass c);
...@@ -32,21 +32,21 @@ extern jint Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv* env, ...@@ -32,21 +32,21 @@ extern jint Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv* env,
jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa); jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa);
/* /*
* Class: sun_nio_ch_SctpServerChannelImpl * Class: sun_nio_ch_sctp_SctpServerChannelImpl
* Method: initIDs * Method: initIDs
* Signature: ()V * Signature: ()V
*/ */
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpServerChannelImpl_initIDs JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs
(JNIEnv* env, jclass c) { (JNIEnv* env, jclass c) {
Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(env, c); Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(env, c);
} }
/* /*
* Class: sun_nio_ch_SctpServerChannelImpl * Class: sun_nio_ch_sctp_SctpServerChannelImpl
* Method: accept0 * Method: accept0
* Signature: (Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;[Ljava/net/InetSocketAddress;)I * Signature: (Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;[Ljava/net/InetSocketAddress;)I
*/ */
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpServerChannelImpl_accept0 JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0
(JNIEnv* env, jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa) { (JNIEnv* env, jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa) {
return Java_sun_nio_ch_ServerSocketChannelImpl_accept0(env, this, return Java_sun_nio_ch_ServerSocketChannelImpl_accept0(env, this,
ssfdo, newfdo, isaa); ssfdo, newfdo, isaa);
......
...@@ -585,7 +585,7 @@ final class WindowsSelectorImpl extends SelectorImpl { ...@@ -585,7 +585,7 @@ final class WindowsSelectorImpl extends SelectorImpl {
((SelChImpl)selch).kill(); ((SelChImpl)selch).kill();
} }
void putEventOps(SelectionKeyImpl sk, int ops) { public void putEventOps(SelectionKeyImpl sk, int ops) {
synchronized (closeLock) { synchronized (closeLock) {
if (pollWrapper == null) if (pollWrapper == null)
throw new ClosedSelectorException(); throw new ClosedSelectorException();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.net.InetAddress; import java.net.InetAddress;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.net.InetAddress; import java.net.InetAddress;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
package sun.nio.ch; package sun.nio.ch.sctp;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.net.InetAddress; import java.net.InetAddress;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册