/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <windows.h>
#include <winsock2.h>
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include "jlong.h"
#include "nio.h"
#include "nio_util.h"
#include "net_util.h"
#include "sun_nio_ch_Net.h"
/**
* Definitions to allow for building with older SDK include files.
*/
#ifndef MCAST_BLOCK_SOURCE
#endif /* MCAST_BLOCK_SOURCE */
typedef struct my_ip_mreq_source {
};
typedef struct my_group_source_req {
};
/**
* Copy IPv6 address as jbytearray to target
*/
/**
* Enable or disable receipt of WSAECONNRESET errors.
*/
}
{
/* nothing to do */
}
{
/*
* Return true if Windows Vista or newer, and IPv6 is configured
*/
GetVersionEx(&ver);
{
return JNI_TRUE;
}
return JNI_FALSE;
}
int version;
GetVersionEx(&ver);
//if os <= xp exclusive binding is off by default
}
{
return JNI_FALSE;
}
{
return JNI_FALSE;
}
{
SOCKET s;
if (s != INVALID_SOCKET) {
/* IPV6_V6ONLY is true by default */
int opt = 0;
}
/* Disable WSAECONNRESET errors for initially unconnected UDP sockets */
if (!stream) {
setConnectionReset(s, FALSE);
}
} else {
}
return (jint)s;
}
{
int rv;
int sa_len;
return;
}
if (rv == SOCKET_ERROR)
}
{
}
}
{
int rv;
int sa_len;
return IOS_THROWN;
}
if (rv != 0) {
return IOS_UNAVAILABLE;
}
return IOS_THROWN;
} else {
/* Enable WSAECONNRESET errors when a UDP socket is connected */
setConnectionReset(s, TRUE);
}
}
return 1;
}
{
return 0;
}
return IOS_THROWN;
}
}
{
int port;
return NULL;
}
}
{
return 0;
}
return IOS_THROWN;
}
}
{
int port;
return NULL;
}
}
{
int result = 0;
char *arg;
int arglen, n;
} else {
}
/**
* HACK: IP_TOS is deprecated on Windows and querying the option
* returns a protocol error. NET_GetSockOpt handles this and uses
* a fallback mechanism.
*/
}
if (mayNeedConversion) {
} else {
}
if (n < 0) {
return IOS_THROWN;
}
else
return result;
}
{
char *parg;
int arglen, n;
if (arg >= 0) {
} else {
}
} else {
}
if (mayNeedConversion) {
} else {
}
if (n < 0)
}
{
void* optval;
if (source == 0) {
} else {
optval = (void*)&mreq_source;
optlen = sizeof(mreq_source);
}
if (n < 0) {
return IOS_UNAVAILABLE;
}
return 0;
}
{
int n;
(void*)&mreq_source, sizeof(mreq_source));
if (n < 0) {
return IOS_UNAVAILABLE;
}
return 0;
}
/**
* Call setsockopt with a IPPROTO_IPV6 level socket option
* and a group_source_req structure as the option value. The
* given IPv6 group, interface index, and IPv6 source address
* are copied into the structure.
*/
int opt,
{
}
{
int n;
} else {
}
if (n < 0) {
}
return 0;
}
{
if (n < 0) {
}
return 0;
}
{
int n;
if (n < 0) {
}
}
{
int n;
if (n < 0) {
return IOS_THROWN;
}
}
{
int n;
if (n < 0) {
}
}
{
int index;
int n;
if (n < 0) {
return -1;
}
}
}
}