jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java
author khazra
Thu, 28 Mar 2013 14:34:18 -0700
changeset 18212 22f8c33b0690
parent 14342 8435a30053c1
child 23010 6dadb192ad81
permissions -rw-r--r--
8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost Reviewed-by: alanb, chegar, hawtin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 11823
diff changeset
     2
 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     4
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4669
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4669
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    10
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    15
 * accompanied this code).
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    16
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4669
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4669
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4669
diff changeset
    23
 * questions.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    24
 */
11823
ee83ae88512d 7041778: Move SCTP implementation out of sun.nio.ch and into its own package
chegar
parents: 10137
diff changeset
    25
package sun.nio.ch.sctp;
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    26
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    27
import java.io.FileDescriptor;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    28
import java.io.IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    29
import java.net.InetAddress;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    30
import java.net.InetSocketAddress;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    31
import java.net.SocketAddress;
4669
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    32
import java.nio.channels.AlreadyBoundException;
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    33
import java.util.Set;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    34
import java.util.HashSet;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    35
import java.security.AccessController;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    36
import sun.security.action.GetPropertyAction;
11823
ee83ae88512d 7041778: Move SCTP implementation out of sun.nio.ch and into its own package
chegar
parents: 10137
diff changeset
    37
import sun.nio.ch.IOUtil;
ee83ae88512d 7041778: Move SCTP implementation out of sun.nio.ch and into its own package
chegar
parents: 10137
diff changeset
    38
