Created
January 31, 2022 15:01
-
-
Save n8fr8/1c7b80f54408f7b1aad16fe56013510a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JNIEXPORT jint JNICALL Java_org_torproject_android_service_vpn_Tun2Socks_processDnsPacket( | |
jclass cls, | |
JNIEnv* env, | |
jbyteArray array, | |
jint dataLength) | |
{ | |
jsize num_bytes = (*env)->GetArrayLength(env, array); | |
printf("Byte length : %d\n" , num_bytes); | |
unsigned char * buffer; | |
jbyte *lib ; | |
lib =(jbyte *) malloc( ( num_bytes +1 ) * sizeof(jbyte)); | |
jbyte* dataPtr = (*env)->GetByteArrayElements(env, datapacket, NULL); | |
process_device_dns_packet ((uint8_t *)dataPtr, dataLength); | |
(*env)->ReleaseByteArrayElements(env, datapacket, JNI_ABORT); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment