5.0.0/ARO.Core/src/c/AROJpcap/Jpcap.c
int readPcap(pcap_t *pcds, int cnt, pcap_handler callback, u_char *user) {

	struct pcap_pkthdr *pcap_packet_header; // The header that pcap gives us
	const u_char *pkt_data;
	int result = 0;

	while ((cnt == -1)||(cnt-- > 0)) {
		errno = 0;
		result = pcap_next_ex(pcds, &pcap_packet_header, &pkt_data);
		if (result != -2) { // test for end of file
			if (result != -1) { // skip unreadable packets
				jpcap_handler(user, pcap_packet_header, pkt_data);
			}
		} else {
			cnt = 0;
		}
	}
	return 1;
}
/*
 * read entire pcap file until end of file is reached
 * ignores unreadable packets such as Null/Loopback
 */
read entire pcap file until end of file is reached
ignores unreadable packets such as Null/Loopback
read entire pcap file until end of file is reached ignores unreadable packets such as Null / Loopback
int readPcap(pcap_t *pcds, int cnt, pcap_handler callback, u_char *user) {
	struct pcap_pkthdr *pcap_packet_header; 
	const u_char *pkt_data;
	int result = 0;
	while ((cnt == -1)||(cnt-- > 0)) {
		errno = 0;
		result = pcap_next_ex(pcds, &pcap_packet_header, &pkt_data);
		if (result != -2) { 
			if (result != -1) { 
				jpcap_handler(user, pcap_packet_header, pkt_data);
			}
		} else {
			cnt = 0;
		}
	}
	return 1;
}
int readPcap ( pcap_t * pcds , int cnt , pcap_handler callback , u_char * user ) { struct pcap_pkthdr * pcap_packet_header ; const u_char * pkt_data ; int result = 0 ; while ( ( cnt == -1 ) || ( cnt -- > 0 ) ) { errno = 0 ; result = pcap_next_ex ( pcds , & pcap_packet_header , & pkt_data ) ; if ( result != -2 ) { if ( result != -1 ) { jpcap_handler ( user , pcap_packet_header , pkt_data ) ; } } else { cnt = 0 ; } } return 1 ; }
read entire pcap file until end of file is reached
 ignores unreadable packets such as Null/Loopback
read entire pcap file until end of file is reached ignores unreadable packets such as Null / Loopback
// The header that pcap gives us
 // test for end of file
 // skip unreadable packets
