/* If the type of record given in the pseudo header indicate the presence of an extension header then, read all the extension headers  */
static gboolean pcap_read_erf_exheader(FILE_T fh, union wtap_pseudo_header *pseudo_header, int *err, gchar **err_info, guint *psize)
/* If the type of record given in the pseudo header indicate the presence of an extension header then, read all the extension headers  */
static gboolean pcap_read_erf_exheader(FILE_T fh, union wtap_pseudo_header *pseudo_header, int *err, gchar **err_info, guint *psize)
{
	guint8 erf_exhdr[8];
	guint64 erf_exhdr_sw;
	int i = 0, max = sizeof(pseudo_header->erf.ehdr_list)/sizeof(struct erf_ehdr);
	guint8 type;
	*psize = 0;
	if (pseudo_header->erf.phdr.type & 0x80){
		do{
			if (!wtap_read_bytes(fh, erf_exhdr, 8, err, err_info))
				return FALSE;
			type = erf_exhdr[0];
			erf_exhdr_sw = pntoh64(erf_exhdr);
			if (i < max)
				memcpy(&pseudo_header->erf.ehdr_list[i].ehdr, &erf_exhdr_sw, sizeof(erf_exhdr_sw));
			*psize += 8;
			i++;
		} while (type & 0x80);
	}
	return TRUE;
}