import sun.nio.ch.Net;
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    39
import com.sun.nio.sctp.SctpSocketOption;
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 7668
diff changeset
    40
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    41
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    42
public class SctpNet {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    43
    static final String osName = AccessController.doPrivileged(
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    44
                    new GetPropertyAction("os.name"));
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    45
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    46
    /* -- Miscellaneous SCTP utilities -- */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    47
7545
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
    48
    private static boolean IPv4MappedAddresses() {
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    49
        if ("SunOS".equals(osName)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    50
            /* Solaris supports IPv4Mapped Addresses with bindx */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    51
            return true;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    52
        } /* else {  //other OS/implementations  */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    53
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    54
        /* lksctp/linux requires Ipv4 addresses */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    55
        return false;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    56
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    57
4669
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    58
    static boolean throwAlreadyBoundException() throws IOException {
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    59
        throw new AlreadyBoundException();
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    60
    }
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    61
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    62
    static void listen(int fd, int backlog) throws IOException {
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    63
        listen0(fd, backlog);
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    64
    }
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    65
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    66
    static int connect(int fd, InetAddress remote, int remotePort)
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    67
            throws IOException {
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    68
        return connect0(fd, remote, remotePort);
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    69
    }
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    70
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    71
    static void close(int fd) throws IOException {
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    72
        close0(fd);
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    73
    }
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    74
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    75
    static void preClose(int fd) throws IOException {
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    76
        preClose0(fd);
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    77
    }
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    78
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    79
    /**
4669
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
    80
     * @param  oneToOne
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    81
     *         if {@code true} returns a one-to-one sctp socket, otherwise
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    82
     *         returns a one-to-many sctp socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    83
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    84
    static FileDescriptor socket(boolean oneToOne) throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    85
        int nativefd = socket0(oneToOne);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    86
        return IOUtil.newFD(nativefd);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    87
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    88
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    89
    static void bindx(int fd, InetAddress[] addrs, int port, boolean add)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    90
            throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    91
        bindx(fd, addrs, port, addrs.length, add,
7545
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
    92
                IPv4MappedAddresses());
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    93
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    94
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    95
    static Set<SocketAddress> getLocalAddresses(int fd)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    96
            throws IOException {
18212
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
    97
        Set<SocketAddress> set = null;
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    98
        SocketAddress[] saa = getLocalAddresses0(fd);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    99
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   100
        if (saa != null) {
18212
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   101
            set = getRevealedLocalAddressSet(saa);
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   102
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   103
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   104
        return set;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   105
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   106
18212
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   107
    private static Set<SocketAddress> getRevealedLocalAddressSet(
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   108
            SocketAddress[] saa)
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   109
    {
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   110
         SecurityManager sm = System.getSecurityManager();
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   111
         Set<SocketAddress> set = new HashSet<>(saa.length);
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   112
         for (SocketAddress sa : saa) {
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   113
             set.add(getRevealedLocalAddress(sa, sm));
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   114
         }
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   115
         return set;
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   116
    }
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   117
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   118
    private static SocketAddress getRevealedLocalAddress(SocketAddress sa,
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   119
                                                         SecurityManager sm)
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   120
    {
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   121
        if (sm == null || sa == null)
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   122
            return sa;
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   123
        InetSocketAddress ia = (InetSocketAddress)sa;
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   124
        try{
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   125
            sm.checkConnect(ia.getAddress().getHostAddress(), -1);
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   126
            // Security check passed
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   127
        } catch (SecurityException e) {
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   128
            // Return loopback address
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   129
            return new InetSocketAddress(InetAddress.getLoopbackAddress(),
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   130
                                         ia.getPort());
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   131
        }
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   132
        return sa;
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   133
    }
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
   134
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   135
    static Set<SocketAddress> getRemoteAddresses(int fd, int assocId)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   136
            throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   137
        HashSet<SocketAddress> set = null;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   138
        SocketAddress[] saa = getRemoteAddresses0(fd, assocId);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   139
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   140
        if (saa != null) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   141
            set = new HashSet<SocketAddress>(saa.length);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   142
            for (SocketAddress sa : saa)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   143
                set.add(sa);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   144
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   145
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   146
        return set;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   147
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   148
10137
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   149
    static <T> void setSocketOption(int fd,
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   150
                                    SctpSocketOption<T> name,
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   151
                                    T value,
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   152
                                    int assocId)
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   153
            throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   154
        if (value == null)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   155
            throw new IllegalArgumentException("Invalid option value");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   156
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   157
        if (name.equals(SCTP_INIT_MAXSTREAMS)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   158
            InitMaxStreams maxStreamValue = (InitMaxStreams)value;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   159
            SctpNet.setInitMsgOption0(fd,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   160
                 maxStreamValue.maxInStreams(), maxStreamValue.maxOutStreams());
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   161
        } else if (name.equals(SCTP_PRIMARY_ADDR) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   162
                   name.equals(SCTP_SET_PEER_PRIMARY_ADDR)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   163
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   164
            SocketAddress addr  = (SocketAddress) value;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   165
            if (addr == null)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   166
                throw new IllegalArgumentException("Invalid option value");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   167
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   168
            Net.checkAddress(addr);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   169
            InetSocketAddress netAddr = (InetSocketAddress)addr;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   170
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   171
            if (name.equals(SCTP_PRIMARY_ADDR)) {
7545
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   172
                setPrimAddrOption0(fd,
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   173
                                   assocId,
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   174
                                   netAddr.getAddress(),
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   175
                                   netAddr.getPort());
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   176
            } else {
7545
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   177
                setPeerPrimAddrOption0(fd,
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   178
                                       assocId,
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   179
                                       netAddr.getAddress(),
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   180
                                       netAddr.getPort(),
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   181
                                       IPv4MappedAddresses());
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   182
            }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   183
        } else if (name.equals(SCTP_DISABLE_FRAGMENTS) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   184
            name.equals(SCTP_EXPLICIT_COMPLETE) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   185
            name.equals(SCTP_FRAGMENT_INTERLEAVE) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   186
            name.equals(SCTP_NODELAY) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   187
            name.equals(SO_SNDBUF) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   188
            name.equals(SO_RCVBUF) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   189
            name.equals(SO_LINGER)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   190
            setIntOption(fd, name, value);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   191
        } else {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   192
            throw new AssertionError("Unknown socket option");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   193
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   194
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   195
10137
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   196
    static Object getSocketOption(int fd, SctpSocketOption<?> name, int assocId)
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   197
             throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   198
         if (name.equals(SCTP_SET_PEER_PRIMARY_ADDR)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   199
            throw new IllegalArgumentException(
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   200
                    "SCTP_SET_PEER_PRIMARY_ADDR cannot be retrieved");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   201
        } else if (name.equals(SCTP_INIT_MAXSTREAMS)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   202
            /* container for holding maxIn/Out streams */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   203
            int[] values = new int[2];
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   204
            SctpNet.getInitMsgOption0(fd, values);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   205
            return InitMaxStreams.create(values[0], values[1]);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   206
        } else if (name.equals(SCTP_PRIMARY_ADDR)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   207
            return getPrimAddrOption0(fd, assocId);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   208
        } else if (name.equals(SCTP_DISABLE_FRAGMENTS) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   209
            name.equals(SCTP_EXPLICIT_COMPLETE) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   210
            name.equals(SCTP_FRAGMENT_INTERLEAVE) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   211
            name.equals(SCTP_NODELAY) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   212
            name.equals(SO_SNDBUF) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   213
            name.equals(SO_RCVBUF) ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   214
            name.equals(SO_LINGER)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   215
            return getIntOption(fd, name);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   216
        } else {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   217
            throw new AssertionError("Unknown socket option");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   218
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   219
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   220
10137
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   221
    static void setIntOption(int fd, SctpSocketOption<?> name, Object value)
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   222
            throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   223
        if (value == null)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   224
            throw new IllegalArgumentException("Invalid option value");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   225
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   226
        Class<?> type = name.type();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   227
        if (type != Integer.class && type != Boolean.class)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   228
            throw new AssertionError("Should not reach here");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   229
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   230
        if (name == SO_RCVBUF ||
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   231
            name == SO_SNDBUF)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   232
        {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   233
            int i = ((Integer)value).intValue();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   234
            if (i < 0)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   235
                throw new IllegalArgumentException(
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   236
                        "Invalid send/receive buffer size");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   237
        } else if (name == SO_LINGER) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   238
            int i = ((Integer)value).intValue();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   239
            if (i < 0)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   240
                value = Integer.valueOf(-1);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   241
            if (i > 65535)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   242
                value = Integer.valueOf(65535);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   243
        } else if (name.equals(SCTP_FRAGMENT_INTERLEAVE)) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   244
            int i = ((Integer)value).intValue();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   245
            if (i < 0 || i > 2)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   246
                throw new IllegalArgumentException(
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   247
                        "Invalid value for SCTP_FRAGMENT_INTERLEAVE");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   248
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   249
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   250
        int arg;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   251
        if (type == Integer.class) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   252
            arg = ((Integer)value).intValue();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   253
        } else {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   254
            boolean b = ((Boolean)value).booleanValue();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   255
            arg = (b) ? 1 : 0;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   256
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   257
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   258
        setIntOption0(fd, ((SctpStdSocketOption)name).constValue(), arg);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   259
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   260
10137
d92637d3d673 7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9679
diff changeset
   261
    static Object getIntOption(int fd, SctpSocketOption<?> name)
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   262
            throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   263
        Class<?> type = name.type();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   264
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   265
        if (type != Integer.class && type != Boolean.class)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   266
            throw new AssertionError("Should not reach here");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   267
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   268
        if (!(name instanceof SctpStdSocketOption))
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   269
            throw new AssertionError("Should not reach here");
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   270
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   271
        int value = getIntOption0(fd,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   272
                ((SctpStdSocketOption)name).constValue());
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   273
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   274
        if (type == Integer.class) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   275
            return Integer.valueOf(value);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   276
        } else {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   277
            return (value == 0) ? Boolean.FALSE : Boolean.TRUE;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   278
        }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   279
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   280
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   281
    static void shutdown(int fd, int assocId)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   282
            throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   283
        shutdown0(fd, assocId);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   284
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   285
3072
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   286
    static FileDescriptor branch(int fd, int assocId) throws IOException {
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   287
        int nativefd = branch0(fd, assocId);
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   288
        return IOUtil.newFD(nativefd);
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   289
    }
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   290
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   291
    /* Native Methods */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   292
    static native int socket0(boolean oneToOne) throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   293
4669
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   294
    static native void listen0(int fd, int backlog) throws IOException;
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   295
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   296
    static native int connect0(int fd, InetAddress remote, int remotePort)
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   297
        throws IOException;
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   298
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   299
    static native void close0(int fd) throws IOException;
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   300
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   301
    static native void preClose0(int fd) throws IOException;
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   302
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   303
    static native void bindx(int fd, InetAddress[] addrs, int port, int length,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   304
            boolean add, boolean preferIPv6) throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   305
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   306
    static native int getIntOption0(int fd, int opt) throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   307
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   308
    static native void setIntOption0(int fd, int opt, int arg)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   309
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   310
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   311
    static native SocketAddress[] getLocalAddresses0(int fd) throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   312
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   313
    static native SocketAddress[] getRemoteAddresses0(int fd, int assocId)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   314
            throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   315
3072
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   316
    static native int branch0(int fd, int assocId) throws IOException;
a801b122142f 6855335: Several changes in the SCTP implementation.
chegar
parents: 2542
diff changeset
   317
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   318
    static native void setPrimAddrOption0(int fd, int assocId, InetAddress ia,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   319
            int port) throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   320
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   321
    static native void setPeerPrimAddrOption0(int fd, int assocId,
7545
409091945418 7004439: SCTP_SET_PEER_PRIMARY_ADDR throws SocketException on Linux
chegar
parents: 5506
diff changeset
   322
            InetAddress ia, int port, boolean preferIPv6) throws IOException;
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   323
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   324
    static native SocketAddress getPrimAddrOption0(int fd, int assocId)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   325
            throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   326
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   327
    /* retVals [0] maxInStreams, [1] maxOutStreams */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   328
    static native void getInitMsgOption0(int fd, int[] retVals) throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   329
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   330
    static native void setInitMsgOption0(int fd, int arg1, int arg2)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   331
            throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   332
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   333
    static native void shutdown0(int fd, int assocId);
4669
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   334
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   335
    static native void init();
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   336
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   337
    static {
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   338
        init();
11d1dbd3598d 6915313: Reorganize implementation to make it more feasible to port to JDK6
chegar
parents: 3072
diff changeset
   339
    }
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   340
}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   341