5.0.0/ARO.Core/src/c/AROJpcap/Jpcap.c
void jpcap_handler(u_char *args, const struct pcap_pkthdr *header, const u_char *data) {

	jbyteArray dataArray;

	struct user_data *user = (struct user_data *) args;
	JNIEnv *env = user->env;

	dataArray = (*env)->NewByteArray(env, (jsize) header->caplen);
	(*env)->SetByteArrayRegion(env, dataArray, 0, (jsize) header->caplen, data);
	(*env)->CallVoidMethod(env, user->obj, user->handler, (jint) user->datalink, (jlong) header->ts.tv_sec, (jlong) header->ts.tv_usec, (jint) header->len, dataArray);
	(*env)->DeleteLocalRef(env, dataArray);

}
/*
 * report the packet back to Java caller
 */
report the packet back to Java caller
report the packet back to Java caller
void jpcap_handler(u_char *args, const struct pcap_pkthdr *header, const u_char *data) {
	jbyteArray dataArray;
	struct user_data *user = (struct user_data *) args;
	JNIEnv *env = user->env;
	dataArray = (*env)->NewByteArray(env, (jsize) header->caplen);
	(*env)->SetByteArrayRegion(env, dataArray, 0, (jsize) header->caplen, data);
	(*env)->CallVoidMethod(env, user->obj, user->handler, (jint) user->datalink, (jlong) header->ts.tv_sec, (jlong) header->ts.tv_usec, (jint) header->len, dataArray);
	(*env)->DeleteLocalRef(env, dataArray);
}
void jpcap_handler ( u_char * args , const struct pcap_pkthdr * header , const u_char * data ) { jbyteArray dataArray ; struct user_data * user = ( struct user_data * ) args ; JNIEnv * env = user -> env ; dataArray = ( * env ) -> NewByteArray ( env , ( jsize ) header -> caplen ) ; ( * env ) -> SetByteArrayRegion ( env , dataArray , 0 , ( jsize ) header -> caplen , data ) ; ( * env ) -> CallVoidMethod ( env , user -> obj , user -> handler , ( jint ) user -> datalink , ( jlong ) header -> ts . tv_sec , ( jlong ) header -> ts . tv_usec , ( jint ) header -> len , dataArray ) ; ( * env ) -> DeleteLocalRef ( env , dataArray ) ; }
report the packet back to Java caller
report the packet back to Java caller