< prev index next > src/java.base/share/native/libnet/InetAddress.c
Print this page
/*
! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
/*
! * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
jfieldID ia_holderID;
jfieldID iac_addressID;
jfieldID iac_familyID;
jfieldID iac_hostNameID;
jfieldID iac_origHostNameID;
- jfieldID ia_preferIPv6AddressID;
static int ia_initialized = 0;
/*
* Class: java_net_InetAddress
CHECK_NULL(c);
iac_class = (*env)->NewGlobalRef(env, c);
CHECK_NULL(iac_class);
ia_holderID = (*env)->GetFieldID(env, ia_class, "holder", "Ljava/net/InetAddress$InetAddressHolder;");
CHECK_NULL(ia_holderID);
- ia_preferIPv6AddressID = (*env)->GetStaticFieldID(env, ia_class, "preferIPv6Address", "I");
- CHECK_NULL(ia_preferIPv6AddressID);
iac_addressID = (*env)->GetFieldID(env, iac_class, "address", "I");
CHECK_NULL(iac_addressID);
iac_familyID = (*env)->GetFieldID(env, iac_class, "family", "I");
CHECK_NULL(iac_familyID);
iac_origHostNameID = (*env)->GetFieldID(env, iac_class, "originalHostName", "Ljava/lang/String;");
CHECK_NULL(iac_origHostNameID);
ia_initialized = 1;
}
}
+
+ /*
+ * Class: java_net_InetAddress
+ * Method: isIPv4Available
+ */
+ JNIEXPORT jboolean JNICALL
+ Java_java_net_InetAddress_isIPv4Available(JNIEnv *env, jclass clazz) {
+ return ipv4_available();
+ }
< prev index next >