/*
* 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 "jni.h"
#include "jvm.h"
#include "jni_util.h"
#include "net_util.h"
int IPv6_supported() ;
static int IPv6_available;
{
return IPv6_available ;
}
{
jstring s;
if (JVM_InitializeSocketLibrary() < 0) {
"failed to initialize net library.");
return JNI_VERSION_1_2;
}
}
/*
Since we have initialized and loaded the Socket library we will
check now to whether we have IPv6 on this platform and if the
supporting socket APIs are available
*/
return JNI_VERSION_1_2;
}
static int initialized = 0;
if (!initialized) {
initialized = 1;
}
}
/* The address, and family fields used to be in InetAddress
* but are now in an implementation object. So, there is an extra
* level of indirection to access them now.
*/
extern jfieldID ia_holderID;
extern jfieldID iac_addressID;
extern jfieldID iac_familyID;
}
}
}
}
}
}
#ifdef AF_INET6
#ifdef WIN32
#else
#endif
if (NET_IsIPv4Mapped(caddr)) {
int address;
if (inet4Cls == 0) {
CHECK_NULL_RETURN(c, NULL);
}
} else {
if (inet6Cls == 0) {
CHECK_NULL_RETURN(c, NULL);
}
if (scope > 0)
}
} else
#endif /* AF_INET6 */
{
if (inet4Cls == 0) {
CHECK_NULL_RETURN(c, NULL);
}
}
return iaObj;
}
{
#ifdef AF_INET6
#ifdef WIN32
#else
#endif
if (NET_IsIPv4Mapped(caddrNew)) {
int addrNew;
int addrCur;
return JNI_FALSE;
}
return JNI_TRUE;
} else {
return JNI_FALSE;
}
} else {
int scope;
return JNI_FALSE;
}
return JNI_TRUE;
} else {
return JNI_FALSE;
}
}
} else
#endif /* AF_INET6 */
{
return JNI_FALSE;
}
return JNI_TRUE;
} else {
return JNI_FALSE;
}
}
}
unsigned short
int sum = 0;
unsigned short *w = addr;
unsigned short answer = 0;
while(nleft > 1) {
sum += *w++;
nleft -= 2;
}
if (nleft == 1) {
*(unsigned char *) (&answer) = *(unsigned char *)w;
}
return (answer);
}