author | chegar |
Sun, 17 Aug 2014 15:54:13 +0100 | |
changeset 25859 | 3317bb8137f4 |
parent 23879 | jdk/src/windows/native/java/net/ExtendedOptionsImpl.c@284802a2d355 |
permissions | -rw-r--r-- |
23879
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
1 |
/* |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
4 |
* |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
10 |
* |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
15 |
* accompanied this code). |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
16 |
* |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
20 |
* |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
23 |
* questions. |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
24 |
*/ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
25 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
26 |
#include <jni.h> |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
27 |
#include <string.h> |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
28 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
29 |
#include "net_util.h" |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
30 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
31 |
/* |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
32 |
* Class: sun_net_ExtendedOptionsImpl |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
33 |
* Method: init |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
34 |
* Signature: ()V |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
35 |
*/ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
36 |
JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_init |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
37 |
(JNIEnv *env, jclass UNUSED) |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
38 |
{ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
39 |
} |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
40 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
41 |
/* Non Solaris. Functionality is not supported. So, throw UnsupportedOpExc */ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
42 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
43 |
JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_setFlowOption |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
44 |
(JNIEnv *env, jclass UNUSED, jobject fileDesc, jobject flow) |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
45 |
{ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
46 |
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException", |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
47 |
"unsupported socket option"); |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
48 |
} |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
49 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
50 |
JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_getFlowOption |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
51 |
(JNIEnv *env, jclass UNUSED, jobject fileDesc, jobject flow) |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
52 |
{ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
53 |
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException", |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
54 |
"unsupported socket option"); |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
55 |
} |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
56 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
57 |
static jboolean flowSupported0() { |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
58 |
return JNI_FALSE; |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
59 |
} |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
60 |
|
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
61 |
JNIEXPORT jboolean JNICALL Java_sun_net_ExtendedOptionsImpl_flowSupported |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
62 |
(JNIEnv *env, jclass UNUSED) |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
63 |
{ |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
64 |
return JNI_FALSE; |
284802a2d355
8036979: Support java.net.SocketOption<> in java.net socket types
michaelm
parents:
diff
changeset
|
65 |
} |